-
您的位置:首页 → 网页设计 → ASP实例 → 使用InstallShield制作ASP安装程序3
使用InstallShield制作ASP安装程序3
时间:2004/11/7 3:00:00来源:本站整理作者:蓝点我要评论(0)
-
下面是建立WEB文件和设置的例子需VBS文件(有虚拟目录设置,但没有权限设置).
////////////////////////////////////////////////////////////////////////////////
//
// IIIIIII SSSSSS
// II SS InstallShield (R)
// II SSSSSS (c) 1996-1999, InstallShield Software Corporation
// II SS (c) 1990-1996, InstallShield Corporation
// IIIIIII SSSSSS All Rights Reserved.
//
//
// This code is generated as a starting setup template. You should
// modify it to provide all necessary steps for your setup.
//
//
// 文件名: Setup.rul
//
// 描述: InstallShield script
//
// 注释: This template script performs a basic setup. With minor
// modifications, this template can be adapted to create
// new, customized setups.
//
////////////////////////////////////////////////////////////////////////////////
// 包含的头文件
#include "ifx.h" //不能移动
////////////////////// string defines ////////////////////////////
//////////////////// installation declarations ///////////////////
// ----- DLL function prototypes -----
// your DLL function prototypes
// ---- script function prototypes -----
// your script function prototypes
prototype CHK_serial(STRING,STRING);
prototype RegODBC(STRING);
prototype set_vod_liveaddress();
// your global variables
STRING szvodservername;
STRING szliveservername;
//////////////////////////////////////////////////////////////////////////////
//
// 函数: OnFirstUIBefore
//
// 事件: 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 svName, svCompany, svSerial;
STRING szFile;
STRING szTargetPath;
STRING szDir;
STRING szfolder;
STRING szComponents, szTargetdir;
//zy
STRING szDefault,svResult;
STRING sDBSERVERNAME;
OBJECT piisObj;
//zy
NUMBER nLevel;
LIST listStartCopy;
LIST list;
NUMBER nvSize;
STRING msg;
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 = "D:\\"^"cyclone2000\\";
szDir = TARGETDIR;
SHELL_OBJECT_FOLDER = @FOLDER_NAME;
svName = "";
svCompany = "";
svSerial = "";
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_SdShowInfoList://readme文件 对话框
szFile = SUPPORTDIR ^ "infolist.txt";
list = ListCreate( STRINGLIST );
ListReadFromFile( list, szFile );
szTitle = "";
szMsg = "";
nResult = SdShowInfoList( szTitle, szMsg, list );
ListDestroy( list );
if (nResult = BACK) goto Dlg_SdLicense;
Dlg_SdRegisterUserEx://用户信息 对话框
szMsg = "";
szTitle = "";
nResult = SdRegisterUserEx( szTitle, szMsg, svName, svCompany, svSerial );
if (nResult = BACK) goto Dlg_SdShowInfoList;
//检查序列号
if (CHK_serial(svCompany, svSerial)<0) 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_SdSelectFolder://对话框
szfolder = SHELL_OBJECT_FOLDER;
szTitle = "";
szMsg = "";
nResult = SdSelectFolder( szTitle, szMsg, szfolder );
SHELL_OBJECT_FOLDER = szfolder;
if (nResult = BACK) goto Dlg_SdComponentTree;
Dlg_AskText ://设置数据库服务器 对话框
szTitle = "设置数据库服务器";
szMsg = "";
szQuestion="请输入SQL SERVER(旋风2000)数据库服务器的主机名或IP地址";
szDefault="192.168.0.1";
SetDialogTitle(DLG_ASK_TEXT,szTitle);
nResult = AskText (szQuestion, szDefault, svResult);
sDBSERVERNAME = svResult;
if (nResult = BACK) goto Dlg_SdSelectFolder;
RegODBC(sDBSERVERNAME);
Dlg_SdStartCopy://开始复制文件 对话框
szTitle = "";
szMsg = "";
listStartCopy = ListCreate( STRINGLIST );
//The following is an example of how to add a string(svName) to a list(listStartCopy).
//eg. ListAddString(listStartCopy,svName,AFTER);
nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
ListDestroy(listStartCopy);
if (nResult = BACK) goto Dlg_AskText;
// setup default status
SetStatusWindow(0, "");
Enable(STATUSEX);
StatusUpdate(ON, 100);
return 0;
end;
//////////////////////////////////////////////////////////////////////////////
//
// 函数: OnFirstUIAfter
//
// 事件: FirstUIAfter event is sent after file transfer, when installation
// is run for the first time on given machine. In this event handler
// installation usually displays UI that will inform end user that
// installation has been completed successfully.
//
///////////////////////////////////////////////////////////////////////////////
function OnFirstUIAfter()
STRING szTitle, szMsg1, szMsg2, szOption1, szOption2,szCmdLine;
NUMBER bOpt1, bOpt2;
begin
szCmdLine = SUPPORTDIR ^"mkwebdir.vbs "+"-c LocalHost -w 1 -v cyclone2000 -d "+ TARGETDIR ;
if (LaunchAppAndWait("WScript.exe", szCmdLine,WAIT) < 0) then
MessageBox ("不能建立WEB 虚拟目录.",SEVERE);
endif;
set_vod_liveaddress();
szCmdLine = SUPPORTDIR ^"odbc.reg";
if (LaunchAppAndWait("regedit.exe", szCmdLine,WAIT) < 0) then
MessageBox ("不能配置ODBC.",SEVERE);
endif;
Disable(STATUSEX);
bOpt1 = FALSE;
bOpt2 = FALSE;
szMsg1 = SdLoadString(IFX_SDFINISH_MSG1);
szMsg2 = "请浏览本主机WEB服务器上的 cyclone2000 虚拟目录\n\n 例:\n http://Localhost/cyclone2000/default.htm";
szOption1 = "";
szOption2 = "";
szTitle = "旋风2000安装完成";
SdFinishEx(szTitle,szMsg1,szMsg2,szOption1,szOption2,bOpt1,bOpt2);
szCmdLine = "http://LocalHost/cyclone2000/default.htm";
if (LaunchApp(PROGRAMFILES ^"Internet Explorer"^"IEXPLORE.EXE", szCmdLine) < 0) then
MessageBox ("不能打开浏览器.",SEVERE);
endif;
return 0;
end;
///////////////////////////////////////////////////////////////////////////////
//
相关阅读
Windows错误代码大全 Windows错误代码查询激活windows有什么用Mac QQ和Windows QQ聊天记录怎么合并 Mac QQ和Windows QQ聊天记录Windows 10自动更新怎么关闭 如何关闭Windows 10自动更新windows 10 rs4快速预览版17017下载错误问题Win10秋季创意者更新16291更新了什么 win10 16291更新内容windows10秋季创意者更新时间 windows10秋季创意者更新内容kb3150513补丁更新了什么 Windows 10补丁kb3150513是什么
-
热门文章
没有查询到任何记录。
最新文章
迅雷新手完全入门手册
asp下面javascript上传图片限制格式大小方法告诉大家网页弹出窗口应用总结ASP常见错误类型大全asp常见错误分析和解决办法
人气排行
总是弹出visual studio 实时调试器 三种解决SQLSERVER存储过程及调用详解Asp获取真实IP地址ASP中连接Mssql的几种方法一个简单好用的UBB编辑器(含代码)如何用Split将字符串转换为数组并获取数组下ASP防止表单重复提交的办法告诉你免费的简单聊天室源代码
查看所有0条评论>>