I found this StackOverflow question, and favored the PowerShell option, so I modified that answer to be able to expand the ORACLE_HOME property in the response file.
I modified the response file that I got from the manual installation wizard of the BPM QuickStart as follows:
[ENGINE] #DO NOT CHANGE THIS. Response File Version=1.0.0.0.0 [GENERIC] #Set this to true if you wish to skip software updates DECLINE_AUTO_UPDATES=true #My Oracle Support User Name MOS_USERNAME= #My Oracle Support Password MOS_PASSWORD=<SECURE VALUE> #If the Software updates are already downloaded and available on your local system, then specify the path to the directory where these patches are available and set SPECIFY_DOWNLOAD_LOCATION to true AUTO_UPDATES_LOCATION= #Proxy Server Name to connect to My Oracle Support SOFTWARE_UPDATES_PROXY_SERVER= #Proxy Server Port SOFTWARE_UPDATES_PROXY_PORT= #Proxy Server Username SOFTWARE_UPDATES_PROXY_USER= #Proxy Server Password SOFTWARE_UPDATES_PROXY_PASSWORD=<SECURE VALUE> #The oracle home location. This can be an existing Oracle Home or a new Oracle Home ORACLE_HOME=${ORACLE_HOME}
I saved this as bpmqs1221_silentInstall.rsp.tpl. Then I created a simple command file called expandProperties.bat with the following content:
set ORACLE_HOME=c:\oracle\jdeveloper\12212_bpmqs
set QS_RSP=bpmqs1221_silentInstall.rsp
set QS_RSP_TPL=%QS_RSP%.tpl
powershell -Command "(Get-Content %QS_RSP_TPL%) -replace '\$\{ORACLE_HOME\}', '%ORACLE_HOME%' | Out-File -encoding ASCII
%QS_RSP%"
This does the following:
- Set the ORACLE_HOME environment variable. This is what I also do in the QuickStart install script. The content of this variable should replace the '${ORACLE_HOME}' property in the response file template.
- Set QS_RSP to the Response File name
- Set QS_RSP_TPL to the Response File Template name
- Call Powershell with a command line command using the '-Command' argument
- Read the template file denoted with %QS_RSP_TPL%' using the Get-Content argument.
- Replace the occurrences of the string '${ORACLE_HOME}' with the value of the corresponsing environment variable '%ORACLE_HOME%'. But since the input is considered as a regular expression. Thus the special characters $, { and } need to be prefixed with a backslash.
- 'Pipe' the output to the output file denoted with %QS_RSP%. It's important to add -encoding ASCII for the encoding. Otherwise its apparently encoded in UTF in a way the Oracle Installer does not comprehend.
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
c:\Data\Zarchief\Stage\FMW\bpm12cR2QS>expandProperties.bat
c:\Data\Zarchief\Stage\FMW\bpm12cR2QS>set ORACLE_HOME=c:\oracle\jdeveloper\12212_bpmqs
c:\Data\Zarchief\Stage\FMW\bpm12cR2QS>set QS_RSP=bpmqs1221_silentInstall.rsp
c:\Data\Zarchief\Stage\FMW\bpm12cR2QS>set QS_RSP_TPL=bpmqs1221_silentInstall.rsp.tpl
c:\Data\Zarchief\Stage\FMW\bpm12cR2QS>rem powershell -Command "(gc bpmqs1221_silentInstall.rsp.tpl) -replace '\$\{ORACLE_HOME\}', 'c:\oracle\jdeveloper\12212_bpmqs' | Out-File -encoding ASCII
bpmqs1221_silentInstall.rsp"
c:\Data\Zarchief\Stage\FMW\bpm12cR2QS>powershell -Command "(Get-Content bpmqs1221_silentInstall.rsp.tpl) -replace '\$\{ORACLE_HOME\}', 'c:\oracle\jdeveloper\12212_bpmqs' | Out-File bpmqs1221_silentInstall.rsp"
c:\Data\Zarchief\Stage\FMW\bpm12cR2QS>
This creates a new file named bpmqs1221_silentInstall.rsp, where the content of the last line is changed to:
... #The oracle home location. This can be an existing Oracle Home or a new Oracle Home ORACLE_HOME=c:\oracle\jdeveloper\12212_bpmqs
Just what I need...
No comments :
Post a Comment