I’ve been working on this all week and I finally made a breakthrough for this today. The task at hand was to automate the install of the Oracle Data Access Components for OLE DB for 10g. At my work we prefer to script everything so if anyone gets knocked down by a bus, someone else should be able to just run the script (good best practice in my opinion). We also want scripted uninstalls, so that if it all goes wrong, we just run the backout script.
The Oracle Universal Installer is a java based application and when invoked in the right way, it can record what’s called a response file. It basically contains everything that you tick, configure and puts it into a text file. The Oracle documentation describe the process very easily…see this link
(By the way this is a Windows tutorial, I haven’t messed about with the unix side).
To summarise the docs, you download whatever Oracle software involved, in my case, ODAC for OLE 10g. Decompress it into a directory on a test server and run the setup with the following switches:
setup.exe -record -responsefile <complete path and name of file>
OUI seems to be quite “fussy” over how you call it, so make sure you include the .exe file extension and the full path of the response file you want to create.
Now when you want to run this as an unattended batch script , its best to call the setup.exe from the same directory you run your script in. The command to run is:
setup.exe -silent <complete path and name of file>
Easy you say. Well yes that was the easy bit. The response file can be customised to do all sorts of things, like reduce the amount of text coming out on screen etc…(you’ll have to go back to Oracle for what to do there, I’m no Oracle expert).
What wasn’t so easy was trying to do the reverse in script. Running the setup.exe with the -deinstall script launches the OUI, and appears to get so far then sits and waits for user intervention. Not good for automated installations.
The trick here was to amend the response file…..it took me about two weeks to figure this out.
Find the bit in the response file that says:
SHOW_DEINSTALL_CONFIRMATION = true
and set it to false. This means the install won’t ask you if it’s ok to remove it’ll just do it. That in conjuction with the following commandline:
setup.exe -deinstall -silent -responsefile <full path and name of file>
Get’s the job done.
The only other problem to solve (which got sorted out fairly early on in this piece of work was the annoying way the java.exe process stays open because the install waits for a user to press [enter] at the end of it. I played around with the response files but never got a solid answer. I used a batch script loop to look through the installation logs (in c:\program files\oracle\inventory\logs) and find the installed successfully message. When the loop found it, it killed off the java.exe process. Nice.
So that was my success for the week. Hope it helps.