sreedhar_kumar
14th March 2005 13:46 UTC
How to check whether Oracle is installed?
Hi all,
I am using "SearchPath" to locate SQLPLUS.EXE. If the file is found, I am installing tables for Oracle database with SQLPLUS. Otherwise I need to "Abort" the installation.
I know that "SearchPath" will only look in SPECIFIC directories and not all.
I want a better alternative to surely confirm that "Oracle is not installed on Client's System" i.e. I want a better alternative to "SearchPath". Can I use some REGISTRY related code in my NSI File that searches whether Oracle is installed? If so, how?
Thanks in Advance,
Sreedhar Kumar
*******************************************************
Such a question is not posted earlier in this Forum and surely deserves everyone's attention.
******************************************************
Davion
14th March 2005 15:28 UTC
You can Check for the reg-key
"HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ORACLE_HOME"
Where the installationpath of ORACLE is stored
if it is there, Oracle should be installed
sreedhar_kumar
15th March 2005 05:10 UTC
Thanks Davion,
But....... will that Registry Key be the same on all Windows OS? Is it is THE same, then no problem.
What if it is not? Please let me know whether they differ in different Windows OS's. Meanwhile, I will be looking for the same.
Sreedhar
kichik
15th March 2005 19:03 UTC
I recommend using Oracle Instant Client. It's very easy to install.
sreedhar_kumar
16th March 2005 09:22 UTC
Davion,
Please provide me with the Exact Code that checks whether Oracle is installed on my System or not.....
ReadRegStr is giving some Integer and no exact code I have regarding.
Help me out with the code plz.
Davion
16th March 2005 09:59 UTC
StrCpy $R0 ""
ReadRegStr $R0 HKLM "SOFTWARE\ORACLE" "ORACLE_GROUP_NAME"
I'm Not fully Sure if it's every time the Oracle Version number, but in this location in HKLM there are a few Keys which could be interesting for you
If the Key doesn't exist $R0 would be a empty string
and the errorflag should be set too.
I don't know the specific keys of all Ora Versions there are too much different builds
I've tested this line on Ora816 and it gives back
Oracle - OraHome81
I hope this helps
greetz Davion
Afrow UK
16th March 2005 16:25 UTC
You don't need to use StrCpy $R0 "" first.
ReadRegStr will return a value of "" anyway (and set the error flag if the registry key does not exist which you can check with IfErrors).
-Stu