didimons Posted May 27, 2011 Share Posted May 27, 2011 Hello, I've created a installer for an oracle application, I've automated the process with send keys but I'm having a problem to hide the windows. I've used the @SW_HIDE option when using the run command so it should work. Is it possible that you cannot use the hide option while using send ? The relevant part of the installer code is below: expandcollapse popupIf $osv = "WIN_7" Or $osv = "WIN_2008" Or $osv = "WIN_2008R2" Then MsgBox(0,"Warning", "When installing on Windows 7 / 2008 it is possible that you will receive Windows Security Alert concerning java.exe, Select Domain networks and click on Allow access") MsgBox(0,"Warning", "During the installation it is possible that the message: The procedure entry point GetProcessImageFileNameW could not be located in the dynamic link library PSAPI.DLL. appears several times. This may be ignored by clicking OK.") ProgressOn ("Oracle Discoverer 10g R2 Install", "Install Progress") ProgressSet(0, "Installing Discoverer 10g R2 basic") RunWait ("X:\p5983622_10123_WINNT\Disk1\setup.exe -responseFile x:\response\install_disco10gr2_win7 -ignoreSysPrereqs -silent", "", @SW_HIDE) Sleep (20000) WinWaitActive ("Oracle Universal Installer") Send ("{ENTER}") WinWaitClose("Oracle Universal Installer") ProgressSet (25, "Installing Discoverer 10g R2 patch") Run ("X:\p5983622_10123_WINNT\Disk1\setup.exe -responseFile x:\response\install_5983622_win7 -ignoreSysPrereqs -silent", "", @SW_HIDE) Sleep (20000) WinWaitActive ("Oracle Universal Installer") Send ("{ENTER}") WinWaitClose("Oracle Universal Installer") ProgressSet (50, "Copying Perl directory") Run ("X:\response\perl_xcopy.bat", "", @SW_HIDE) Sleep (10000) WinWaitClose ("[CLASS:ConsoleWindowClass]") ProgressSet (60, "Applying first Opatch") Run ("X:\response\opatch_win7_1.bat") Sleep (10000) WinWaitActive ("[CLASS:ConsoleWindowClass]") Send ("y{ENTER}") WinWaitClose ("[CLASS:ConsoleWindowClass]") ProgressSet (70, "Applying second Opatch") Run ("X:\response\opatch_win7_2.bat") Sleep (10000) WinWaitActive ("[CLASS:ConsoleWindowClass]") Send ("y{ENTER}") WinWaitClose ("[CLASS:ConsoleWindowClass]") ProgressSet (80, "Starting Discoverer to create default registry parameters") Run (& $Driveselect1"\oracle\disco10gr2\bin\dis51adm.exe", "", @SW_HIDE) Run (& $Driveselect1"\oracle\disco10gr2\bin\dis51usr.exe", "", @SW_HIDE) Sleep (20000) ProcessClose ("dis51adm.exe") ProcessClose ("dis51usr.exe") WinWaitClose ("OracleBI Discoverer Administrator") WinWaitClose ("Oracle Business Intelligence Discoverer Desktop") ProgressSet (90, "Importing additional registry parameters") Run ("reg import X:\response\reg_user.reg", "", @SW_HIDE) If $ost = "X86" Then Run ("reg import X:\response\reg_local_machine.reg", "", @SW_HIDE) EndIf If $ost = "X64" Then Run ("reg import X:\response\reg_local_machine_64bit.reg", "", @SW_HIDE) EndIf ProgressSet (100, "Oracle Discoverer 10g R2 installation complete") Sleep (10000) ProgressOff() MsgBox(0,"Discoverer 10g R2", "Discoverer 10g R2 has been installed") Exit EndIf Link to comment Share on other sites More sharing options...
sleepydvdr Posted May 27, 2011 Share Posted May 27, 2011 The @SW_Hide command can break functionality. Just yesterday, I was working with an executable that takes command line switches and it did not work at all using @SW_Hide. I deleted that command and functionality returned. #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
BrewManNH Posted May 27, 2011 Share Posted May 27, 2011 You can't use the Send command to a hidden window, you can use ControlSend though. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
didimons Posted May 27, 2011 Author Share Posted May 27, 2011 You can't use the Send command to a hidden window, you can use ControlSend though.I will take a look at it, however asside from the problem with the send command, the windows don't hide. I tried minimizing as well but still no go. Link to comment Share on other sites More sharing options...
BrewManNH Posted May 27, 2011 Share Posted May 27, 2011 I'm not sure without trying it, but it might be the winwaitactivate that's bringing it back up. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
didimons Posted May 27, 2011 Author Share Posted May 27, 2011 I'm not sure without trying it, but it might be the winwaitactivate that's bringing it back up.modified the script so that winwaitactive no longer was present, but still no go. 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