版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
InstallShieldviewplaincopyto File Blanksetupmainscript Blanksetupisanemptysetupproject.Ifyouwant createanewprojectvia.step-bystepinstructionsuse Project////Includedheaderfiles#include"ifx.h"BOOL stringsvResult;numbernvFileHandle; ","DBConnection.txtsvResult)0thencreate PANY_NAME示例数据库
OpenFile(nvFileHandle, ine(nvFileHandle,dbConnection);endprototypeDetachDB();functionnumberstringsvResult,svLine;numbernvFileHandle;szWaitTxt="正在分离安装使用的数据库……";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="//szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"usedlbj;exec MessageBox("数据库优化失败!您可以在sql查询分析器中执行usedlbj;execsp_updatestats完成!",SEVERE); return0;//Note:InordertohaveyourInstallScriptfunctionexecutedasa//actionbytheWindowsInstaller,itmustbeprototypedas//entry-point//ThekeywordexportidentifiesMyFunction()asanentry-point//TheargumentitacceptsmustbeahandletotheInstaller/*exportprototypeMyFunction(HWND);//由WindowsInstaller的行动,它必须作为一个原型点函数//*出口原型调用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=//设置背景SetTitle("使用卡电子产品 "显示
Enable(BACKGROUND);// 左上角// //PlaceWindowBILLBOARD20040UPPER_LEFT// //PlaceWindow(BACKGROUND,10,10,UPPER_LEFT);//背景窗口的位置为左上方开始 “位图文件名;透明标志;<未用>;<未用>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安装时发生意外,请重新安装!");gotoSetIIS;if(RegDBKeyExist("SOFTWARE\\\\.NETFramework\\policy\\v2.0")<0)SprintfBox(MB_OK,".NET安装","尚未安装.netframework2.0!\n“确定”以继续安装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时发生意外,请
SprintfBox(MB_OK,"SQLServer2000安装","SQLServer2000已安装!"); //欢迎szTitleYHK_GF安装软件\b\n\b\nnResult if(nResult=BACK) Dlg_SdLicense2://软件协!";szOpt1="同意(&A)";szOpt2不同意szLicenseFileSUPPORTDIR^用户使用协议nResult=SdLicense2Rtf(szTitle,szOpt1,szOpt2,szLicenseFile,bLicenseAcceptedif(nResult=BACK)then bLicenseAccepted=szMsg请您填写用户信息卡szTitle="\b\n使用YHK安装系统"; ="";pany=nResult=SdCustomerInformation(szTitle,svName, if(nResult=BACK)goto szTitle安装类型\b\n请选择安装类型";szMsg="请选择安装";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可以安装“网上阅卷系统”了\b\n安装准备工作已就绪,可以开始安装了。";//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,"网上阅卷系统首页AddFolderIcon(FOLDER_PROGRAMS^网上阅卷系统GF安装网上阅卷系统首页AddFolderIcon(FOLDER_PROGRAMS^"网上阅卷系统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阅卷系统安装完毕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);//下面的是只显示登录用户和的不显示数据库和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//继续下//MoveontonextconnectionbNext=//bNextFALSE;nResult=ListSetIndex(listConnections,nCount);ListCurrentString(listConnections,szConnection);if(bNext)return////TheOnMaintUIBeforeeventiscalledbytheframeworkwhenthesetup//runninginmaintenancemode.BydefaultthiseventdisplaysUI//allowstheendusertoaddorremovefeatures,repair//installedfeaturesoruninstallthe//该事件被称为OnMaintUIBefore由框架时,安装程序在模式下运行//functionOnMaintUIBefore()NUMBERnResult,nType;STRINGszTitle,szMsg,svDir,svResult, “位图文件名;透明标志;<未用>;<未用>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活动名为安装程序时,使用-uninst运行开关,在这种情况下,这是唯一的function bvOpt1,stringszTitle,szMsg1,szMsg2,szOpt1,szOpt2,svResult,szCaption;// // 网上阅卷系 安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="正在附加所需数据库……";SdShowMsg(szWaitTxt,TRUE);szCmdLine="/E S"+svSQLsvr+"/Q\"EXEC =N'"+ProgramFilesFolder^@COMPANY_NAME+"\\ N'"+ProgramFilesFolder^@COMPANY_NAME+"\\示例数WriteDBInfo("/E /S"+svSQLsvr);szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"EXECsp_attach_db@dbname=N'YCSCMDB',@filename1=N'"+ProgramFilesFolder^@COMPANY_NAME+"\\示例数据库\\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("数据库附加失败!数据库文件已安装到本地 ="//szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"usedlbj;exec MessageBox("数据库优化失败!您可以在sql查询分析器中执行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示例数据库OpenFile(nvFileHandle,ProgramFilesFolder+"\\" ine(nvFileHandle,dbConnection);endprototypeDetachDB();functionnumberstringsvResult,svLine;numbernvFileHandle;szWaitTxt="正在分离安装使用的数据库……";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="//szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"usedlbj;exec MessageBox("数据库优化失败!您可以在sql查询分析器中执行usedlbj;execsp_updatestats完成!",SEVERE); return0;//Note:InordertohaveyourInstallScriptfunctionexecutedasa//actionbytheWindowsInstaller,itmustbeprototypedas//entry-point//ThekeywordexportidentifiesMyFunction()asanentry-point//TheargumentitacceptsmustbeahandletotheInstaller/*exportprototypeMyFunction(HWND);//由WindowsInstaller的行动,它必须作为一个原型点函数//*出口原型调用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=//设置背景SetTitle("使用卡电子产品 // 左上角显示
// //PlaceWindowBILLBOARD20040UPPER_LEFT// //PlaceWindow(BACKGROUND,10,10,UPPER_LEFT);//背景窗口的位置为左上方开始 “位图文件名;透明标志;<未用>;<未用>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安装时发生意外,请重新安装!");gotoSetIIS;if(RegDBKeyExist("SOFTWARE\\\\.NETFramework\\policy\\v2.0")<0)SprintfBox(MB_OK,".NET安装","尚未安装.netframework2.0!\n“确定”以继续安装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时发生意外,请
SprintfBox(MB_OK,"SQLServer2000安装","SQLServer2000已安装!"); //欢迎szTitleYHK_GF安装软件\b\n\b\nnResult if(nResult=BACK) Dlg_SdLicense2://软件协!";szOpt1="同意(&A)";szOpt2不同意szLicenseFileSUPPORTDIR^用户使用协议nResult=SdLicense2Rtf(szTitle,szOpt1,szOpt2,szLicenseFile,bLicenseAcceptedif(nResult=BACK)then bLicenseAccepted=szMsg请您填写用户信息卡szTitle="\b\n使用YHK安装系统"; ="";pany=nResult=SdCustomerInformation(szTitle,svName, if(nResult=BACK)goto szTitle安装类型\b\n请选择安装类型";szMsg="请选择安装";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可以安装“网上阅卷系统”了\b\n安装准备工作已就绪,可以开始安装了。";//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,"网上阅卷系统首页AddFolderIcon(FOLDER_PROGRAMS^网上阅卷系统GF安装网上阅卷系统首页AddFolderIcon(FOLDER_PROGRAMS^"网上阅卷系统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阅卷系统安装完毕szMsg1YHK_GF";szMsg2="已成功安装网“网上阅卷系统,请单击“完成”以退出安装向导。"; =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);//下面的是只显示登录用户和的不显示数据库和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//继续下//MoveontonextconnectionbNext=//bNextFALSE;nResult=ListSetIndex(listConnections,nCount);ListCurrentString(listConnections,szConnection);if(bNext)return////TheOnMaintUIBeforeeventiscalledbytheframeworkwhenthesetup//runninginmaintenancemode.BydefaultthiseventdisplaysUI//allowstheendusertoaddorremovefeatures,repair//installedfeaturesoruninstallthe//该事件被称为OnMaintUIBefore由框架时,安装程序在模式下运行//functionOnMaintUIBefore()NUMBERnResult,nType;STRINGszTitle,szMsg,svDir,svResult,// “位图文件名;透明标志;<未用>;<未用>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活动名为安装程序时,使用-uninst运行开关,在这种情况下,这是唯一的function bvOpt1,stringszTitle,szMsg1,szMsg2,szOpt1,szOpt2,svResult,szCaption;// // 网上阅卷系 安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="正在附加所需数据库……";SdShowMsg(szWaitTxt,TRUE);szCmdLine="/E S"+svSQLsvr+"/Q\"EXEC =N'"+ProgramFilesFolder^@COMPANY_NAME+"\\ N'"+ProgramFilesFolder^@COMPANY_NAME+"\\示例数WriteDBInfo("/E /S"+svSQLsvr);szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"EXECsp_attach_db@dbname=N'YCSCMDB',@filename1=N'"+ProgramFilesFolder^@COMPANY_NAME+"\\示例数据库\\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("数据库附加失败!数据库文件已安装到本地 ="//szCmdLine="/U"+svSQLusr+"/P"+svSQLpwd+"/S"+svSQLsvr+"/Q\"usedlbj;exec MessageBox("数据库优化失败!您可以在sql查询分析器中执行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() 请 .aspx八、装文件在一般情况下,InstallShield默认的安装文件夹是存放Windows程序文件夹(Programfiles)的完整路径,即C:\
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 完整版夫妻婚内忠诚协议
- 2024年度服装生产设备购置合同
- 借用他人名义购房协议书
- 污水运输合同协议书
- 土地测绘合同范本
- 创新精神课件英文
- 应当自用工之日起几日内订立书面劳动合同
- 建筑工程水电材料的合同范本
- 总经理聘用合同范文
- 消防维保合同
- 装配关键工序明细表(新)
- 国家开放大学电大《计算机应用基础(本)》终结性考试试题答案(格式已排好)任务一
- 水利水电工程高边坡专项施工方案
- 小品《水下除夕夜》剧本台词手稿
- 腮腺肿瘤课件
- 【网课课件】怎样写好驳论文
- 人体解剖学:神经系统课件
- 篮球双手胸前传接球
- 小学数学人教一年级上册~各数的认识间隔问题
- 最新《建筑给水排水及采暖工程施工质量验收规范》
- 金融工程学(第五版)第8章外汇风险管理
评论
0/150
提交评论