Using InstallShield to make ASP installers (3)

Source: Internet
Author: User
Tags goto odbc
The following are examples of creating Web files and settings that require a VBS file (with virtual directory settings but no permissions settings).

////////////////////////////////////////////////////////////////////////////////
//
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.
//
//
FileName: Setup.rul
//
Description: InstallShield Script
//
Note: This template script performs a basic setup. With minor
Modifications, this template can is adapted to create
New, customized setups.
//
////////////////////////////////////////////////////////////////////////////////


Included header files

#include "ifx.h"//cannot be moved

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;



//////////////////////////////////////////////////////////////////////////////
//
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;
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 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));




Nsetuptype = typical;
TARGETDIR = "d:\\" ^ "cyclone2000\\";
Szdir = TARGETDIR;
Shell_object_folder = @FOLDER_NAME;
Svname = "";
Svcompany = "";
Svserial = "";

Dlg_start:
Beginning of Dialogs label

Dlg_sdwelcome://Welcome dialog box
SzTitle = "";
szmsg = "";
Nresult = SdWelcome (SzTitle, szmsg);
if (nresult = back) goto Dlg_start;

dlg_sdlicense://Software License Agreement dialog box
Szlicensefile = supportdir ^ "License.txt";
SzTitle = "";
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 = "";
szmsg = "";
Nresult = Sdshowinfolist (szTitle, szmsg, list);
Listdestroy (list);
if (nresult = back) goto dlg_sdlicense;

dlg_sdregisteruserex://User Information dialog box
szmsg = "";
SzTitle = "";
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 = "";
szmsg = "";
Nresult = Sdaskdestpath (SzTitle, szmsg, szdir, 0);
TARGETDIR = Szdir;
if (nresult = back) goto Dlg_sdregisteruserex;

Dlg_setuptype://Installation Type dialog box
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://dialog box
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://dialog box
Szfolder = Shell_object_folder;
SzTitle = "";
szmsg = "";
Nresult = Sdselectfolder (SzTitle, szmsg, Szfolder);
Shell_object_folder = Szfolder;
if (nresult = back) goto Dlg_sdcomponenttree;

Dlg_asktext://Set Database Server dialog box
SzTitle = "Set up Database Server";
szmsg = "";
szquestion= "Please enter the hostname or IP address of SQL Server (Cyclone 2000) database Server";
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://Start Copying Files dialog box
SzTitle = "";
szmsg = "";
Liststartcopy = Listcreate (stringlist);
The following is a 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
//////////////////////////////////////////////////////////////////////////////
//
Function: Onfirstuiafter
//
Event: Firstuiafter event is sent after file transfer, when installation
is run for the "the" "the" given machine. In this event handler
Installation usually displays UI that would inform end user
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 ("Cannot establish a Web virtual directory.", SEVERE);
endif
Set_vod_liveaddress ();
szCmdLine = supportdir ^ "Odbc.reg";
if (launchappandwait ("Regedit.exe", szcmdline,wait) < 0) Then
MessageBox ("Cannot configure ODBC.", SEVERE);
endif
Disable (Statusex);
BOPT1 = FALSE;
BOpt2 = FALSE;
SZMSG1 = sdloadstring (IFX_SDFINISH_MSG1);
SZMSG2 = "Please browse the cyclone2000 virtual directory on this host Web server: \ n http://Localhost/cyclone2000/default.htm";
SzOption1 = "";
SzOption2 = "";
SzTitle = "Cyclone 2000 installation Complete";
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 ("Cannot open browser.", SEVERE);
endif

return 0;
End

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




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.