Blame | Last modification | View Log | RSS feed
Function GetDriverNamePush $R1ReadRegStr $R1 HKLM "SOFTWARE\ERG Transit Systems\GUA" DriverNameExch $R1FunctionEndFunction GetDriversODBCPush $R1StrCpy $0 0loop:;lecture de la $0 eme valeurEnumRegValue $1 HKLM "SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" $0StrCmp $1 "" done; on concatene | nompiloteStrCmp $R1 "" +2StrCpy $R1 "$R1|"StrCpy $R1 "$R1$1"; on passe a l'indice suivantIntOp $0 $0 + 1Goto loopdone:;MessageBox MB_OK|MB_ICONQUESTION "ODBC drivers : $R1"Exch $R1FunctionEnd; Trim; Removes leading & trailing whitespace from a string; Usage:; Push; Call Trim; PopFunction TrimExch $R1 ; Original stringPush $R2Loop:StrCpy $R2 "$R1" 1StrCmp "$R2" " " TrimLeftStrCmp "$R2" "$\r" TrimLeftStrCmp "$R2" "$\n" TrimLeftStrCmp "$R2" "$\t" TrimLeftGoTo Loop2TrimLeft:StrCpy $R1 "$R1" "" 1Goto LoopLoop2:StrCpy $R2 "$R1" 1 -1StrCmp "$R2" " " TrimRightStrCmp "$R2" "$\r" TrimRightStrCmp "$R2" "$\n" TrimRightStrCmp "$R2" "$\t" TrimRightGoTo DoneTrimRight:StrCpy $R1 "$R1" -1Goto Loop2Done:Pop $R2Exch $R1FunctionEnd;; Gets the name of the default Oracle Home path in 64 bit env;; Usage:;; Call GetOracleDefaultHomePath64; Pop $0;Function GetOracleDefaultHomePath64Push $R1Push $R2; parcourir la cle oracle a la recherche de KEY_xxxxxStrCpy $0 0loop:;lecture de la $0 eme valeurEnumRegKey $1 HKLM "SOFTWARE\Wow6432Node\ORACLE" $0StrCmp $1 "" bad_home; on concatene | nompiloteStrCpy $R1 "SOFTWARE\Wow6432Node\ORACLE\$1"ReadRegStr $R1 HKLM $R1 "ORACLE_HOME"StrCmp $R1 "" +2Goto done; on passe a l'indice suivantIntOp $0 $0 + 1Goto loopbad_home:StrCpy $R1 ""done:Pop $R2Exch $R1FunctionEnd;; Gets the name of the default Oracle Home path;; Usage:;; Call GetOracleDefaultHomePath; Pop $0;Function GetOracleDefaultHomePathPush $R1Push $R2;Wow6432Node; Get the name of the default homeReadRegStr $R1 HKLM "SOFTWARE\ORACLE\OracleMTSRecoveryService\Setup\Current Version" "HOME"ReadRegStr $R1 HKLM $R1 "ORACLE_HOME"StrCmp $R1 "" GetBis;VerifHome:IfFileExists $R1 0 bad_homeGoto doneGetBis:; parcourir la cle oracle a la recherche de KEY_xxxxxStrCpy $0 0loop:;lecture de la $0 eme valeurEnumRegKey $1 HKLM "SOFTWARE\ORACLE" $0StrCmp $1 "" test64; on concatene | nompiloteStrCpy $R1 "SOFTWARE\ORACLE\$1";MessageBox MB_OK|MB_ICONQUESTION "ORACLE : $R1"ReadRegStr $R1 HKLM $R1 "ORACLE_HOME";MessageBox MB_OK|MB_ICONQUESTION "ORACLE : $R1"StrCmp $R1 "" +2Goto done; on passe a l'indice suivantIntOp $0 $0 + 1Goto looptest64:Call GetOracleDefaultHomePath64Pop $R1StrCmp $R1 "" bad_homeGoto donebad_home:StrCpy $R1 ""done:Pop $R2Exch $R1FunctionEnd;; Returns the list of Oracle TNS Connection Names separated by the; pipe ("|") symbol, suitable for setting the ListItems attribute; in an InstallOptions DropList.;; Requires: GetDefaultOracleHomePath; Requires: Trim;; Usage:;; Call GetOracleConnections; Pop $0;Function GetOracleConnectionsClearErrorsPush $R1 ;The connection listPush $R2 ;Line read from tnsnames.oraPush $R3 ;File handlePush $R4 ;Flag indicating whether connection name has been capturedPush $R5 ;Parentheses countPush $R6 ;Current connection namePush $R7 ;Character being currently processedPush $R8 ;Temp varStrCpy $R1 ""Call GetOracleDefaultHomePathPop $R2StrCmp $R2 "" done; The path of the TNS names fileStrCpy $R2 "$R2\network\admin\tnsnames.ora"; Open the TNS names fileStrCpy $R3 ""FileOpen $R3 $R2 "r"StrCmp $R3 "" fileerrorClearErrorsStrCpy $R1 ""reset:; Reset variablesStrCpy $R4 "0"StrCpy $R5 "0"StrCpy $R6 ""read:; Read a line from the fileFileRead $R3 $R2StrCmp $R2 "" 0 loopIfErrors closefile read; Loop through the characters in the line just readloop:StrCpy $R7 $R2 1StrCmp $R7 "" readStrCpy $R2 $R2 "" 1StrCmp $R7 "#" commentStrCmp $R7 " " whitespaceStrCmp $R7 " " whitespaceStrCmp $R7 "$\t" whitespaceStrCmp $R7 "$\r" whitespaceStrCmp $R7 "$\n" whitespaceStrCmp $R7 "(" openparenStrCmp $R7 ")" closeparenStrCmp $R7 "," addStrCmp $R7 "=" equalStrCmp $R4 "1" loopappend:StrCmp $R6 "" blankStrCpy $R8 $R6 1 -1StrCmp $R8 " " syntaxerrorStrCmp $R8 " " syntaxerrorStrCmp $R8 "$\r" syntaxerrorStrCmp $R8 "$\n" syntaxerrorblank:StrCpy $R6 "$R6$R7"GoTo loopcomment:StrCmp $R6 "" readStrCmp $R4 "1" read syntaxerrorwhitespace:StrCmp $R6 "" loopStrCmp $R4 "1" loop appendequal:StrCmp $R4 "1" loopStrCpy $R4 "1"GoTo loopopenparen:StrCmp $R4 "1" 0 syntaxerrorIntOp $R5 $R5 + 1GoTo loopcloseparen:StrCmp $R4 "1" 0 syntaxerrorIntOp $R5 $R5 - 1IntCmp $R5 0 0 syntaxerror loopPush $R1Call TrimPop $R1StrCmp $R1 "" +2StrCpy $R1 "$R1|"StrCpy $R1 "$R1$R6"GoTo resetadd:StrCpy $R1 "$R1|"StrCpy $R1 "$R1$R6"StrCpy $R4 "0"StrCpy $R5 "0"StrCpy $R6 ""GoTo loopclosefile:FileClose $R3GoTo donefileerror:MessageBox MB_OK "File access error: tnsnames.ora."StrCpy $R1 ""GoTo donesyntaxerror:MessageBox MB_OK "File syntax error: tnsnames.ora."StrCpy $R1 ""StrCmp $R3 "" +2FileClose $R3GoTo donedone:Pop $R8Pop $R7Pop $R6Pop $R5Pop $R4Pop $R3Pop $R2Exch $R1FunctionEnd