Jump to content

Possible Bug with @TempDir


9thJames
 Share

Recommended Posts

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 winzip.com 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 winzip.com

extract.zip (contains Resume.doc) <-- just toss one in a zip file and name it resume

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

#NoTrayIcon

#compiler_icon=icon.ico

opt("WinTitleMatchMode", 2)

if IsAdmin() <> 1 Then

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

Exit

EndIf

if @OSVersion <> "WIN_XP" Then

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

Exit

EndIf

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

Exit

EndIf

DirCreate($Temp & "\AutomationDemo")

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

FileInstall("Extract.zip", $Temp &"\AutomationDemo\", 1)

dim $PID = 0

$PID = ProcessExists("WINZIP32.EXE")

If $PID Then ProcessClose($PID)

AdlibEnable("_IEfix")

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")

AdlibDisable()

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("WinZip")

WinActivate("WinZip")

send("^o")

SplashOff()

WinWait("Open Archive")

WinActivate("Open Archive")

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

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

WinWait("WinZip")

WinActivate("WinZip")

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

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

WinWait("Resume")

$PID = 0

$PID = ProcessExists("WINZIP32.EXE")

If $PID Then ProcessClose($PID)

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

FileDelete($Temp &"\AutomationDemo\Extract.zip")

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

Exit

Func _IEfix()

If WinExists("Google Tools") Then

WinActivate("Google Tools")

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

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

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

EndIf

EndFunc

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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Û^­«­¢+Ù
½¹Ñɽ±MÑQáÐ ÅÕ½Ðí]¥¹i¥ÀMÑÕÀÅÕ½Ðì°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðí¥ÐÄÅÕ½Ðì°ÀÌØíQµÀµÀìÅÕ½ÐìÀäÈíÕѽµÑ¥½¹µ¼ÀäÈìÅÕ½Ðì°Ä¤ìÍÐÑáÐ¥Éѱä
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]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...