About Virtualization, VDI, SBC, Application Compatibility and anything else I feel like
Last week I needed to an unattended installation of the Oracle Client, in my case version 10.2.0.1.0.
Oracle has a record switch that allows you to record an installation and generate a response file using: setup -record -destinationFile response_file_name. This is documented here.
When you are finished you can use this response file to perform the unattended install, eg setup -silent -responseFile response_file_name.
There is a problem though, the installer (setup.exe) launches a java based installer and immediately returns.
This was a problem for me since I cannot deploy a dependant application if the Oracle install hasn’t finished yet.
I did some googling and found a lot of questions about this subject and saw a common resolution where a script is watching a certain file that is creating when the installation has finished in a loop.
I figured there should be a better wait so I to a closer look at the installer with Ida Pro. I noticed that setup.exe launches another exe. called oui.exe (Oracle Universal Installer) which in turn launches Java.
I also noticed that oui.exe waits for the install to finish using the MsgWaitForMultipleObjects function if a certain variable is True:
It turns out that if we launch oui.exe using start /w instead of setup.exe and pass the switch -WAITFORCOMPLETION the installer will not return until it has finished.
This is my complete job:
rem Install Oracle 10.2 Client
set JOBFOLDER=%#*"SELECT dbo.GetActiveFullPath(%ID%)"%
if not exist %JOBFOLDER% MD %JOBFOLDER%
rem Jump to the Directory of this Job (you can write logfiles there)
rem Start Script Here
start /w %InstallPath%\Install\oui.exe -WAITFORCOMPLETION -nowait -silent -responsefile %InstallPath%\response\oracle.rsp
rem Save ErrorLevel
del "D:\Apps\oracle\product\10.2.0\client_1\NETWORK\ADMIN\sqlnet.ora" /F /Q
reg add "HKLM\SOFTWARE\ORACLE\KEY_OraClient10g_home1" /v "TNS_ADMIN" /t REG_SZ /d "\\ADNRD01\Apps\Oracle\tns_admin" /f
rem Script End
rem Return to Start Directory
rem Exit and return Saved ErrorLevel
.NET .NET FrameWork Active Directory Altiris Apple Automation Manager Citrix Dell Delphi Excel Exchange Exchange2003 Exchange2010 Hack HP iOS Java LinkedIn Linux Lync MSI Office Office 2010 Passat Password PowerPoint PowerShell RES RNS510 SasLibEx SCOM Security Terminal Server ThinApp TSAdminEx VBS VCDS Visual Basic Visual Studio VMWare Volkswagen VW Windows PE Wordpress XenApp