Jump to content
mihaijulien

Windows Installer - WinWait / WinClose

Recommended Posts

Hello,

I'm trying to automate the installer process of an application. I currently have this following code:

Start()

Func Start()
   ShellExecuteWait(@ScriptDir & "\installer.msi")
   Local $hWnd = WinWait("[CLASS:MsiDialogCloseClass]",5)
   ;WinClose($hWnd)
   ControlClick("Installer Information", "","[CLASS:Button; INSTANCE:1]")
   ;Send("{ENTER}")
EndFunc

This function should only start the installer and press an Ok button of a popup window (or just close it). I tried with ControlClick()Send() and WinClose() functions but the script only starts the installer. Can't figure out why it doesn't press that button/close the window.

Edited by mihaijulien

Share this post


Link to post
Share on other sites

Instead of automating the GUI, use the command line options :

RunWait(@SystemDir & '\msiexec.exe /i "' & @ScriptDir & '\installer.exe" /qb', @SystemDir)

 

Edit : your problem is that you used ShellExecuteWait (it's a blocking function) : try with ShellExecute instead

Edited by jguinch

Share this post


Link to post
Share on other sites
13 minutes ago, jguinch said:

Edit : your problem is that you used ShellExecuteWait (it's a blocking function) : try with ShellExecute instead

Indeed, that was the problem. Thank you.

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

×
×
  • Create New...