echo off
rem script: genreg.bat
rem generates a .reg file to install or deinstall OraMTS

rem fix the slashes to double slashes for adding to the registry ....
set orcl_home=%orcl_home:\=\\%

REM determine if the configuration is on a 32-bit or 64-bit OS
set ODAC_CFG_PREFIX=Wow6432Node\
if (%PROCESSOR_ARCHITECTURE%) == (x86) if (%PROCESSOR_ARCHITEW6432%) == () set ODAC_CFG_PREFIX=

if (%1) == (deinstall) goto :deinstall
if (%1) == (install)   goto :install

:install
rem  generate registry for setup
echo Windows Registry Editor Version 5.00
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\%ODAC_CFG_PREFIX%Oracle]
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\%ODAC_CFG_PREFIX%Oracle\KEY_%2]
echo "ORAMTS_CP_TRACE_DIR"="%orcl_home%\\oramts\\trace"
echo "ORAMTS_CP_TRACE_LEVEL"="0"
echo "ORAMTS_CONN_POOL_TIMEOUT"="120"
echo "ORAMTS_SESS_TXNTIMETOLIVE"="120"
echo "ORAMTS_NET_CACHE_MAXFREE"="5"
echo "ORAMTS_NET_CACHE_TIMEOUT"="120000"
echo "ORAMTS_OSCREDS_MATCH_LEVEL"="OS_AUTH_LOGIN"
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\%ODAC_CFG_PREFIX%Oracle\OracleMTSRecoveryService]
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\%ODAC_CFG_PREFIX%Oracle\OracleMTSRecoveryService\Protid_0]
echo "Name"="HTTP"
echo "Host"="%reco_host%"
echo "Port"="%reco_port%"
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\%ODAC_CFG_PREFIX%Oracle\OracleMTSRecoveryService\Setup]
echo "NumberOfInstalls"="1"
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\%ODAC_CFG_PREFIX%Oracle\OracleMTSRecoveryService\Setup\All Versions]
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\%ODAC_CFG_PREFIX%Oracle\OracleMTSRecoveryService\Setup\All Versions\1]
echo "Home"="%orcl_home%"
echo "Version"="%oramts_ver%"
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\%ODAC_CFG_PREFIX%Oracle\OracleMTSRecoveryService\Setup\Current Version]
echo "Home"="%orcl_home%"
echo "Version"="%oramts_ver%"
echo.
echo [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\OracleMTSRecoveryService]
echo "OMTSRECO_TRACELEVEL"="Level0"
echo "OMTSRECO_TRACEFILE"="%orcl_home%\\oramts\\trace"
goto :eof

:deinstall
rem generate registry for deinstall
echo Windows Registry Editor Version 5.00
echo.
echo [HKEY_LOCAL_MACHINE\SOFTWARE\%ODAC_CFG_PREFIX%Oracle\KEY_%2]
echo "ORAMTS_CP_TRACE_LEVEL"=-
echo "ORAMTS_CP_TRACE_DIR"=-
echo "ORAMTS_CONN_POOL_TIMEOUT"=-
echo "ORAMTS_SESS_TXNTIMETOLIVE"=-
echo "ORAMTS_NET_CACHE_MAXFREE"=-
echo "ORAMTS_NET_CACHE_TIMEOUT"=-
echo "ORAMTS_OSCREDS_MATCH_LEVEL"=-
echo.
echo [-HKEY_LOCAL_MACHINE\SOFTWARE\%ODAC_CFG_PREFIX%Oracle\OracleMTSRecoveryService]
goto :eof

:eof
