9thJames Posted September 26, 2006 Share Posted September 26, 2006 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.comextract.zip (contains Resume.doc) <-- just toss one in a zip file and name it resume::::Code starts here:::::#NoTrayIcon#compiler_icon=icon.icoopt("WinTitleMatchMode", 2)if IsAdmin() <> 1 Then MsgBox(0, "Error:", "You must have local administrative rights to run this demo!") ExitEndIfif @OSVersion <> "WIN_XP" Then MsgBox(0, "Error:", "Sorry, this demo is designed to run on Windows XP!") ExitEndIfDim $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 ExitEndIfDirCreate($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 toWinWait("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 filesWinWait("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.")ExitFunc _IEfix() If WinExists("Google Tools") Then WinActivate("Google Tools") ControlClick("Google Tools","", "Button1") ControlClick("Google Tools","", "Button2") ControlClick("Google Tools","", "Button3") EndIfEndFunc Link to comment Share on other sites More sharing options...
lod3n Posted September 26, 2006 Share Posted September 26, 2006 Is Winzip doing it? [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
9thJames Posted September 26, 2006 Author Share Posted September 26, 2006 (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 September 26, 2006 by 9thJames Link to comment Share on other sites More sharing options...
Skruge Posted September 26, 2006 Share Posted September 26, 2006 (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Û^«¢+Ù ½¹Ñɽ±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 September 26, 2006 by Skruge [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
9thJames Posted September 27, 2006 Author Share Posted September 27, 2006 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. Link to comment Share on other sites More sharing options...
lod3n Posted September 27, 2006 Share Posted September 27, 2006 Also, fyi, I think @tempdir comes from %tmp%, not %temp%. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now