欢迎光临
我们一直在努力

看人家用使用InstallShield制作ASP安装程序 (续)

建站超值云服务器,限时71元/月

下面是建立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;

///////////////////////////////////////////////////////////////////////////////
//

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 看人家用使用InstallShield制作ASP安装程序 (续)
分享到: 更多 (0)