mmoore5553

silent install of software

6 posts in this topic

#1 ·  Posted

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

Share this post


Link to post
Share on other sites



#2 ·  Posted

@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 :)


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted

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

 

Share this post


Link to post
Share on other sites

#5 ·  Posted

 

  jguinch - that did not work. It still has the finish button showing.

Share this post


Link to post
Share on other sites

#6 ·  Posted

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

Share this post


Link to post
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