在Setup.rul中,新增OnBegin函數
STRING str1,spath,szApplicationPath,szApplicationCmdLine,szCmdLine;
function OnBegin()?? ?
begin
?? ?// TO DO: you may change default non-UI setting, for example
?? ?//
?? ?// You may also perform your custom initialization steps, check requirements, etc. ?
?? ?Disable(BACKBUTTON);
?? ?if(!MAINTENANCE)then
?? ?SdLicense2("License","","",SUPPORTDIR^"協議.txt",FALSE);
?? ?endif;??????? ?
?? ?//------------------------------------------------------------------------------------
?? ?szApplicationPath = WINSYSDIR ^ "msiexec.exe";
?? ?szApplicationCmdLine = "/i c:\\mysql.msi";
?? ?LongPathToQuote( szApplicationPath, TRUE );
?? ?szCmdLine = szApplicationPath + " " + szApplicationCmdLine;
??? RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
??? MessageBox ("You are here", INFORMATION);
if(RegDBKeyExist("SOFTWARE\\MySQL AB\\MySQL Connector/ODBC 5.2 64bit(community edition)")<0)then?? ?
?? ?MessageBox ("You are here1", INFORMATION);
?? ?MessageBox(PROGRAM,INFORMATION); ?
?? ?MessageBox(SRCDIR,INFORMATION); ?
?? ?MessageBox(szCmdLine,INFORMATION);
?? ?LaunchAppAndWait("",szCmdLine, LAAW_OPTION_WAIT);
endif;
end;功能:在安裝時,出現許可證后檢測是否系統中安裝必要的組件,如果沒有安裝就提示安裝。有,則跳過。當必要組件是.exe的文件。直接加載到support中即可。如果是.msi后綴的文件需要調用window installer來安裝。用到的函數是LaunchAppAndWait(szProgram, szCmdLine, nOptions )
szProgram:Specifies the complete path and file name of the application to be launched.
szCmdLine:Specifies the command-line parameters to pass to the launched application.
nOptions:LAAW_OPTION_WAIT----Passed through the function to WaitForApplication.
?
?
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
