The attached script is one I use to automate the install of the Oracle 9i client.
When first trying to automate the 9i install for deployment through Altiris, we found that the Altiris job would show successfully completed before the installation had finished. Following the install, we wanted the job to copy tnsnames.ora and sqlnet.ora files to the client. That task would fail since the appropriate folders hadn't been created.
The issue was that the setup spawned a javaw.exe process to perform the actual installation. The setup.exe called by the Altiris job would complete successfully leaving javaw.exe to finish the work. We needed Altiris to wait for both setup.exe and javaw.exe to complete before moving on to the follow-up tasks.
The attached script, Oracle9iInstall.vbs, will start a silent install, then wait until the setup.exe and javaw.exe processes have ended. The script uses WMI to watch for the processes.
Before using the script, you will need to customize it for your Oracle install location. Change the following line in the script so that sOraPath contains the location of your Oracle installation files:
sOraPath = "\\serverpath\apps\client 92010\"
By default, the Oracle 9i Home will be set to C:\oracle\product\9.2.0\client\. To change the location, change the following line so that sClientPath contains the local path where you want the client installed:
sClientPath = "%SYSTEMDRIVE%\oracle\product\9.2.0\client"
Thanks for the input. I like the exit code suggestion, and will definitely use it going forward!
The CheckProcess function of the script is still required, though, even when WshShell.Run waits for setup.exe to complete. The issue is that for this Oracle install, setup.exe was completing and exiting, but was leaving the install running in a javaw.exe process. Setup.exe would exit properly and would no longer show up as a process in Task Manager, but the installation was not finished. A javaw.exe process remained and performed the actual installation of the Oracle client files.
The main purpose of the script is to wait for the secondary process to complete after the primary process called by Exec or Run ends.
Thanks for the corrected link!