发布一个完全解决installshield打包ASP的代码(感谢Jaron)
//1、从光盘拷贝代码到硬盘的全新解决方案
//2、改进的数据库建立方法
//3、动态生成数据库连接文件conn.asp
//4、参考Joran的思路及方法,感谢
////////////////////////////////////////////////////////////////////////////////
//
// 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 -----
//////////////////////////////////////////////////////////////////////////////
prototype CreateDataBase(STRING,STRING,STRING,STRING);
prototype CreateWebSite(STRING,STRING); // 创建 IIS 站点
prototype CreateVirtualDir(STRING); // 创建虚拟目录
//////////////////////////////////////////////////////////////////////////////
// your script function prototypes
// your global variables
//////////////////////////////////////////////////////////////////////////////
//
// 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 szDir;
string szfolder;
//上面自带
//临时目录,临时文件,源盘,目标盘
string sztempdir;
string sztempfolder;
string szfromdisk;
LIST listDirs;
number nFlag;
NUMBER nOpt,svEdit1,svEdit2;
STRING szBmpPath;
STRING szServerIP,szServerPort,szServerIPDefault,szServerPortDefault;
STRING szSQLsvr,szSQLusr,szSQLpwd,svSQLsvr,svSQLusr,svSQLpwd,svSQLsvr1,svSQLusr1,svSQLpwd1;
STRING svName, svCompany, svSerial;
STRING szFile,szTargetPath;
STRING szComponents, szTargetdir;
STRING szField1,szField2;
STRING szDefault,svResult;
OBJECT piisObj;
LIST list,listStartCopy;
NUMBER nLevel,nvSize;
STRING szSQLForder;
//下面自带
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));
//TARGETDIR = PROGRAMFILES ^@COMPANY_NAME ^@PRODUCT_NAME;
TARGETDIR = "C:" ^ "boyunsoft" ^"EBook";
//默认安装目录
szDir = TARGETDIR;
SHELL_OBJECT_FOLDER = @FOLDER_NAME;
Dlg_Start:
// beginning of dialogs label
Dlg_SdWelcome:
szTitle = "";
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_SdAskDestPath:
szTitle = "";
szMsg = "路径中不可包含中文!!";
nResult = SdAskDestPath( szTitle, szMsg, szDir, 0 );
TARGETDIR = szDir;
if (StrFind(szDir," ")>0) then
MessageBox("博云书库的安装路径中不允许有空格,请重新设置!",INFORMATION);
goto Dlg_SdAskDestPath;
endif;
if (nResult = BACK) goto Dlg_SdLicense;
Dlg_ObjDialogs:
nResult = ShowObjWizardPages(nResult);
if (nResult = BACK) goto Dlg_SdAskDestPath;