matthewst Posted December 1, 2005 Share Posted December 1, 2005 I am making a script to install roxio 7. Some of the computers in my LAN have an older version or don't have it installed correctly. If the current machine already has roxio, I get different windows then I would if it were not previously installed. I think "If WinExist" is the appropriate way to do this, but I can't get it to work. The script runs fine up to Send ( '{Tab}' ) . Then it just stops. I don't know if it can even see the second window. Run ( 'setup.exe /S /v /qn' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'WARNING: This program is protected by copyright law and international treaties.' ) Send ( '{ENTER}' ) if WinExists ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Welcome to the InstallShield Wizard for Roxio Easy Media Creator 7 Basic DVD Edition' ) then Send ( '{Tab}' ) Send ( '{Enter}' ) Send ( 'y' ) Send ( '{Enter}' ) if NOT WinExists ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Please read the following license agreement carefully.' ) then endif ; Continue endif Link to comment Share on other sites More sharing options...
sksbir Posted December 1, 2005 Share Posted December 1, 2005 I am making a script to install roxio 7.......you don't give time for installation program to show the 2nd windows after sending the first Enter.you must insert a winwait instruction likeWinwait ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard')so, you will check what kind of window appears at the good time : after one of the 2 possibles windows appears.An other way is to first check if your older version of roxio exists on the computer, deinstal it if present and then install without having this sort of question.. Link to comment Share on other sites More sharing options...
matthewst Posted December 1, 2005 Author Share Posted December 1, 2005 An other way is to first check if your older version of roxio exists on the computer, deinstal it if present and then install without having this sort of question.. I don't even know how to begin scripting something like that. Link to comment Share on other sites More sharing options...
sksbir Posted December 1, 2005 Share Posted December 1, 2005 I don't even know how to begin scripting something like that.take a look here, test my WSH script, and get out what you can do with the resulting file... Link to comment Share on other sites More sharing options...
MHz Posted December 1, 2005 Share Posted December 1, 2005 Are your silent switches not working ? I normally add double quotes around the /qn so anything within the double quotes is passed to the extracted msi. Run (@ScriptDir & '\setup.exe /S /v"/qn"' ) Others I've seen leave no spaces between /v and /qn Run (@ScriptDir & '\setup.exe /S /v/qn' ) Link to comment Share on other sites More sharing options...
matthewst Posted December 1, 2005 Author Share Posted December 1, 2005 (edited) Are your silent switches not working ? I normally add double quotes around the /qn so anything within the double quotes is passed to the extracted msi. Run (@ScriptDir & '\setup.exe /S /v"/qn"' ) Others I've seen leave no spaces between /v and /qn Run (@ScriptDir & '\setup.exe /S /v/qn' ) It doesn't run at all when I use either of those options. What is the correct syntax for winwait? I just want the script to wait for 10 seconds before continuing. Winwait (1000) Edited December 1, 2005 by matthewst Link to comment Share on other sites More sharing options...
MHz Posted December 1, 2005 Share Posted December 1, 2005 (edited) Use WinWaitActive as you have already used in your script for the other windows. WinExists is mostly good within loops or within a Adllb function. WinWait is good when using Control* functions to manipulate the window controls that do not need to be active. Edited December 1, 2005 by MHz Link to comment Share on other sites More sharing options...
matthewst Posted December 1, 2005 Author Share Posted December 1, 2005 Use WinWaitActive as you have already used in your script for the other windows.I can't seem to get that to work either.Run ( 'setup.exe /S /v /qn' )WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'WARNING: This program is protected by copyright law and international treaties.' )Send ( '{ENTER}' )Everything runs fine until here. Then it just stops.WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'The InstallShield® Wizard will allow you to modify, repair, or remove Roxio Easy Media Creator 7 Basic DVD Edition. To continue, click Next.' )Send ( '{Tab}' )Send ( '{Enter}' )this is the reveal mode text for the second window>>>> Window Title <<<<Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard>>>> Window Dimensions <<<<X: 244 Y: 129 Width: 504 Height: 386>>>> Mouse Co-ords (relative to active window) <<<<X: 259 Y: 329>>>> Window Text <<<<&Next >Cancel< &BackNewBinary20The InstallShield® Wizard will allow you to modify, repair, or remove Roxio Easy Media Creator 7 Basic DVD Edition. To continue, click Next.Welcome to the InstallShield Wizard for Roxio Easy Media Creator 7 Basic DVD Editionwhat am i doing wrong? Link to comment Share on other sites More sharing options...
MHz Posted December 1, 2005 Share Posted December 1, 2005 The second window text has change from your 1st post. You now have Roxio installed and are processing the Add/remove window ?You can also trim down those strings to a small length. AutoIt reads from the left so a string like "123456789" can be shortened to "123".Use Opt('TrayIconDebug', 1) at the top of your script and hover the mouse over the systray icon to see which line that the script is at.Try adding a Sleep(1000) just before you send the Tab. Link to comment Share on other sites More sharing options...
matthewst Posted December 1, 2005 Author Share Posted December 1, 2005 (edited) ok, heres the full scoopI need to install roxio 7 on several machinessome already have roxio 7, some have an older versionif they have roxio 7 I need the script to restart the machine and thats itif they have an older version of roxio I need the script to use the "remove older version" functionthen continue with the roxio 7 installno matter the roxio version (if any) the first window will be identicalhowever there could be 3 different versions of the second windowhow do I deal with that?I've tried "if winexist" but couldn't get it to workhere is the entire scriptit jump to the "are you sure you want to cancle window" but it doesn't send the "y"expandcollapse popupOpt('TrayIconDebug', 1) Run ( 'setup.exe /S /v /qn' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Welcome to the InstallShield Wizard for Roxio Easy Media Creator 7 Basic DVD Edition' ) Send ( '{Enter}' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Change which program features are installed.' ) Send ( '{Tab}' ) Send ( '{Tab}' ) Send ( '{Tab}' ) Send ( '{Enter}' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Are you sure you want to cancel Roxio Easy Media Creator 7 Basic DVD Edition installation?' ) Send ( 'y' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Click Finish to exit the wizard.' ) Send ( '{Enter}' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'The wizard was interrupted before Roxio Easy Media Creator 7 Basic DVD Edition could be completely installed.' ) Send ( '{Enter}' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'WARNING: This program is protected by copyright law and international treaties.' ) Send ( '{ENTER}' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Please read the following license agreement carefully.' ) Send ( 'a' ) Send ( '{ENTER}' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Please enter your information.' ) Send ( '{ENTER}' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Please select a setup type.' ) Send ( '{ENTER}' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Show the readme file' ) Send ( '{Tab}' ) Send ( '{Space}' ) Send ( '{Tab}' ) Send ( '{Space}' ) Send ( '{Tab}' ) Send ( '{Tab}' ) Send ( '{Tab}' ) Send ( '{Space}' ) Send ( '{Enter}' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'InstallShield Wizard Completed' ) Send ( '{Enter}' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition Installer Information', 'You must restart your system for the configuration changes made to Roxio Easy Media Creator 7 Basic DVD Edition to take effect.' ) Send ( 'Y' ) Edited December 1, 2005 by matthewst Link to comment Share on other sites More sharing options...
Valuater Posted December 1, 2005 Share Posted December 1, 2005 please 'EDIT" your post and use this for the CODE [ code ] ; no spaces ; paste your code [ /code ] ; no spaces and it will post correctly so we can read it better 8) Link to comment Share on other sites More sharing options...
Valuater Posted December 1, 2005 Share Posted December 1, 2005 (edited) 1 Suggestion you should try to use ControlSend() to replace Send() you can use au3info to get the controls 2 version example $new_ver = "6.0.2900.2180" $ver = FileGetVersion("Explorer.exe") If $ver = $new_ver then MsgBox(0, "Explorer version", $ver) ; exit... restart EndIf 8) Edited December 1, 2005 by Valuater Link to comment Share on other sites More sharing options...
MHz Posted December 2, 2005 Share Posted December 2, 2005 (edited) ok, heres the full scoop I need to install roxio 7 on several machines some already have roxio 7, some have an older version if they have roxio 7 I need the script to restart the machine and thats it if they have an older version of roxio I need the script to use the "remove older version" function then continue with the roxio 7 install no matter the roxio version (if any) the first window will be identical however there could be 3 different versions of the second window how do I deal with that? I've tried "if winexist" but couldn't get it to work here is the entire script it jump to the "are you sure you want to cancle window" but it doesn't send the "y"Ok, so you want to script the Add/remove windows as well. AdlibEnable() should be able to take care of them as they may not always show. Sending the "y" perhaps does not work as it may need Alt to be pressed also. I have taken a guess of the installation sequence below with changes. I have added some variables to try and save a visual repeat of your long strings. expandcollapse popupOpt('TrayIconDebug', 1) $title_1 = 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard' $title_2 = 'Roxio Easy Media Creator 7 Basic DVD Edition Installer Information' Run ( 'setup.exe /S /v /qn' ) WinWaitActive ( $title_1, 'Welcome to the InstallShield Wizard for Roxio Easy Media Creator 7 Basic DVD Edition' ) Send ( '{Enter}' ) AdlibEnable('_Adlib') WinWaitActive ( $title_1, 'WARNING: This program is protected by copyright law and international treaties.' ) Send ( '{ENTER}' ) WinWaitActive ( $title_1, 'Please read the following license agreement carefully.' ) Send ( 'a{ENTER}' ) AdlibDisable() WinWaitActive ( $title_1, 'Please enter your information.' ) Send ( '{ENTER}' ) WinWaitActive ( $title_1, 'Please select a setup type.' ) Send ( '{ENTER}' ) WinWaitActive ( $title_1, 'Show the readme file' ) Send ( '{Tab}{Space}{Tab}{Space}{Tab 3}{Space}{Enter}' ) WinWaitActive ( $title_1, 'InstallShield Wizard Completed' ) Send ( '{Enter}' ) WinWaitActive ( $title_2, 'You must restart your system for the configuration changes made' ) Send ( 'Y' ) Func _Adlib() If WinExists ( $title_1, 'Change which program features are installed.' ) Then WinActivate($title_1, 'Change which program features are installed.') Send ( '{Tab 3}{Enter}' ) WinWaitActive ( $title_1, 'Are you sure you want to cancel Roxio Easy Media Creator 7 Basic DVD Edition' ) Send ( '!y' ) WinWaitActive ( $title_1, 'Click Finish to exit the wizard.' ) Send ( '{Enter}' ) WinWaitActive ( $title_1, 'The wizard was interrupted before Roxio Easy Media Creator 7 Basic DVD Edition' ) Send ( '{Enter}' ) EndIf EndFunc Edit: Added WinActivate() within _Adlib() function Edited December 2, 2005 by MHz Link to comment Share on other sites More sharing options...
herewasplato Posted December 2, 2005 Share Posted December 2, 2005 (edited) ...however there could be 3 different versions of the second windowhow do I deal with that?Does this layout make sense to you:run whateverwinwaitactive - window #1send stuff to window #1while 1 <<<< just keep looping the code below >>>>if winexits("possible window #2a") thenfunc w2aexitloopendifif winexits("possible window #2b") thenfunc w2bexitloopendifif winexits("possible window #2c") thenfunc w2cexitloopendifsleep(100)wend <<<< just keep looping the code above >>>>continue on with your code....Func w2ado stuff for window #2ado stuff for any other windows that come with #2aendfuncFunc w2bdo stuff for window #2bdo stuff for any other windows that come with #2bendfuncFunc w2cdo stuff for window #2cdo stuff for any other windows that come with #2cendfuncCaveat: MHz knows more than I do and he wrote you some real code. You might want to stick with him.@Valuater,Sorry - no code box around my pseudo code. :-) Edited December 2, 2005 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
matthewst Posted December 14, 2005 Author Share Posted December 14, 2005 GOT IT!!!!!!!!! Thanks everyone expandcollapse popupOpt('TrayIconDebug', 1) Run ( 'setup.exe /S /v /qn' ) Sleep(70000) If WinExists ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'WARNING: This program is protected by copyright law and international treaties.' ) Then send ( '{Enter}' ) EndIf If WinExists ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Welcome to the InstallShield Wizard for Roxio Easy Media Creator 7 Basic DVD Edition' ) Then send ( '{Enter}' ) EndIf If WinExists ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'License Agreement' ) Then WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'License Agreement') Send ( 'A' ) Send ( '{ENTER}' ) EndIf If WinExists ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Customer Information' ) Then WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Customer Information' ) Send ( '{ENTER}' ) Sleep (20000) Send ( '{ENTER}' ) EndIf Sleep (10000) If WinExists ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Previous Versions Detected' ) Then WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Previous Versions Detected' ) Sleep (20000) Send ( '{Tab}' ) Send ( '{Tab}' ) Send ( '{Tab}' ) Send ( '{Enter}' ) EndIf If WinExists ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Show the readme file' ) Then WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Show the readme file' ) Send ( '{Tab}' ) Send ( '{Space}' ) Send ( '{Tab}' ) Send ( '{Space}' ) Send ( '{Tab}' ) Send ( '{Tab}' ) Send ( '{Tab}' ) Send ( '{Space}' ) Send ( '{ENTER}' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'InstallShield Wizard Completed' ) Send ( '{Enter}' ) Sleep(20000) Send ( 'Y' ) EndIf If WinExists ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Remove Roxio Easy Media Creator 7 Basic DVD Edition from your computer.' ) Then WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Remove Roxio Easy Media Creator 7 Basic DVD Edition from your computer.') Send ( '{Tab}' ) Send ( '{Tab}' ) Send ( '{Tab}' ) Send ( '{ENTER}' ) WinWaitActive ( 'Roxio Easy Media Creator 7 Basic DVD Edition - InstallShield Wizard', 'Are you sure you want to cancel Roxio Easy Media Creator 7 Basic DVD Edition installation?' ) Send ( 'y' ) Sleep(20000) Send ( '{Enter}' ) EndIf sleep(5000) Shutdown(6) 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