Jump to content

Recommended Posts

Posted (edited)

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
Posted (edited)

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
Posted
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.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...