Simplify iT Posted May 28, 2006 Share Posted May 28, 2006 Hi all, I have written a little script to install PrimoPDF automatically, however i am a little stuck with how to hide the output windows from the installer. My script below. Would appreciate it if someone can guide me on how to change the script to hide all the prompt windows. expandcollapse popup$Executable = _GetExeName('FreePrimoSetup.exe') ; Execute Installer If FileExists ( @ScriptDir & "\" & $Executable) Then Run(@ScriptDir & '\' & $Executable,'',@SW_HIDE ) Else Exit EndIf WinWait("PrimoPDF Setup","&Next >") If Not WinActive("PrimoPDF Setup","&Next >") Then WinActivate("PrimoPDF Setup","&Next >") WinWaitActive("PrimoPDF Setup","&Next >") Send("!n") WinWait("PrimoPDF Setup","I agree to the terms") If Not WinActive("PrimoPDF Setup","I agree to the terms") Then WinActivate("PrimoPDF Setup","I agree to the terms") WinWaitActive("PrimoPDF Setup","I agree to the terms",@SW_HIDE) Send("{TAB 2}" & "{UP}" & "{SPACE}") Send("!n") Send("!n") Send("!n") WinWait("PrimoPDF Setup","&Finish") If Not WinActive("PrimoPDF Setup","&Finish") Then WinActivate("PrimoPDF Setup","&Finish") WinWaitActive("PrimoPDF Setup","&Finish",@SW_HIDE) Send("{DOWN}" & "{SPACE}") Send("!f") Func _GetExeName($exename) Local $search, $filename If FileChangeDir(@ScriptDir) Then $search = FileFindFirstFile($exename) If $search <> - 1 Then $filename = FileFindNextFile($search) If Not @error Then FileClose($search) Return $filename EndIf FileClose($search) EndIf EndIf MsgBox(0x40010, @ScriptName, 'Nero executable not found', 10) Exit 1 EndFunc Thanks in advance! Link to comment Share on other sites More sharing options...
Nomad Posted May 28, 2006 Share Posted May 28, 2006 I've never made a program that executed an installer, so I'm not sure if this will work, but have you tried: WinSetState ( "title", "text", @SW_HIDE ) ; or @SW_MINIMIZE? Hope this helps, Nomad Link to comment Share on other sites More sharing options...
Simplify iT Posted May 28, 2006 Author Share Posted May 28, 2006 I've never made a program that executed an installer, so I'm not sure if this will work, but have you tried:WinSetState ( "title", "text", @SW_HIDE ) ; or @SW_MINIMIZE?Hope this helps,NomadHi Nomad - yes i did try that, however it didn't work for me Link to comment Share on other sites More sharing options...
Nomad Posted May 28, 2006 Share Posted May 28, 2006 (edited) I'm not entirely sure what you want, since you are calling for the window to be active so much, but assuming that you want to hide "PrimoPDF Setup", this might work: expandcollapse popupOpt("WinDetectHiddenText", 1) $Executable = _GetExeName('FreePrimoSetup.exe') $Window = "PrimoPDF Setup" ; Execute Installer If FileExists ( @ScriptDir & "\" & $Executable) Then Run(@ScriptDir & '\' & $Executable,'',@SW_HIDE ) Else Exit EndIf WinActivate($Window) If Not WinActive($Window) Then WaitWinActive($Window) WinSetState($Window,"",@SW_HIDE) While (1) $Text = WinGetText ($Window , "&Next") If $Text = 0 Then ContinueLoop Else ControlSend($Window, "", "","!n"); oops, edited this :) EndIf WEnd WinSetState($Window,"",@SW_HIDE);incase it pops back up, dunno if it will While (1) $Text = WinGetText ($Window , "I agree to the terms") If $Text = 0 Then ContinueLoop Else ControlSend($Window, "", "", "{TAB}{TAB}{UP}{SPACE}""!n""!n""!n");dunno if the "!n" will work like this. Also assumed you wanted 2 {TAB} EndIf WEnd WinSetState($Window,"",@SW_HIDE);incase it pops back up, dunno if it will While (1) $Text = WinGetText ($Window , "&Finish") If $Text = 0 Then ContinueLoop Else ControlSend($Window, "", "", "{DOWN}{SPACE}""!f");dunno if the "!f" will work like this. EndIf WEnd Func _GetExeName($exename) Local $search, $filename If FileChangeDir(@ScriptDir) Then $search = FileFindFirstFile($exename) If $search <> - 1 Then $filename = FileFindNextFile($search) If Not @error Then FileClose($search) Return $filename EndIf FileClose($search) EndIf EndIf MsgBox(0x40010, @ScriptName, 'Nero executable not found', 10) Exit 1 EndFunc I don't have a good way to test this, but I "think" it will work. If not it's a pont in the right direction. Edit: had a mistake in my code, didn't call the window for the first ControlSend. :\ Edited May 28, 2006 by Nomad Link to comment Share on other sites More sharing options...
MHz Posted May 28, 2006 Share Posted May 28, 2006 Why do you have the _GetExeName() function when your not using it? Looks exactly like the one I created for someone for executing any Nero version. You need to use Control functions so you can move the installer off screen for unseen operation (except for the flicker of the 1st window). Give this a run. expandcollapse popup#region - FreePrimoSetup install script - (Automated with WinWait functions) Opt('TrayIconDebug', 1) ; Installer. $executable = 'FreePrimoSetup.exe' ; Installation folder in Program Files. $directory = 'activePDF\PrimoPDF' ; Run the installer. If FileExists(@ScriptDir & '\' & $executable) Then $pid = Run(@ScriptDir & '\' & $executable) Else _Abort() EndIf ; Process windows If WinWait('PrimoPDF Setup', '&Next >', 60) Then WinMove('PrimoPDF Setup', '&Next >', @DesktopWidth, 10) ControlClick('PrimoPDF Setup', '&Next >', 'Button3') WinWait('PrimoPDF Setup', 'I agree to the terms') ControlClick('PrimoPDF Setup', 'I agree to the terms', 'Button3') ControlClick('PrimoPDF Setup', 'I agree to the terms', 'Button1') WinWait('PrimoPDF Setup', 'C&hange...') ControlSetText('PrimoPDF Setup', 'C&hange...', 'Edit1', @ProgramFilesDir & '\' & $directory) ControlClick('PrimoPDF Setup', 'C&hange...', 'Button1') WinWait('PrimoPDF Setup', '&Next >') ControlClick('PrimoPDF Setup', '&Next >', 'Button1') WinWait('PrimoPDF Setup', '&Finish') ControlClick('PrimoPDF Setup', '&Finish', 'Button4') ControlClick('PrimoPDF Setup', '&Finish', 'Button1') Else _Abort() EndIf ProcessWaitClose($pid) #endregion Exit Func _Abort() ; close process if exists then exit. Dim $pid If ProcessExists($pid) Then ProcessClose($pid) Exit(2) Else Exit(3) EndIf EndFunc Func OnAutoItStart() ; A 2nd script instance will exit. Local $interpreter If StringInStr($cmdlineraw, '/dummy') Then Exit $interpreter = StringTrimRight(@ScriptName, 4) & ' Script Interpreter' If WinExists($interpreter) Then Exit AutoItWinSetTitle($interpreter) EndFunc Link to comment Share on other sites More sharing options...
Nomad Posted May 28, 2006 Share Posted May 28, 2006 That looks much cleaner. Link to comment Share on other sites More sharing options...
MHz Posted May 28, 2006 Share Posted May 28, 2006 That looks much cleaner. I had a head start with one which I made for someone earlier here. Just had to translate this back into english and tidy it to make it alittle simplier for Simplify iT. Link to comment Share on other sites More sharing options...
Simucal Posted May 28, 2006 Share Posted May 28, 2006 You can do a built in silent install by running: PrimoPDF.exe -r This will install the whole thing without asking questions and at the end generate a setup.iss in your WINNT folder. AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
MHz Posted May 28, 2006 Share Posted May 28, 2006 You can do a built in silent install by running: PrimoPDF.exe -r This will install the whole thing without asking questions and at the end generate a setup.iss in your WINNT folder.Only available in a licenced corporate version is silent install available. The free version needs to be automated for unattended usage. Link to comment Share on other sites More sharing options...
Simucal Posted May 28, 2006 Share Posted May 28, 2006 Only available in a licenced corporate version is silent install available. The free version needs to be automated for unattended usage.My bad MHZ.. Guess I didnt look into it thoroughly enough. AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc) Link to comment Share on other sites More sharing options...
Simplify iT Posted May 28, 2006 Author Share Posted May 28, 2006 Thankyou everyone - this solution works well in terms of the updated and refined script And MHZ is right about the commercial version 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