Dropcheck Posted November 27, 2006 Posted November 27, 2006 Help! I am trying to write an Autoit script to automate this programs install. It seems to install just fine, but then program throws up a nag screen. Since I have purchased a license that's no problem I tried extending the script to handle the nag screen with the proper info. But the script stalls/pauses and I haven't been able to figure out why. Can someone take a look at my script and figure out why? Any help would be much appreciatedThanks #cs ---------------------------------------------------------------------------- AutoIt Version: 3.1.1.0 Program: PowerArchiver 2006 9.63 Author: Dropcheck Date: Nov 23, 2006 Script Function: Install PowerArchiver 2006 9.63 and enter registration info Template AutoIt script.#ce ----------------------------------------------------------------------------; Script Start - Add your code below here#region User Info.$RegName = 'Your Name'$RegKey = 'xxxx-xxxx-xxxx'#endregionOpt("WinWaitDelay",100)Opt("WinTitleMatchMode",4)Opt("WinDetectHiddenText",1)Opt("MouseCoordMode",0)Run('powarc963.exe');Welcome messageWinWaitActive("Setup - PowerArchiver","Welcome to the PowerArchiver Setup Wizard"); NextControlClick("Setup - PowerArchiver","","TButton1");Destination in ProgramFilesWinWaitActive("Setup - PowerArchiver","Select Destination Location"); NextControlClick("Setup - PowerArchiver","","TButton3");Start menu folder - leave for default right nowWinWaitActive("Setup - PowerArchiver","Select Start Menu Folder"); NextControlClick("Setup - PowerArchiver","","TButton4");Additional install optionsWinWaitActive("Setup - PowerArchiver","Additional Install Options")ControlClick("Setup - PowerArchiver","","TButton4");Ready to installWinWaitActive("Setup - PowerArchiver","Ready to Install")ControlClick("Setup - PowerArchiver","","TButton4");Completing setup wizardWinWaitActive("Setup - PowerArchiver","Completing the PowerArchiver Setup Wizard")Send("{TAB 4} "&" {SPACE}")ControlClick("Setup - PowerArchiver","","TButton4");Now we have finished installing and the original setup window closes ;and the program configuration begins;ie now it wants us to buy/register the program;First we can see the unregistered program window opens up then the register window;opens on top of it. But the register window is not the active window. ;This is where it stalls/pausesWinWait("PowerArchiver 2006","Enter &Registration ")If Not WinActive("PowerArchiver 2006","Enter &Registration ") Then WinActivate("PowerArchiver 2006","Enter &Registration ")WinWaitActive("PowerArchiver 2006","Enter &Registration ")MouseClick("PowerArchiver 2006","Enter &Registration ","TButton3");Here's where we can put in the registration infoWinWait("Register PowerArchiver","&Ordering Informatio")If Not WinActive("Register PowerArchiver","&Ordering Informatio") Then WinActivate("Register PowerArchiver","&Ordering Informatio")WinWaitActive("Register PowerArchiver","&Ordering Informatio")Send($RegName)Send("{TAB}")Send($RegKey)ControlClick("Register PowerArchiver","&Ordering Information","TButton4");Stupid window pops telling me I have to restart program WinWait("PowerArchiver","OK")If Not WinActive("PowerArchiver","OK") Then WinActivate("PowerArchiver","OK")WinWaitActive("PowerArchiver","OK")Send("{ENTER}");I don't need no stinking tip of the dayWinWait("PowerArchiver Tip of the Day","&Next Tip")If Not WinActive("PowerArchiver Tip of the Day","&Next Tip") Then WinActivate("PowerArchiver Tip of the Day","&Next Tip")WinWaitActive("PowerArchiver Tip of the Day","&Next Tip");Okay finally we are ready to finish the installProcessClose("POWERARC.EXE")Exit
MHz Posted November 27, 2006 Posted November 27, 2006 Perhaps the window is not activating? The script below will activate the needed windows below. I have added TrayIconDebug so you can check which line it pauses on. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.1.1.0 Program: PowerArchiver 2006 9.63 Author: Dropcheck Date: Nov 23, 2006 Script Function: Install PowerArchiver 2006 9.63 and enter registration info Template AutoIt script.#ce ----------------------------------------------------------------------------; Script Start - Add your code below here#region User Info.$RegName = 'Your Name'$RegKey = 'xxxx-xxxx-xxxx'#endregionOpt("WinWaitDelay", 100)Opt("WinTitleMatchMode", 4)Opt("WinDetectHiddenText", 1)Opt("MouseCoordMode", 0)Opt('TrayIconDebug', 1)Run('powarc963.exe');Welcome messageWinWait("Setup - PowerArchiver", "Welcome to the PowerArchiver Setup Wizard"); NextControlClick("Setup - PowerArchiver", "", "TButton1");Destination in ProgramFilesWinWait("Setup - PowerArchiver", "Select Destination Location"); NextControlClick("Setup - PowerArchiver", "", "TButton3");Start menu folder - leave for default right nowWinWait("Setup - PowerArchiver", "Select Start Menu Folder"); NextControlClick("Setup - PowerArchiver", "", "TButton4");Additional install optionsWinWait("Setup - PowerArchiver", "Additional Install Options")ControlClick("Setup - PowerArchiver", "", "TButton4");Ready to installWinWait("Setup - PowerArchiver", "Ready to Install")ControlClick("Setup - PowerArchiver", "", "TButton4");Completing setup wizard_WinWaitActivate("Setup - PowerArchiver", "Completing the PowerArchiver Setup Wizard")Send("{TAB 4}{SPACE}")ControlClick("Setup - PowerArchiver", "", "TButton4");Now we have finished installing and the original setup window closes;and the program configuration begins;ie now it wants us to buy/register the program;First we can see the unregistered program window opens up then the register window;opens on top of it. But the register window is not the active window.;This is where it stalls/pauses_WinWaitActivate("PowerArchiver 2006", "Enter &Registration ")MouseClick("PowerArchiver 2006", "Enter &Registration ", "TButton3");Here's where we can put in the registration info_WinWaitActivate("Register PowerArchiver", "&Ordering Informatio")Send($RegName & "{TAB}" & $RegKey)ControlClick("Register PowerArchiver", "&Ordering Information", "TButton4");Stupid window pops telling me I have to restart program_WinWaitActivate("PowerArchiver", "OK")Send("{ENTER}");I don't need no stinking tip of the day_WinWaitActivate("PowerArchiver Tip of the Day", "&Next Tip");Okay finally we are ready to finish the installProcessClose("POWERARC.EXE")ExitFunc _WinWaitActivate($title, $text = "") WinWait($title, $text) WinActivate($title, $text) WinWaitActive($title, $text)EndFunc
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