學(xué)習(xí)-綜合教程installshiled腳本installshield代碼示例_第1頁(yè)
學(xué)習(xí)-綜合教程installshiled腳本installshield代碼示例_第2頁(yè)
學(xué)習(xí)-綜合教程installshiled腳本installshield代碼示例_第3頁(yè)
學(xué)習(xí)-綜合教程installshiled腳本installshield代碼示例_第4頁(yè)
學(xué)習(xí)-綜合教程installshiled腳本installshield代碼示例_第5頁(yè)
已閱讀5頁(yè),還剩45頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

InstallShieldviewplaincopyto File Blanksetupmainscript Blanksetupisanemptysetupproject.Ifyouwant createanewprojectvia.step-bystepinstructionsuse Project////Includedheaderfiles#include"ifx.h"BOOL stringsvResult;numbernvFileHandle; ","DBConnection.txtsvResult)0thencreate PANY_NAME示例數(shù)據(jù)庫(kù)

OpenFile(nvFileHandle, ine(nvFileHandle,dbConnection);endprototypeDetachDB();functionnumberstringsvResult,svLine;numbernvFileHandle;szWaitTxt="正在分離安裝使用的數(shù)據(jù)庫(kù)……";SdShowMsg(szWaitTxt,TRUE);//szCmdLine="/E /S"+svSQLsvr+"/Q\"EXEC //連接字符 OpenFile(nvFileHandle,ProgramFilesFolder+"\\" if(GetLine(nvFileHandle,svLine)<0)then

szCmdLine=svLine+"/Q //szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q =N'"+TARGETDIR^"dlbmydb_log.LDF'\"";LaunchAppAndWait("osql.exe",szCmdLine,WAIT);

goto="http://szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"usedlbj;exec MessageBox("數(shù)據(jù)庫(kù)優(yōu)化失??!您可以在sql查詢分析器中執(zhí)行usedlbj;execsp_updatestats完成!",SEVERE); return0;//Note:InordertohaveyourInstallScriptfunctionexecutedasa//actionbytheWindowsInstaller,itmustbeprototypedas//entry-point//ThekeywordexportidentifiesMyFunction()asanentry-point//TheargumentitacceptsmustbeahandletotheInstaller/*exportprototypeMyFunction(HWND);//由WindowsInstaller的行動(dòng),它必須作為一個(gè)原型點(diǎn)函數(shù)//*出口原型調(diào)用MyFunction(HWND)*//IISfunctionCheckIIS()NUMBERnvType,nvSize;STRINGsvvalue;if(RegDBKeyExist("System\\CurrentControlSet\\Services\\IISADMIN")=1)thenreturn(1);

return////TheOnFirstUIBeforeeventiscalledbytheframeworkwhenthesetup//runninginfirstinstallmode.BydefaultthiseventdisplaysUI//theendusertospecifyinstallationfunctionSTRINGszTitle,szMsg,szQuestion,svName, STRINGszLicenseFile;LISTlist,BOOLnumbernvFileHandle,nvIp;stringszOpt1,BOOLbLicenseAccepted;//TODO:ifyouwanttoenablebackground,windowtitle,andcaptionbar//SetTitle(@PRODUCT_NAME,24,WHITE//Enable(BACKGROUND//SetColor(BACKGROUND,RGB(0,128,128)); _OBJECT_FOLDER=@PRODUCT_NAME;nSetupType=//設(shè)置背景SetTitle("使用卡電子產(chǎn)品 "顯示

Enable(BACKGROUND);// 左上角// //PlaceWindowBILLBOARD20040UPPER_LEFT// //PlaceWindow(BACKGROUND,10,10,UPPER_LEFT);//背景窗口的位置為左上方開(kāi)始 “位圖文件名;透明標(biāo)志;<未用>;<未用>57×53);// //ipifFindFile(SUPPORTDIR,"ipconfig.batsvResult)0thencreateOpenFile(nvFileHandle ine(nvFileHandle,"ipconfig/all>>\""+SUPPORTDIR+"\ipconfig.txt\"");//ip地if(FindFile(SUPPORTDIR,"ipconfig.txtsvResult)0thencreateOpenFile(nvFileHandle,SUPPORTDIR,"ipconfig.txt");if(GetLine(nvFileHandle,svLine)<0)thennvIp=StrFind(svLine,"Ethernetadapter本地連接:");if(GetLine(nvFileHandle,svLine)<0)then

nvIp=StrFind(svLine,"IPAddress");

gotocd;////szProgram=//szCmdLine="setupapi.dll,InstallHinfSectionModem1132"+WINDIR+"driver139\\oxser.inf";ifCheckIIS() goto

"s SprintfBox(MB_OK,"IIS安裝","IIS安裝時(shí)發(fā)生意外,請(qǐng)重新安裝!");gotoSetIIS;if(RegDBKeyExist("SOFTWARE\\\\.NETFramework\\policy\\v2.0")<0)SprintfBox(MB_OK,".NET安裝","尚未安裝.netframework2.0!\n“確定”以繼續(xù)安裝if(LaunchAppAndWait(SUPPORTDIR^"dotnetfx.exe","/q:a/l",WAIT)<0)

SprintfBox(MB_OK,".NET安裝",".NETFrameWork2.0已安裝!"); ("SOFTWARE\\\\SQLLServer2000",-1)<0)thenSprintfBox(MB_OK,"SQLServer2000安裝","尚未安裝SQLServer2000!\n“確定”以繼<0)SprintfBox(MB_OK,"SQLServer2000安裝","SQLServer2000時(shí)發(fā)生意外,請(qǐng)

SprintfBox(MB_OK,"SQLServer2000安裝","SQLServer2000已安裝!"); //歡迎szTitleYHK_GF安裝軟件\b\n\b\nnResult if(nResult=BACK) Dlg_SdLicense2://軟件協(xié)!";szOpt1="同意(&A)";szOpt2不同意szLicenseFileSUPPORTDIR^用戶使用協(xié)議nResult=SdLicense2Rtf(szTitle,szOpt1,szOpt2,szLicenseFile,bLicenseAcceptedif(nResult=BACK)then bLicenseAccepted=szMsg請(qǐng)您填寫(xiě)用戶信息卡szTitle="\b\n使用YHK安裝系統(tǒng)"; ="";pany=nResult=SdCustomerInformation(szTitle,svName, if(nResult=BACK)goto szTitle安裝類型\b\n請(qǐng)選擇安裝類型";szMsg="請(qǐng)選擇安裝";nResult=SetupType(szTitle,szMsg,"",nSetupType,0);if(nResult=BACK)thengotonSetupType=if(nSetupType!=CUSTOM)thennvSize=0;

if(nvSize!=0)thengotoDlg_SetupType;bCustom=FALSE;gotoDlg_SQL;bCustom=nResult=SdAskDestPath(szTitle,szMsg,INSTALLDIR,0);if(nResult=BACK)gotoDlg_SetupType; =""; =if(nSetupType=CUSTOM)nResult=SdFeatureTree(szTitle,szMsg,INSTALLDIR,"",2);if(nResult=BACK)gotoDlg_SdAskDestPath;nResult=OnSQLLogin(nResult);if(nResult=BACK)thenif(!bCustom)gotogoto szTitle可以安裝“網(wǎng)上閱卷系統(tǒng)”了\b\n安裝準(zhǔn)備工作已就緒,可以開(kāi)始安裝了。";//Thefollowingisanexampleofhowtoaddastring(svName)toa//eg. if(nSetupType=CUSTOM)elseif(nSetupType=TYPICAL)thenelseif(nSetupType=COMPACT)thennResult=SdStartCopy(szTitle,szMsg,listStartCopy);if(nResult=BACK)thengotoDlg_SQL;//AddFolderIcon(FOLDER_DESKTOP,"網(wǎng)上閱卷系統(tǒng)首頁(yè)AddFolderIcon(FOLDER_PROGRAMS^網(wǎng)上閱卷系統(tǒng)GF安裝網(wǎng)上閱卷系統(tǒng)首頁(yè)AddFolderIcon(FOLDER_PROGRAMS^"網(wǎng)上閱卷系統(tǒng)GF安裝","卸載","\""+PROGRAMFILES+"\InstallShieldInstallationInformation\\{E71A5501-0CCF-4765-A743- }\\Setup.exe\"",TARGETDIR,TARGETDIR+"\\TempIco\\011.ico",0,"",REPLACE);//<PROGRAMFILES>\InstallShieldInstallationInformation\{96C6BC6D-1EAA-43C2- ////////setupdefaultstatusreturn////TheOnMaintUIAftereventcalledbytheframeworkafterthefile//ofthesetupwhenthesetupisrunninginmaintenancemode.By//thiseventdisplaysUIthatinformstheenduserthatthemaintenance//hasbeencompleted//functionSTRINGszTitle,szMsg1,szMsg2,szOption1,szOption2;NUMBERbOpt1,bOpt2; = =//Added-Version9.5-Useappropriatestringsfor//if(REMOVEALLMODE)szTitle=SdLoadString(IFX_SDFINISH_REMOVE_TITLE);szMsg1=SdLoadString(IFX_SDFINISH_REMOVE_MSG1);

szTitle=SdLoadString(IFX_SDFINISH_MAINT_TITLE); =SdLoadString(IFX_SDFINISH_MAINT_MSG1);

SdFinishEx(szTitle,szMsg1,szMsg2,szOption1,szOption2,bOpt1,////TheOnFirstUIAftereventcalledbytheframeworkafterthefile//ofthesetupwhenthesetupisrunninginfirstinstallmode.By//thiseventdisplaysUIthatinformstheenduserthatthesetuphas//completedfunctionSTRINGszTitle,szMsg1,szMsg2,szOption1,szOption2;NUMBERbOpt1,bOpt2;stringszBmpPath;//自定義);//szTitle閱卷系統(tǒng)安裝完畢szMsg1YHK_GF";="

=szMsg1=SdFinishEx(szTitle,szMsg1,szMsg2,szOption1,szOption2,bOpt1,//functionnumberOnSQLLogin(nBtn)stringsMessage;stringszConnection,szDB,sTemp[MAX_PATH]; numbernResult,nSize,nCount; STRINGsvResult,svLine;//自定義numbernvFileHandle;//FirstinitializeSQLServer//SQLServer//SuppressISSQLSRV.DLLtoshowaconnectionerror//GetthenamesofallthenecessaryconnectionslistConnections=SQLRTGetConnections();ListGetFirstString(listConnections,szConnection);nCount=0;//determineifNEXTorBACKwillbe//iftherearenoconnectionstoif(nBtn!=BACK)thenbNext=TRUE;

bNext=//startatendifgoingwhile(ISERR_SUCCESS=ListGetNextString(listConnections,szConnection));//Loginforeachwhile(nResult=//GetDefaultvaluesforbWinLogin=SQLRTGetConnectionAuthentication(szConnection);//Displaylogindialog(withoutconnection//COMMENTOUTTOSWAPnResult=SQLServerSelectLogin2(szConnection,szServer,szUser,szPassword,bWinLogin,szDB,FALSE,TRUE);//下面的是只顯示登錄用戶和的不顯示數(shù)據(jù)庫(kù)和windows登錄選//Displaylogindialog(withconnection MENTTOSWAP//nResult=SQLServerSelectLogin2(szConnection,szServer,szUser,szPassword,bWinLogin,szDB,TRUE,TRUE);if(nResult=NEXT)//storedataincaseweneeditSQLRTPutConnectionInfo2(szConnection,szServer,szDB,szUser,szPassword);SQLRTPutConnectionAuthentication(szConnection,bWinLogin);bWinLogin

//testnSize=if(sTemp!="0")nSize

nSize=if(nSize=0)Sprintf(sMessage,SdLoadString(IDS_IFX_SQL_ERROR_LOGIN_FAILED),szConnection,SdLoadString(ISCRIPT_E_UNKNOWN_ERROR_DESC));MessageBox(sMessage,MB_OK//Showsamelogindialogelse//繼續(xù)下//MoveontonextconnectionbNext=//bNextFALSE;nResult=ListSetIndex(listConnections,nCount);ListCurrentString(listConnections,szConnection);if(bNext)return////TheOnMaintUIBeforeeventiscalledbytheframeworkwhenthesetup//runninginmaintenancemode.BydefaultthiseventdisplaysUI//allowstheendusertoaddorremovefeatures,repair//installedfeaturesoruninstallthe//該事件被稱為OnMaintUIBefore由框架時(shí),安裝程序在模式下運(yùn)行//functionOnMaintUIBefore()NUMBERnResult,nType;STRINGszTitle,szMsg,svDir,svResult, “位圖文件名;透明標(biāo)志;<未用>;<未用>57×53);////TODO:ifyouwanttoenablebackground,windowtitle,andcaptionbar//SetTitle(@PRODUCT_NAME,24,WHITE//Enable(BACKGROUND); =' //AddedinVersion9.5-SupportforREMOVEONLY//9.5-REMOVEONLY//InstandardmodeshowmaintenancenType= eMaint(szTitle,szMsg,MODIFY);//Hidetheinitialprogressdialogasotherwisetheuser//clickonit,andhidetheDisable(DIALOGCACHE);//InRemoveOnlymode,settonType=//ShowUninstallConfirmationif(nType=REMOVEALL)nResult=MessageBox(SdLoadString(IFX_MAINTUI_MSG),MB_YESNO);if(nResult!=IDYES)then//InREMOVEONLYmode,abortthe//Innon-REMOVEONLYmode,redisplaythepreviousgotonResult=NEXT;if(nType=MODIFY)thenszTitle="";szMsg=nResult=SdFeatureTree(szTitle,szMsg,INSTALLDIR,"",2);if(nResult=BACK)gotoDlg_Start;caseREPAIR:

//setupdefaultSetStatusWindow(0////TheOnUninstalleventiscalledwhenthesetupisrunwiththe-//switch,inthiscasethisistheonlyeventthatwillbe//OnUninstall活動(dòng)名為安裝程序時(shí),使用-uninst運(yùn)行開(kāi)關(guān),在這種情況下,這是唯一的function bvOpt1,stringszTitle,szMsg1,szMsg2,szOpt1,szOpt2,svResult,szCaption;// // 網(wǎng)上閱卷系 安svResult=SdLoadString(ISWI_IS5_UNINST_MSG);szCaption=SdLoadString(IFX_ONMAINTUI_CAPTION);Sprintf(svResult,svResult,@PRODUCT_NAME);if(IDCANCEL=SprintfBox(MB_OKCANCEL,szCaption,svResult))then//DONOT Thebelowcode//initiatetheuninstallationprocess.bvOpt1=FALSE;bvOpt2=szMsg1=SdLoadString(IFX_SDFINISH_MAINT_MSG1);szTitle=SdLoadString(IFX_SDFINISH_MAINT_TITLE);SdFinishEx(szTitle,szMsg1,szMsg2,szOpt1,szOpt2,bvOpt1,DeleteDir(ProgramFilesFolder+"\\InstallShieldInstallationInformation\\{E71A5501-0CCF- DeleteDir(ProgramFilesFolder+"\\InstallShieldInstallationInformation\\{E71A5501-0CCF- prototypeAttachDB(STRING,STRING,STRING);STRINGszCmdLine,szWaitTxt;szWaitTxt="正在附加所需數(shù)據(jù)庫(kù)……";SdShowMsg(szWaitTxt,TRUE);szCmdLine="/E S"+svSQLsvr+"/Q\"EXEC =N'"+ProgramFilesFolder^@COMPANY_NAME+"\\ N'"+ProgramFilesFolder^@COMPANY_NAME+"\\示例數(shù)WriteDBInfo("/E /S"+svSQLsvr);szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"EXECsp_attach_db@dbname=N'YCSCMDB',@filename1=N'"+ProgramFilesFolder^@COMPANY_NAME+"\\示例數(shù)據(jù)庫(kù)\\YCSCMDB_Data.MDF',@filename2 WriteDBInfo("/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr);//szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"EXECsp_attach_db@dbname=N'dlbj',@filename1=N'"+TARGETDIR^"dlbj_web.MDF',@filename2=N'"+TARGETDIR^"dlbmydb_log.LDF'\"";MessageBox("數(shù)據(jù)庫(kù)附加失敗!數(shù)據(jù)庫(kù)文件已安裝到本地 ="http://szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"usedlbj;exec MessageBox("數(shù)據(jù)庫(kù)優(yōu)化失??!您可以在sql查詢分析器中執(zhí)行usedlbj;execsp_updatestats完成!",SEVERE); return0;////TheOnEndeventiscalledattheendofthesetup.Thiseventis//calledifthesetupisfunctionOnEnd()////TheOnAppSearcheventiscalledafterOnBeginandcanbeusedto//forpreviousversionsofthecurrentapplication.Thiseventis//onlywhenthesetupisrunninginfirstinstallfunctionOnAppSearch()////TheOnBegineventiscalleddirectlybytheframeworkafterthe//functionOnBegin()//TODO:youmaychangedefaultnon-UIsetting,for

//Youmayalsoperformyourcustominitializationsteps,checkrequirements,////TheOnMovingeventiscalledjustafterthestandardMSI//'InstallInitialize'isfunctionOnMoving()#include File Blanksetupmainscript Blanksetupisanemptysetupproject.Ifyouwant createanewprojectvia.step-bystepinstructionsuse Project////Includedheaderfiles#include"ifx.h"BOOL stringsvResult;numbernvFileHandle; ","DBConnection.txtsvResult)0thencreate PANY_NAME示例數(shù)據(jù)庫(kù)OpenFile(nvFileHandle,ProgramFilesFolder+"\\" ine(nvFileHandle,dbConnection);endprototypeDetachDB();functionnumberstringsvResult,svLine;numbernvFileHandle;szWaitTxt="正在分離安裝使用的數(shù)據(jù)庫(kù)……";SdShowMsg(szWaitTxt,TRUE);//szCmdLine="/E /S"+svSQLsvr+"/Q\"EXEC 例數(shù)據(jù)庫(kù)OpenFile(nvFileHandle,ProgramFilesFolder+"\\" if(GetLine(nvFileHandle,svLine)<0)then

szCmdLine=svLine+"/Q //szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q =N'"+TARGETDIR^"dlbmydb_log.LDF'\"";LaunchAppAndWait("osql.exe",szCmdLine,WAIT);

goto="http://szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"usedlbj;exec MessageBox("數(shù)據(jù)庫(kù)優(yōu)化失?。∧梢栽趕ql查詢分析器中執(zhí)行usedlbj;execsp_updatestats完成!",SEVERE); return0;//Note:InordertohaveyourInstallScriptfunctionexecutedasa//actionbytheWindowsInstaller,itmustbeprototypedas//entry-point//ThekeywordexportidentifiesMyFunction()asanentry-point//TheargumentitacceptsmustbeahandletotheInstaller/*exportprototypeMyFunction(HWND);//由WindowsInstaller的行動(dòng),它必須作為一個(gè)原型點(diǎn)函數(shù)//*出口原型調(diào)用MyFunction(HWND)*//IISfunctionCheckIIS()NUMBERnvType,nvSize;STRINGsvvalue;if(RegDBKeyExist("System\\CurrentControlSet\\Services\\IISADMIN")=1)thenreturn(1);

return////TheOnFirstUIBeforeeventiscalledbytheframeworkwhenthesetup//runninginfirstinstallmode.BydefaultthiseventdisplaysUI//theendusertospecifyinstallationfunctionSTRINGszTitle,szMsg,szQuestion,svName, STRINGszLicenseFile;LISTlist,BOOLnumbernvFileHandle,nvIp;stringszOpt1,BOOLbLicenseAccepted;//TODO:ifyouwanttoenablebackground,windowtitle,andcaptionbar//SetTitle(@PRODUCT_NAME,24,WHITE//Enable(BACKGROUND//SetColor(BACKGROUND,RGB(0,128,128));S_OBJECT_FOLDER=@PRODUCT_NAME;nSetupType=//設(shè)置背景SetTitle("使用卡電子產(chǎn)品 // 左上角顯示

// //PlaceWindowBILLBOARD20040UPPER_LEFT// //PlaceWindow(BACKGROUND,10,10,UPPER_LEFT);//背景窗口的位置為左上方開(kāi)始 “位圖文件名;透明標(biāo)志;<未用>;<未用>57×53);// //ipifFindFile(SUPPORTDIR,"ipconfig.batsvResult)0thencreateOpenFile(nvFileHandle ine(nvFileHandle,"ipconfig/all>>\""+SUPPORTDIR+"\ipconfig.txt\"");//ip地ifFindFile(SUPPORTDIR,"ipconfig.txtsvResult0thencreateOpenFile(nvFileHandle,SUPPORTDIR,"ipconfig.txt");if(GetLine(nvFileHandle,svLine)<0)thennvIp=StrFind(svLine,"Ethernetadapter本地連接:");if(GetLine(nvFileHandle,svLine)<0)then

nvIp=StrFind(svLine,"IPAddress");

gotocd;////szProgram=//szCmdLine="setupapi.dll,InstallHinfSectionModem1132"+WINDIR+"driver139\\oxser.inf";ifCheckIIS() goto

"s SprintfBox(MB_OK,"IIS安裝","IIS安裝時(shí)發(fā)生意外,請(qǐng)重新安裝!");gotoSetIIS;if(RegDBKeyExist("SOFTWARE\\\\.NETFramework\\policy\\v2.0")<0)SprintfBox(MB_OK,".NET安裝","尚未安裝.netframework2.0!\n“確定”以繼續(xù)安裝if(LaunchAppAndWait(SUPPORTDIR^"dotnetfx.exe","/q:a/l",WAIT)<0)

SprintfBox(MB_OK,".NET安裝",".NETFrameWork2.0已安裝!"); ("SOFTWARE\\\\SQLLServer2000",-1)<0)thenSprintfBox(MB_OK,"SQLServer2000安裝","尚未安裝SQLServer2000!\n“確定”以繼<0)SprintfBox(MB_OK,"SQLServer2000安裝","SQLServer2000時(shí)發(fā)生意外,請(qǐng)

SprintfBox(MB_OK,"SQLServer2000安裝","SQLServer2000已安裝!"); //歡迎szTitleYHK_GF安裝軟件\b\n\b\nnResult if(nResult=BACK) Dlg_SdLicense2://軟件協(xié)!";szOpt1="同意(&A)";szOpt2不同意szLicenseFileSUPPORTDIR^用戶使用協(xié)議nResult=SdLicense2Rtf(szTitle,szOpt1,szOpt2,szLicenseFile,bLicenseAcceptedif(nResult=BACK)then bLicenseAccepted=szMsg請(qǐng)您填寫(xiě)用戶信息卡szTitle="\b\n使用YHK安裝系統(tǒng)"; ="";pany=nResult=SdCustomerInformation(szTitle,svName, if(nResult=BACK)goto szTitle安裝類型\b\n請(qǐng)選擇安裝類型";szMsg="請(qǐng)選擇安裝";nResult=SetupType(szTitle,szMsg,"",nSetupType,0);if(nResult=BACK)thengotonSetupType=if(nSetupType!=CUSTOM)thennvSize=0;

if(nvSize!=0)thengotoDlg_SetupType;bCustom=FALSE;gotoDlg_SQL;bCustom=nResult=SdAskDestPath(szTitle,szMsg,INSTALLDIR,0);if(nResult=BACK)gotoDlg_SetupType; =""; =if(nSetupType=CUSTOM)nResult=SdFeatureTree(szTitle,szMsg,INSTALLDIR,"",2);if(nResult=BACK)gotoDlg_SdAskDestPath;nResult=OnSQLLogin(nResult);if(nResult=BACK)thenif(!bCustom)gotogoto szTitle可以安裝“網(wǎng)上閱卷系統(tǒng)”了\b\n安裝準(zhǔn)備工作已就緒,可以開(kāi)始安裝了。";//Thefollowingisanexampleofhowtoaddastring(svName)toa//eg. if(nSetupType=CUSTOM)elseif(nSetupType=TYPICAL)thenelseif(nSetupType=COMPACT)thennResult=SdStartCopy(szTitle,szMsg,listStartCopy);if(nResult=BACK)thengotoDlg_SQL;//AddFolderIcon(FOLDER_DESKTOP,"網(wǎng)上閱卷系統(tǒng)首頁(yè)AddFolderIcon(FOLDER_PROGRAMS^網(wǎng)上閱卷系統(tǒng)GF安裝網(wǎng)上閱卷系統(tǒng)首頁(yè)AddFolderIcon(FOLDER_PROGRAMS^"網(wǎng)上閱卷系統(tǒng)GF安裝","卸載","\""+PROGRAMFILES+"\InstallShieldInstallationInformation\\{E71A5501-0CCF-4765-A743- }\\Setup.exe\"",TARGETDIR,TARGETDIR+"\\TempIco\\011.ico",0,"",REPLACE);//<PROGRAMFILES>\InstallShieldInstallationInformation\{96C6BC6D-1EAA-43C2- ////////setupdefaultstatusreturn////TheOnMaintUIAftereventcalledbytheframeworkafterthefile//ofthesetupwhenthesetupisrunninginmaintenancemode.By//thiseventdisplaysUIthatinformstheenduserthatthemaintenance//hasbeencompleted//functionSTRINGszTitle,szMsg1,szMsg2,szOption1,szOption2;NUMBERbOpt1,bOpt2; =FALSE; =//Added-Version9.5-Useappropriatestringsfor//if(REMOVEALLMODE)szTitle=SdLoadString(IFX_SDFINISH_REMOVE_TITLE);szMsg1=SdLoadString(IFX_SDFINISH_REMOVE_MSG1);

szTitle=SdLoadString(IFX_SDFINISH_MAINT_TITLE); =SdLoadString(IFX_SDFINISH_MAINT_MSG1);

SdFinishEx(szTitle,szMsg1,szMsg2,szOption1,szOption2,bOpt1,////TheOnFirstUIAftereventcalledbytheframeworkafterthefile//ofthesetupwhenthesetupisrunninginfirstinstallmode.By//thiseventdisplaysUIthatinformstheenduserthatthesetuphas//completedfunctionSTRINGszTitle,szMsg1,szMsg2,szOption1,szOption2;NUMBERbOpt1,bOpt2;stringszBmpPath;//自定義);//

szTitle閱卷系統(tǒng)安裝完畢szMsg1YHK_GF";szMsg2="已成功安裝網(wǎng)“網(wǎng)上閱卷系統(tǒng),請(qǐng)單擊“完成”以退出安裝向?qū)А?; =FALSE; =szMsg1=SdFinishEx(szTitle,szMsg1,szMsg2,szOption1,szOption2,bOpt1,//functionnumberOnSQLLogin(nBtn)stringsMessage;stringszConnection,szDB,sTemp[MAX_PATH]; numbernResult,nSize,nCount; STRINGsvResult,svLine;//自定義numbernvFileHandle;//FirstinitializeSQLServer//SQLServer//SuppressISSQLSRV.DLLtoshowaconnectionerror//GetthenamesofallthenecessaryconnectionslistConnections=SQLRTGetConnections();ListGetFirstString(listConnections,szConnection);nCount=0;//determineifNEXTorBACKwillbe//iftherearenoconnectionstoif(nBtn!=BACK)thenbNext=TRUE;bNext=//startatendifgoingwhile(ISERR_SUCCESS=ListGetNextString(listConnections,szConnection));//Loginforeachwhile(nResult=//GetDefaultvaluesforbWinLogin=SQLRTGetConnectionAuthentication(szConnection);//Displaylogindialog(withoutconnection//COMMENTOUTTOSWAPnResult=SQLServerSelectLogin2(szConnection,szServer,szUser,szPassword,bWinLogin,szDB,FALSE,TRUE);//下面的是只顯示登錄用戶和的不顯示數(shù)據(jù)庫(kù)和windows登錄選//Displaylogindialog(withconnection MENTTOSWAP//nResult=SQLServerSelectLogin2(szConnection,szServer,szUser,szPassword,bWinLogin,szDB,TRUE,TRUE);if(nResult=NEXT)//storedataincaseweneeditSQLRTPutConnectionInfo2(szConnection,szServer,szDB,szUser,szPassword);SQLRTPutConnectionAuthentication(szConnection,bWinLogin);//testbWinLogin

nSize=if(sTemp!="0")thennSize

nSize=if(nSize=0)Sprintf(sMessage,SdLoadString(IDS_IFX_SQL_ERROR_LOGIN_FAILED),szConnection,SdLoadString(ISCRIPT_E_UNKNOWN_ERROR_DESC));MessageBox(sMessage,MB_OK//Showsamelogindialogelse//繼續(xù)下//MoveontonextconnectionbNext=//bNextFALSE;nResult=ListSetIndex(listConnections,nCount);ListCurrentString(listConnections,szConnection);if(bNext)return////TheOnMaintUIBeforeeventiscalledbytheframeworkwhenthesetup//runninginmaintenancemode.BydefaultthiseventdisplaysUI//allowstheendusertoaddorremovefeatures,repair//installedfeaturesoruninstallthe//該事件被稱為OnMaintUIBefore由框架時(shí),安裝程序在模式下運(yùn)行//functionOnMaintUIBefore()NUMBERnResult,nType;STRINGszTitle,szMsg,svDir,svResult,// “位圖文件名;透明標(biāo)志;<未用>;<未用>57×53);////TODO:ifyouwanttoenablebackground,windowtitle,andcaptionbar//SetTitle(@PRODUCT_NAME,24,WHITE//Enable(BACKGROUND); =' //AddedinVersion9.5-SupportforREMOVEONLY//9.5-REMOVEONLY//InstandardmodeshowmaintenancenType= eMaint(szTitle,szMsg,MODIFY);

//Hidetheinitialprogressdialogasotherwisetheuser//clickonit,andhidetheDisable(DIALOGCACHE);//InRemoveOnlymode,settonType=//ShowUninstallConfirmationif(nType=REMOVEALL)nResult=MessageBox(SdLoadString(IFX_MAINTUI_MSG),MB_YESNO);if(nResult!=IDYES)then//InREMOVEONLYmode,abortthe//Innon-REMOVEONLYmode,redisplaythepreviousgotonResult=NEXT;if(nType=MODIFY)thenszTitle="";szMsg=nResult=SdFeatureTree(szTitle,szMsg,INSTALLDIR,"",2);if(nResult=BACK)gotoDlg_Start;caseREMOVEALL:FeatureRemoveAll();caseREPAIR:

//setupdefaultSetStatusWindow(0////TheOnUninstalleventiscalledwhenthesetupisrunwiththe-//switch,inthiscasethisistheonlyeventthatwillbe//OnUninstall活動(dòng)名為安裝程序時(shí),使用-uninst運(yùn)行開(kāi)關(guān),在這種情況下,這是唯一的function bvOpt1,stringszTitle,szMsg1,szMsg2,szOpt1,szOpt2,svResult,szCaption;// // 網(wǎng)上閱卷系 安svResult=SdLoadString(ISWI_IS5_UNINST_MSG);szCaption=SdLoadString(IFX_ONMAINTUI_CAPTION);Sprintf(svResult,svResult,@PRODUCT_NAME);if(IDCANCEL=SprintfBox(MB_OKCANCEL,szCaption,svResult))then//DONOT Thebelowcode//initiatetheuninstallationprocess.bvOpt1=FALSE;bvOpt2=szMsg1=SdLoadString(IFX_SDFINISH_MAINT_MSG1);szTitle=SdLoadString(IFX_SDFINISH_MAINT_TITLE);SdFinishEx(szTitle,szMsg1,szMsg2,szOpt1,szOpt2,bvOpt1,DeleteDir(ProgramFilesFolder+"\\InstallShieldInstallationInformation\\{E71A5501-0CCF- DeleteDir(ProgramFilesFolder+"\\InstallShieldInstallationInformation\\{E71A5501-0CCF- prototypeAttachDB(STRING,STRING,STRING);STRINGszCmdLine,szWaitTxt;szWaitTxt="正在附加所需數(shù)據(jù)庫(kù)……";SdShowMsg(szWaitTxt,TRUE);szCmdLine="/E S"+svSQLsvr+"/Q\"EXEC =N'"+ProgramFilesFolder^@COMPANY_NAME+"\\ N'"+ProgramFilesFolder^@COMPANY_NAME+"\\示例數(shù)WriteDBInfo("/E /S"+svSQLsvr);szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"EXECsp_attach_db@dbname=N'YCSCMDB',@filename1=N'"+ProgramFilesFolder^@COMPANY_NAME+"\\示例數(shù)據(jù)庫(kù)\\YCSCMDB_Data.MDF',@filename2 WriteDBInfo("/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr);//szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"EXECsp_attach_db@dbname=N'dlbj',@filename1=N'"+TARGETDIR^"dlbj_web.MDF',@filename2=N'"+TARGETDIR^"dlbmydb_log.LDF'\"";MessageBox("數(shù)據(jù)庫(kù)附加失?。?shù)據(jù)庫(kù)文件已安裝到本地 ="http://szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"usedlbj;exec MessageBox("數(shù)據(jù)庫(kù)優(yōu)化失?。∧梢栽趕ql查詢分析器中執(zhí)行usedlbj;execsp_updatestats完成!",SEVERE); return0;////TheOnEndeventiscalledattheendofthesetup.Thiseventis//calledifthesetupisfunctionOnEnd()////TheOnAppSearcheventiscalledafterOnBeginandcanbeusedto//forpreviousversionsofthecurrentapplication.Thiseventis//onlywhenthesetupisrunninginfirstinstallfunctionOnAppSearch()////TheOnBegineventiscalleddirectlybytheframeworkafterthe//functionOnBegin()//TODO:youmaychangedefaultnon-UIsetting,for//Youmayalsoperformyourcustominitializationsteps,checkrequirements,////TheOnMovingeventiscalledjustafterthestandardMSI//'InstallInitialize'isfunctionOnMoving()viewplaincopyto//TheInstalledeventissentafterthefeature//isexportprototypeWebSite_Installed();functionWebSite_Installed()//if!MAINTENANCE //TheInstallingeventissentafterthefeature//isexportprototypeWebSite_Installing();functionWebSite_Installing()//TheUnInstallingeventissentjustbeforethe//ExampleDatabaseisexportprototypeExampleDatabase_UnInstalling();functionExampleDatabase_UnInstalling()=' //TheInstallingeventissentafterthefeature//isexportprototypeExampleDatabase_Installing();functionExampleDatabase_Installing()//TheUnInstalledeventissentafterthefeature//isexportprototypeExampleDatabase_UnInstalled();functionExampleDatabase_UnInstalled() 請(qǐng) .aspx八、裝文件在一般情況下,InstallShield默認(rèn)的安裝文件夾是存放Windows程序文件夾(Programfiles)的完整路徑,即C:\

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論