Get Default Oracle Home Path: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
m (Updated author and download links, and changed format of some pages.) |
m (Adding new author and category links.) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{PageAuthor|Iceman_K}} | |||
== The Function == | == The Function == | ||
<highlight-nsis> | <highlight-nsis> | ||
Line 54: | Line 56: | ||
</highlight-nsis> | </highlight-nsis> | ||
[[Category:Database Functions]] |
Latest revision as of 12:17, 24 June 2005
Author: Iceman_K (talk, contrib) |
The Function
; ; Gets the name of the default Oracle Home path ; ; Usage: ; ; Call GetOracleDefaultHomePath ; Pop $0 ; Function GetOracleDefaultHomePath Push $R1 Push $R2 Push $R3 Push $R4 ; Get the name of the default home ReadRegStr $R1 HKLM "SOFTWARE\ORACLE\ALL_HOMES" "DEFAULT_HOME" StrCmp $R1 "" done ; Get the number of homes ReadRegStr $R4 HKLM "SOFTWARE\ORACLE\ALL_HOMES" "HOME_COUNTER" ; Loop through all homes StrCpy $R3 0 loop: IntCmp $R3 $R4 not_found 0 not_found ; Compare the home name to the default home name ReadRegStr $R2 HKLM "SOFTWARE\ORACLE\ALL_HOMES\ID$R3" "NAME" StrCmp $R2 $R1 0 next ; Verify the path of the home ReadRegStr $R2 HKLM "SOFTWARE\ORACLE\ALL_HOMES\ID$R3" "PATH" IfFileExists $R2 0 bad_home StrCpy $R1 $R2 GoTo done bad_home: StrCpy $R1 "" GoTo done next: IntOp $R3 $R3 + 1 GoTo loop not_found: StrCpy $R1 "" done: Pop $R4 Pop $R3 Pop $R2 Exch $R1 FunctionEnd