mmoore5553 Posted October 6, 2017 Posted October 6, 2017 I am trying to install software but it does not run when using autoit. I can run it manually and it starts right up but has a finish button. I am trying to get the finish button to be clicked. Here is my code AutoItSetOption("WinTitleMatchMode", 2) $InstallPath = @ScriptDir & "\setup.exe" If FileExists($InstallPath) Then Run($InstallPath) ControlClick("ADM 3.51 Service Pack - InstallShield Wizard", "", 1) EndIf I am not sure what i am doing wrong. The software will not even install. If i use shellexecute it will run but not click the finish button. I can not wrap my head around this. Here are the install files if you have to uninstall the software use the file ADMuninstall. It is in the folder. www.wpcreations.net\ServicePack.zip
Moderators JLogan3o13 Posted October 6, 2017 Moderators Posted October 6, 2017 @mmoore5553 welcome to the forum. In your script, you have no wait period, so the script is doing a ControlClick as soon as you run the executable. Look at WinWait in the help file, you need to wait until the window with the Finish button is active before doing the ControlClick. Or, much better, since this is an InstallShield package just use the silent parameters and skip the GUI altogether "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
mmoore5553 Posted October 6, 2017 Author Posted October 6, 2017 jlogin. Thank you. They took all the silent switches out. I could not find any using the normal method to extract the msi. Unless you can find a way. I have included the files in the above link. I will look for the wait period. What is funny it will not run at all with the run command. But if i use the shellexecute it runs. Is that normal to run a program with shellexecute ? Here is current code. I am running on windows 10. Not sure if that matters AutoItSetOption("WinTitleMatchMode", 2) $InstallPath = @ScriptDir & "\setup.exe" If FileExists($InstallPath) Then ShellExecute($InstallPath) WinWait("[CLASS:Static]", "The InstallShield Wizard has successfully installed ADM 3.51 Service Pack. Click Finish to exit the wizard.", 10) ControlClick("ADM 3.51 Service Pack - InstallShield Wizard","Finish", 1) EndIf
jguinch Posted October 6, 2017 Posted October 6, 2017 Try this : Run(@ScriptDir & "\setup.exe /Q /v/qb") Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF
mmoore5553 Posted October 6, 2017 Author Posted October 6, 2017 jguinch - that did not work. It still has the finish button showing.
mmoore5553 Posted October 6, 2017 Author Posted October 6, 2017 i finally got it to work on my machine. But it still brings up the dialog boxes and it finished but when i add it to sccm or pdq deploy it does not run silently. I believe the finish button is not getting hit AutoItSetOption("WinTitleMatchMode", 2) $InstallPath = @ScriptDir & "\setup.exe" Run($InstallPath) WinWait("[CLASS:Static]", "The InstallShield Wizard has successfully installed ADM 3.51 Service Pack. Click Finish to exit the wizard.", 10) Do $Finish = ControlGetHandle("ADM 3.51 Service Pack - InstallShield Wizard", "Finish", 1) Sleep(100) Until $Finish <> "" ControlClick("ADM 3.51 Service Pack - InstallShield Wizard", "Finish", 1) should i be doing something different ? Files are above in the zip file
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