|
functionInstalloraclecomponent(Szcomponent)Number Nresult,nvfilehandle,nindex,nvcount;STRINGSmsg,szserver,szdb,szuser,szpassword,scmd,sopt,sinstance,stmp,svline; LIST Liststatus;beginSMSG =' Install '+szcomponent+' ... '; Sdshowmsg(SMSG,TRUE);//Fetch database connection InformationSqlrtgetconnectioninfo( ' Oracle ', Szserver, Szdb, Szuser, Szpassword); NIndex = Strfind(Szserver,': '); NIndex = Strfindex(Szserver,'/', NIndex); Strsub(Sinstance, Szserver, nindex+1, -); Scmd = winsysdir^' cmd.exe '; SOPT ='/C '+' sqlplus.exe-l-S '+szuser+'/'+szpassword+' @ '+sinstance; SOPT = sopt+' @ '+srcdir^szcomponent+'. sql > '+srcdir^' Dbstatus.txt 2>&1 ';//Execute The script associated with the given component in databaseNresult=launchappandwait(Scmd, SOPT, WAIT.|Laaw_option_hidden);if (Nresult< 0) ThenMessageBox(' Failed installing '+szcomponent+'! ', SEVERE); Abort endif//Close Installation TipsSdshowmsg("',FALSE);//query string Holytail in Dbstatus.txt, if present, stating that the script has finished executing if (Filegrep(srcdir^' Dbstatus.txt ',' Holytail ', Svline, NIndex,RESTART)=0) Then //query string ora-in Dbstatus.txt, if present, indicates script execution error if (Filegrep(srcdir^' Dbstatus.txt ',' ora-', Svline, NIndex,RESTART)=0) ThenSMSG ="Error updating database, point" is "open log file and exit the installation, click" No "to exit the installation directly. /n "; SMSG = smsg+"If errors can be ignored, select the database type" None "to skip database updates and update the program directly,/n"; SMSG = smsg+"Then execute the SQL script manually in the database (saved in the script directory after installation)"; Nresult = AskYesNo(SMSG, YES);if (Nresult = YES) ThenLaunchapp(winsysdir^' notepad.exe ', srcdir^' Dbstatus.txt '); endif Abort endifElseSMSG ="Error updating database, point" is "open log file and exit the installation, click" No "to exit the installation directly. /n "; SMSG = smsg+"If errors can be ignored, select the database type" None "to skip database updates and update the program directly,/n"; SMSG = smsg+"Then execute the SQL script manually in the database (saved in the script directory after installation)"; Nresult = AskYesNo(SMSG, YES);if (Nresult = YES) ThenLaunchapp(winsysdir^' notepad.exe ', srcdir^' Dbstatus.txt '); endif Abort endifEnd; |