mihaijulien Posted June 6, 2017 Share Posted June 6, 2017 (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 June 6, 2017 by mihaijulien Elena 1 Link to comment Share on other sites More sharing options...
jguinch Posted June 6, 2017 Share Posted June 6, 2017 (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 June 6, 2017 by jguinch mihaijulien 1 Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
mihaijulien Posted June 6, 2017 Author Share Posted June 6, 2017 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. Link to comment Share on other sites More sharing options...
jguinch Posted June 6, 2017 Share Posted June 6, 2017 You're welcome. It works, yes, but pay attention to the use of the command line options with msiexec.exe, it's the best method Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
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