Installshield| Program | Package #include "ifx.h"//cannot be moved
//////////////////////////////////////////////////////////////////////////////
Packaging and automatic installation of ASP software with InstallShield
Original Author: Jia Jun (Jaron)
URL: http://www.jiangdu.net
Mail: jaron@jdinfo.net
First published in NetEase, Chinaasp,asphouse
//////////////////////////////////////////////////////////////////////////////
Function:
1. File copy
2. Optional automatic set up Independent site run (set up IIS)
3. Optional Automatic Setup virtual site run (set up IIS)
4. Set directory readable, writable and run scripts
5. Automatically create ODBC
6. Automatically create or attach an MDF-formatted SQL database and optimize
7. Automatically install Scriptencode decoder program
This article lists only the Script parts of InstallShield, as well as two VBS files and other settings
Any questions during the test, please come to Http://www.jiangdu.net/bbs programming Space Edition Discussion
//////////////////////////////////////////////////////////////////////////////
Prototype CreateDatabase (string,string,string);
Prototype Createwebsite (string,string); Create an IIS site
Prototype Createvirtualdir (STRING); Create a virtual directory
//////////////////////////////////////////////////////////////////////////////
//
Function: Onfirstuibefore
//
Event: Firstuibefore event is sent when installation was run for the
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,nopt,svedit1,svedit2;
STRING SzTitle, Szmsg,szbmppath;
STRING Szlicensefile, szquestion;
STRING Szserverip,szserverport,szserveripdefault,szserverportdefault;
STRING szsqlsvr,szsqlusr,szsqlpwd,svsqlsvr,svsqlusr,svsqlpwd;
STRING svname, Svcompany, svserial;
STRING Szfile,sztargetpath,szdir,szfolder;
STRING szcomponents, Sztargetdir;
STRING szfield1,szfield2;
STRING Szdefault,svresult;
OBJECT Piisobj;
LIST list,liststartcopy;
Number nlevel,nvsize;
Begin
Szbmppath= "C:" ^ "temp" ^ "left.bmp";
Dialogsetinfo (Dlg_info_altimage, Szbmppath, TRUE); Set the picture on the left
To do:if your want to enable background, window title, and caption bar title
Settitle (@TITLE_MAIN, white);
Settitle (@TITLE_CAPTIONBAR, 0, backgroundcaption);
Enable (Fullwindowmode);
Enable (BACKGROUND);
SetColor (Background,rgb (0, 128, 128));
Default Value setting
TARGETDIR = "C:" ^ "inetpub" ^ "Jaronsoft" ^ @FOLDER_NAME;
Szdir = TARGETDIR;
Shell_object_folder = @FOLDER_NAME;
svname = "Beta user";
Svcompany = "Jdinfo network";
svserial = "111-1111111";
Dlg_start:
Beginning of Dialogs label
Dlg_sdwelcome://Welcome dialog box
SzTitle = "Welcome to enter";
szmsg = "";
Nresult = SdWelcome (SzTitle, szmsg);
if (nresult = back) goto Dlg_start;
dlg_sdlicense://Software License Agreement dialog box
Szlicensefile = supportdir ^ "License.txt";
SzTitle = "License Agreement";
szmsg = "";
Szquestion = "";
Nresult = SdLicense (SzTitle, szmsg, Szquestion, szlicensefile);
if (nresult = back) goto dlg_sdwelcome;
Dlg_sdshowinfolist://readme file dialog box
Szfile = supportdir ^ "Infolist.txt";
List = Listcreate (stringlist);
Listreadfromfile (list, szfile);
SzTitle = "README";
szmsg = "";
Nresult = Sdshowinfolist (szTitle, szmsg, list);
Listdestroy (list);
if (nresult = back) goto dlg_sdlicense;
dlg_sdregisteruserex://User Information dialog box
szmsg = "";
SzTitle = "User Information";
Nresult = Sdregisteruserex (SzTitle, szmsg, Svname, Svcompany, svserial);
if (nresult = back) goto dlg_sdshowinfolist;
Check serial number
if (Chk_serial (Svcompany, svserial) <0) Then
Goto Dlg_sdregisteruserex;
endif
Check Serial number complete
DLG_SDASKDESTPATH://Installation Location dialog box
SzTitle = "Check serial number";
szmsg = "";
Nresult = Sdaskdestpath (SzTitle, szmsg, szdir, 0);
TARGETDIR = Szdir;
if (nresult = back) goto Dlg_sdregisteruserex;
Dlg_setuptype://Installation Type dialog box
Nsetuptype = typical;
SzTitle = "Installation Type";
szmsg = "Please choose which way you need to install";
Nresult = SetupType (SzTitle, szmsg, "", Nsetuptype, 0);
if (nresult = back) Then
Goto Dlg_sdaskdestpath;
Else
Nsetuptype = Nresult;
if (Nsetuptype!= CUSTOM) Then
Sztargetpath = TARGETDIR;
nvsize = 0;
Componen