回复《谁用过InstallShield 8.0, 在线请教!!!!》没办法不能连续回复四次
征先科技 2003-08-22 02:39:23 // FUNCTION: OnMaintUIBefore
//
// EVENT: MaintUIBefore event is sent when end user runs installation that
// has already been installed on the machine. Usually this happens
// through Add/Remove Programs applet. In the handler, installation
// usually displays UI allowing end user to modify existing installation
// or uninstall application. After this function returns,
// FeatureTransferData is called to perform file transfer.
//
///////////////////////////////////////////////////////////////////////////////
function OnMaintUIBefore()
NUMBER nResult, nType;
STRING szTitle, szMsg, svDir, svResult, szCaption;
begin
// TO DO: if you want to enable background, window title, and caption bar title
// SetTitle( @PRODUCT_NAME, 24, WHITE );
// SetTitle( @PRODUCT_NAME, 0, BACKGROUNDCAPTION );
// SetColor(BACKGROUND,RGB (0, 128, 128));
// Enable( FULLWINDOWMODE );
// Enable( BACKGROUND );
Dlg_Start:
Disable(BACKBUTTON);
nType = SdWelcomeMaint(szTitle, szMsg, MODIFY);
Enable(BACKBUTTON);
if (nType = REMOVEALL) then
svResult = SdLoadString(IFX_MAINTUI_MSG);
szCaption = SdLoadString(IFX_ONMAINTUI_CAPTION);
nResult = SprintfBox(MB_OKCANCEL,szCaption,"%s",svResult);
if (nResult = IDCANCEL) goto Dlg_Start;
endif;
nResult = NEXT;
Dlg_SdFeatureTree:
if (nType = MODIFY) then
szTitle = "";
szMsg = "";
nResult = SdFeatureTree(szTitle, szMsg, INSTALLDIR, "", 2);
if (nResult = BACK) goto Dlg_Start;
endif;
switch(nType)
case REMOVEALL: FeatureRemoveAll();
case REPAIR: FeatureReinstall();
endswitch;
Enable(STATUSEX);
end;
///////////////////////////////////////////////////////////////
///////////////////////创建数据库//////////////////////////////
///////////////////////////////////////////////////////////////
function CreateDataBase(svSQLsvr,svSQLusr,svSQLpwd)
STRING szCmdLine,szWaitTxt;
begin
szWaitTxt=" 正在创建"+@PRODUCT_NAME+"所需数据库....";
SdShowMsg (szWaitTxt, TRUE);
Delay(2);
szCmdLine = "/U "+svSQLusr+" /P "+svSQLpwd+" /S "+svSQLsvr+" /Q \"exec sp_attach_db N'dawnhistest' , N'"+ INSTALLDIR ^"data\\dawnhis.mdf'\"";
if (LaunchAppAndWait("osql.exe", szCmdLine,WAIT) < 0) then
MessageBox ("数据库创建失败!请确您的系统中已安装 Microsoft SQL Server 2000.\n如仍无法解决,请联系系统供应商!",SEVERE);
else
endif;
SdShowMsg (szWaitTxt, FALSE);
szWaitTxt=" 正在优化"+@PRODUCT_NAME+"系统数据库....";
SdShowMsg (szWaitTxt, TRUE);
Delay(2);
szCmdLine = "/U "+svSQLusr+" /P "+svSQLpwd+" /S "+svSQLsvr+" /Q \"use OASystem ; exec sp_updatestats\"";
if (LaunchAppAndWait("osql.exe", szCmdLine,WAIT) < 0) then
MessageBox ("数据库优化失败!您可以在 sql查询分析器中执行 \n use OASystem ; exec sp_updatestats \n完成!",SEVERE);
endif;
SdShowMsg (szWaitTxt, FALSE);
return 0;
end;