Archive: How to check whether Oracle is installed?


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.
******************************************************


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


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


I recommend using Oracle Instant Client. It's very easy to install.


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.



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

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