欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-06-22 11:34:47
////////////////////////////////////////////////////////////////////////////////// // iiiiiii sssss...
////////////////////////////////////////////////////////////////////////////////
//
// 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.
//
//
// file name: setup.rul
//
// description: installshield script
//
// comments: this template script performs a basic setup. with minor
// modifications, this template can be adapted to create
// new, customized setups.
//
////////////////////////////////////////////////////////////////////////////////


// include header files

#include "ifx.h" //do not remove

////////////////////// string defines ////////////////////////////

//////////////////// installation declarations ///////////////////

// ----- dll function prototypes -----


// your dll function prototypes


// ---- script function prototypes -----


// 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 svname, svcompany, svserial;
string szdir;
string szfolder;
string szcomponents, sztargetdir;
number nlevel;

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 = "c:\inetpub\wwwroot\webapp";
szdir = targetdir;
shell_object_folder = @folder_name;
svname = "daniel";
svcompany = "n/a";
svserial = "111-1111111";

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_sdregisteruserex:
szmsg = "";
sztitle = "\";
nresult = sdregisteruserex( sztitle, szmsg, svname, svcompany, svserial );
//验证序列号
if (svserial !="111-1111111") then
messagebox ("invalid serial!",warning);
goto dlg_sdregisteruserex;
endif;
if (nresult = back) goto dlg_sdlicense;

dlg_sdaskdestpath:
sztitle = "\";
szmsg = "";
nresult = sdaskdestpath( sztitle, szmsg, szdir, 0 );
targetdir = szdir;
if (nresult = back) goto dlg_sdregisteruserex;

dlg_sdcomponenttree:
if ((nresult = back) && (nsetuptype != custom)) goto dlg_sdaskdestpath;
sztitle = "\";
szmsg = "";
sztargetdir = targetdir;
szcomponents = "";
nlevel = 2;
if (nsetuptype = custom) then
nresult = sdcomponenttree(sztitle, szmsg, sztargetdir, szcomponents, nlevel);
if (nresult = back) goto dlg_sdaskdestpath;
endif;

dlg_sdselectfolder:
szfolder = shell_object_folder;
sztitle = "\";
szmsg = "";
nresult = sdselectfolder( sztitle, szmsg, szfolder );
shell_object_folder = szfolder;
if (nresult = back) goto dlg_sdcomponenttree;


// setup default status
setstatuswindow(0, "");
enable(statusex);
statusupdate(on, 100);

return 0;

end;