////////////////////////////////////////////////////////////////////////////////
//
// File Name: Setup.rul
//
// Description: InstallShield script
//
// Comments: This script was generated based on the selections you made in
// the Project Wizard. Refer to the help topic entitled "Modify
// the script that the Project Wizard generates" for information
// on possible next steps.
//
////////////////////////////////////////////////////////////////////////////////
// Include header files
#include "ifx.h"
////////////////////// string defines ////////////////////////////
//////////////////// installation declarations ///////////////////
// ----- DLL function prototypes -----
// your DLL function prototypes
// ---- script function prototypes -----
// your script function prototypes
// your global variables
// prototype CreateWebSite(STRING,STRING); // 创建 IIS 站点
prototype CreateVirtualDir(STRING); // 创建虚拟目录
prototype CheckIIS();//监测系统是否安装了IIS
//////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: OnFirstUIBefore
//
// EVENT: FirstUIBefore event is sent when installation is run for the first
// time on given machine. In the handler installation usually displays
// UI allowing end user to specify installation parameters. After this
// function returns, ComponentTransferData is called to perform file
// transfer.
//
///////////////////////////////////////////////////////////////////////////////
function OnFirstUIBefore()
number nResult,nSetupType;
string szTitle, szMsg;
string szLicenseFile, szQuestion;
string szName, szCompany, szSerial;
string szTargetPath;
string szDir;
string szComponents, szTargetdir;
string szServerIP,szServerPort,szServerIPDefault,szServerPortDefault;
number nLevel;
LIST listStartCopy;
number nvSize;
string szTitlemain;
begin
// TO DO: if you want to enable background, window title, and caption bar title
// SetTitle( @TITLE_MAIN, 24, WHITE );
// SetTitle( @TITLE_CAPTIONBAR, 0, BACKGROUNDCAPTION );
// Enable( FULLWINDOWMODE );
// Enable( BACKGROUND );
// SetColor(BACKGROUND,RGB (0, 128, 128));
nSetupType = TYPICAL;
TARGETDIR = PROGRAMFILES ^"Tichn" ^"tjjdemo";
szDir = TARGETDIR;
szName = "";
szCompany = "";
szSerial = "";
szTitlemain="统计信息动态发布平台(演示版)";
Dlg_Start:
// beginning of dialogs label
Dlg_SdWelcome:
szTitle = szTitlemain;
szMsg = "";
nResult = SdWelcome( szTitle, szMsg );
if (nResult = BACK) goto Dlg_Start;
Dlg_SdLicense:
szLicenseFile = SUPPORTDIR ^ "license.txt";
szTitle = "";
szMsg = "";
szQuestion = "";
nResult = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile );
if (nResult = BACK) goto Dlg_SdWelcome;
Dlg_SdRegisterUserEx:
szMsg = "";
szTitle = "";
nResult = SdRegisterUserEx( szTitle, szMsg, szName, szCompany, szSerial );
if (nResult = BACK) goto Dlg_SdLicense;
if (szSerial!="demo") then
goto Dlg_SdRegisterUserEx;
endif;
Dlg_SdAskDestPath:
szTitle = "";
szMsg = "";
nResult = SdAskDestPath( szTitle, szMsg, szDir, 0 );
TARGETDIR = szDir;
if (nResult = BACK) goto Dlg_SdRegisterUserEx;
Dlg_SetupType:
szTitle = "";
szMsg = "";
nResult = SetupType ( szTitle , szMsg , "" , nSetupType , 0 );
if (nResult = BACK) then
goto Dlg_SdAskDestPath;
else
nSetupType = nResult;
if (nSetupType != CUSTOM) then
szTargetPath = TARGETDIR;
nvSize = 0;
ComponentCompareSizeRequired(MEDIA,szTargetPath,nvSize);
if (nvSize != 0) then
MessageBox( szSdStr_NotEnoughSpace, WARNING );
goto Dlg_SetupType;
endif;
endif;
endif;
Dlg_SdComponentTree:
if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType;
szTitle = "";
szMsg = "";
szTargetdir = TARGETDIR;
szComponents = "";
nLevel = 2;
if (nSetupType = CUSTOM) then
nResult = SdComponentTree(szTitle, szMsg, szTargetdir, szComponents, nLevel);
if (nResult = BACK) goto Dlg_SetupType;
endif;
---------------------------------------------------------------
Dlg_ObjDialogs:
nResult = ShowObjWizardPages(nResult);
if (nResult = BACK) goto Dlg_SdComponentTree;
/* Dlg_AskText://设置数据库服务器 对话框
szTitle = "设置IIS信息服务及数据库服务器";
szMsg = "现在开始设置IIS系统";
szQuestion=" 请输入本服务器的主机名或IP地址,安装程序将按照您提供的资料设置IIS信息服务。如果您没有填写,安装程序将自动跳过站点的创建!";
szServerIP="地址:";
szServerPort="端口:";
szServerIPDefault="192.168.0.1";
szServerPortDefault="80";
SetDialogTitle(DLG_ASK_TEXT,szTitle);
nResult=SdShowDlgEdit2 (szTitle, szQuestion,szServerIP,szServerPort,szServerIPDefault,szServerPortDefault);
if (nResult = BACK) goto Dlg_ObjDialogs; */
Dlg_SdStartCopy:
szTitle = "";
szMsg = "";
listStartCopy = ListCreate( STRINGLIST );
//The following is an example of how to add a string(szName) to a list(listStartCopy).
//eg. ListAddString(listStartCopy,szName,AFTER);
ListAddString(listStartCopy,"用户名:"+szName,AFTER);
ListAddString(listStartCopy,"公司名称:"+szCompany,AFTER);
ListAddString(listStartCopy,"序列号:"+szSerial,AFTER);
ListAddString(listStartCopy,"目标目录:"+szDir,AFTER);
ListAddString(listStartCopy,"请确认您填写的信息,按下一步开始复制文件",AFTER);
nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
ListDestroy(listStartCopy);
if (nResult = BACK) goto Dlg_ObjDialogs;
// setup default status
SetStatusWindow(0, "");
Enable(STATUSEX);
StatusUpdate(ON, 100);
return 0;
end;
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: OnMoving
//
// EVENT: Moving event is sent when file transfer is started as a result of
// ComponentTransferData call, before any file transfer operations
// are performed.
//
///////////////////////////////////////////////////////////////////////////////
function OnMoving()
string szAppPath;
begin
// Set LOGO Compliance Application Path
// TO DO : if your application .exe is in a subfolder of TARGETDIR then add subfolder
szAppPath = TARGETDIR;
RegDBSetItem(REGDB_APPPATH, szAppPath);
RegDBSetItem(REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY);
end;
//////////////////////////////////////////////////////////////////////////////
// 可以通过检测以下两个注册表值来检查是否安装了IIS
//HKEY_LOCAL_MACHINE\System\CurrentControl