neo2k Posted October 2, 2006 Share Posted October 2, 2006 Hi! New with AutoIt, and just starting to make my first simple scripts.. I was wondering about the winwaitactive command. I'm using autoit to help me out with an installation that's running silent. At the end of the installation (a MSI) it shows a window prompting the user for a reboot. Don't really like this, so this is where the Autoit script should kick in. I'm using a commandline to install the application: c:\windows\system32\msiexec.exe /i myapp.msi /qn Do i need to start the WinWaitActive before running the commandline in Autoit..? What i had in mind: WinWaitActive("Reboot required", [25]) Run ("C:\WINDOWS\system32\msiexec.exe /I MyApp.msi /QNS") Send ("!n") Or will AutoIt "hang" (for X time specified with winwaitactive) and just wait for the window to appear before running the next command? (the installation itself) So, are commands run one at a time or will it run the commands simultaniously..? Thanks in advance..! Link to comment Share on other sites More sharing options...
Ed_Maximized Posted October 2, 2006 Share Posted October 2, 2006 Hi! New with AutoIt, and just starting to make my first simple scripts.. I was wondering about the winwaitactive command. I'm using autoit to help me out with an installation that's running silent. At the end of the installation (a MSI) it shows a window prompting the user for a reboot. Don't really like this, so this is where the Autoit script should kick in. I'm using a commandline to install the application: c:\windows\system32\msiexec.exe /i myapp.msi /qn Do i need to start the WinWaitActive before running the commandline in Autoit..? What i had in mind: WinWaitActive("Reboot required", [25]) Run ("C:\WINDOWS\system32\msiexec.exe /I MyApp.msi /QNS") Send ("!n") Or will AutoIt "hang" (for X time specified with winwaitactive) and just wait for the window to appear before running the next command? (the installation itself) So, are commands run one at a time or will it run the commands simultaniously..? Thanks in advance..! WinWaitActive waits for specific window to make active... You first have to RUN the install routine... Run ("C:\WINDOWS\system32\msiexec.exe /I MyApp.msi /QNS") WinWaitActive("Reboot required", [25]) Send ("!n") Should work Note that "Reboot required" must be the exact title of the window you are waiting for... ShapedGUI Creator : Shaped gui the easy way!!!Txt2au3 : the easy way to include text files into your program without fileinstall_GUICreateWithTiledBackground : Put a GIF in the background of your formsSQLite Database BrowserAnimated GIF UDF : Put animations in your GUI's Link to comment Share on other sites More sharing options...
Skruge Posted October 2, 2006 Share Posted October 2, 2006 Welcome to the forums! (Both of you) WinWaitActive waits for specific window to make active...A common misconception is that WinWaitActive activates a window. In actuality, it waits for a window to become active by other means. @neo- [25] isn't valid syntax... It appears you want to wait for 25 seconds. If so, use this: Run (@SystemDir & "\msiexec.exe /I MyApp.msi /QNS") WinWait("Reboot required", "", 25) WinActivate("Reboot required") Send ("!n")Take a look at ControlSend and ControlClick to get around using Send in this case. These functions don't require the window to be active or even visible. Also, it's best to specify the full path to your MSI. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
AzKay Posted October 2, 2006 Share Posted October 2, 2006 (edited) Wouldnt you be able to Run(@SystemDir & "\msiexec.exe /I MyApp.msi /QNS", "", @SW_HIDE)? Edited October 2, 2006 by AzKay # MY LOVE FOR YOU... IS LIKE A TRUCK- # Link to comment Share on other sites More sharing options...
neo2k Posted October 3, 2006 Author Share Posted October 3, 2006 I'm currently looking into the ControlSend fuction. What if the window doen't appear every time? Does the script pause then? Link to comment Share on other sites More sharing options...
MHz Posted October 3, 2006 Share Posted October 3, 2006 RunWait('"' & @SystemDir & '\msiexec.exe" /i "' & @ScriptDir & '\MyApp.msi" /qn /norestart') Using suitable msiexec switches may help. 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