Sign in to follow this  
Followers 0

Possible Bug with @TempDir

6 posts in this topic

Hi all,

I wanted to post this as a possible bug with the new version v3.2.0.1 running with SciTe (8.21.2006).

I coded a small demo that uses the WinZip 10 installer from and runs through the GUI installation. After the application is installed, it will launch it and open a compiled zip file. Then open a compressed .doc in that zip file.

The bug:

After winzip is installed the @TempDir goes from:

"C:\docu blah blah\blah\blah" to "C;\docu blah blah\blah\blah"

Look closely, it inserts a SEMI colon instead of a colon, thus blowing the script up! Isn't that odd? I've included all the code for yourself so you can give it a test run. Previously I was using @tempdir throughout the whole script. I went back and replaced it with the $Temp variable for consistancy. Whats up with that?

My machine is an XP box. I ran it on two other XP boxes, totally different builds, same results! Sometimes the script works, sometimes it doesnt....

included files winzip100.exe from (contains Resume.doc) <-- just toss one in a zip file and name it resume

::::Code starts here:::::



opt("WinTitleMatchMode", 2)

if IsAdmin() <> 1 Then

MsgBox(0, "Error:", "You must have local administrative rights to run this demo!")



if @OSVersion <> "WIN_XP" Then

MsgBox(0, "Error:", "Sorry, this demo is designed to run on Windows XP!")



Dim $MsgBawx, $Temp = @TempDir

$MsgBawx = msgbox(1, "Automation Demo:", "The following script will unpack and install WinZip's v.10 freeware release and open an archive file." & @CR & "Press 'OK' when you are ready to continue.")

if $MsgBawx == 2 Then



DirCreate($Temp & "\AutomationDemo")

FileInstall("winzip100.exe", $Temp &"\AutomationDemo\", 1)

FileInstall("", $Temp &"\AutomationDemo\", 1)

dim $PID = 0

$PID = ProcessExists("WINZIP32.EXE")

If $PID Then ProcessClose($PID)


Run($Temp &"\AutomationDemo\winzip100.exe", @WorkingDir, 0)

WinWait("10.0 Setup")

WinActivate("10.0 Setup")

ControlClick("10.0 Setup","","Button1")

; setup loader is opened, looking for location to extract files to

WinWait("WinZip Setup")

WinActivate("WinZip Setup")

ControlFocus("Winzip Setup", "", "Edit1")

ControlSend("WinZip Setup", "", "Edit1", $Temp &"\AutomationDemo\")

ControlClick("WinZip Setup","","Button2")

WinWait("WinZip Setup", "Thank you for")

WinActivate("WinZip Setup", "Thank you for")

ControlClick("WinZip Setup","","Button4")

WinWait("License Agreement")

WinActivate("License Agreement")

ControlClick("License Agreement","","Button1")


WinWait("WinZip Setup", "WinZip Quick Start")

WinActivate("WinZip Setup", "WinZip Quick Start")

ControlClick("WinZip Setup","","Button4")

ControlClick("WinZip Setup","","Button4")

ControlClick("WinZip Setup","","Button4")

ControlClick("WinZip Setup","","Button4")

ControlClick("WinZip Setup","","Button4")

SplashTextOn("",@LF & "Finishing Install, Please be patient.",350,90,-1,-1,0,"arial",14,200)

;install is finished, open files





WinWait("Open Archive")

WinActivate("Open Archive")

ControlSend("Open Archive", "", "Edit1", $Temp &"\AutomationDemo\")

ControlClick("Open Archive", "", "Button2")



ControlSend("WinZip", "", "SysListView321", "^a")

ControlSend("WinZip", "", "SysListView321", "{ENTER}")


$PID = 0

$PID = ProcessExists("WINZIP32.EXE")

If $PID Then ProcessClose($PID)

FileDelete($Temp &"\AutomationDemo\winzip100.exe")

FileDelete($Temp &"\AutomationDemo\")

MsgBox(0,"", "Hope you enjoyed the show.")


Func _IEfix()

If WinExists("Google Tools") Then

WinActivate("Google Tools")

ControlClick("Google Tools","", "Button1")

ControlClick("Google Tools","", "Button2")

ControlClick("Google Tools","", "Button3")



Share this post

Link to post
Share on other sites

#3 ·  Posted (edited)

Is Winzip doing it?

it would be really strange... how could it? @tempdir reads the %temp% value from the environment, right? it really doesnt make much sense to me, and i guess thats why i thought it was a bug. does anyone know how @tempdir gets its value?

furthermore, i assigned $temp the value of @tempdir. at no point does it read @tempdir again in the script... but it changes its value from : to ; of the variable.

Edited by 9thJames

Share this post

Link to post
Share on other sites

#4 ·  Posted (edited)

I can't test it now, but maybe lod3n is right and WinZip is handling the text strangely.

What happens if you use change this:

ControlSend("WinZip Setup", "", "Edit1", $Temp &"\AutomationDemo\")oÝ÷ ÚÞ½éÛzÛ^­«­¢+Ù
btw- haven't gone through them all, but it looks like your WinActivate and ControlFocus are unnecessary.

Edit: Spelling =(

Edited by Skruge

[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post

Link to post
Share on other sites

ah, I see what youre saying! It's not that the value of $temp has been changed, but when you attempt to write that value, it gets buggy. I'll recompile with the raw value option (awesome idea) and see what happens. I'll let you know tomorrow. TY.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0