home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Elite Hackers Toolkit
/
TheEliteHackersToolkitVolume1_1998.rar
/
HACKERS.BIN
/
appcraks
/
F_GANTT.ZIP
/
SETUP.RUL
< prev
Wrap
Text File
|
1998-01-17
|
9KB
|
274 lines
/*----------------------------------------------------------------------------*\
*
* Copyright (c) 1998 Free Field Inc.
*
* File Name: SETUP.RUL
*
* Description: Gantt/OCX Upgrade Version 1.10 (Dec. 15, 1997)
* Installation script.
*
*
* Author: Lover Boy Date: 1-17-98
*
*
\*----------------------------------------------------------------------------*/
declare
// Constant declarations.
#define SPACE_REQUIRED 100000 // Disk space in bytes.
#define APP_NAME "Gantt/OCX"
#define PROGRAM_FOLDER_NAME "GanttOCX"
#define APPBASE_PATH "Program Files\\Free Field\\GanttOCX\\"
#define COMPANY_NAME "Free Field Inc."
#define PRODUCT_NAME "GanttOCX"
#define PRODUCT_VERSION "1.1"
#define DEINSTALL_KEY "SampleDeinstKey"
#define PRODUCT_KEY "myapp.exe"
// Global variable declarations.
STRING svFolder, svDir, szMsg, szFileSet, szTitle, svUninstLogFile;
STRING svTarget[ 255 ], szProgram, szTemp[ 255 ];
BOOL bSpaceOk;
NUMBER nResult;
// Function declarations.
prototype SetupScreen();
prototype CheckRequirements();
program
StartHere:
Disable( BACKGROUND );
// Set installation info., which is required for registry entries.
InstallationInfo( COMPANY_NAME, PRODUCT_NAME, PRODUCT_VERSION, PRODUCT_KEY );
// Set up the installation screen.
SetupScreen();
Enable( DIALOGCACHE );
// Create a Welcome dialog.
WelcomeDlg:
Disable( BACKBUTTON );
Welcome( "", 0 );
Enable( BACKBUTTON );
// Test target system for proper configuration.
CheckRequirements();
// Ask user for a destination location for the installation.
GetTargetDirectory:
svTarget = TARGETDISK ^ APPBASE_PATH;
if ( AskDestPath( "", "", svTarget, 0 ) = 12 ) then
goto WelcomeDlg;
endif;
// Perform space check of target drive.
bSpaceOk = TRUE;
if (GetDiskSpace( svTarget ) < SPACE_REQUIRED) then
szMsg = "There is not enough space available on the disk\n" +
"'" + svTarget + "' \n" +
"Please free up some space or change the target location\n" +
"to a different disk";
MessageBox( szMsg, WARNING );
bSpaceOk = FALSE;
endif;
// If not enough space, ask user to try again.
if (bSpaceOk = FALSE) goto GetTargetDirectory;
SetupFilesToTransfer:
Disable( DIALOGCACHE );
szFileSet = "General";
TARGETDIR = svTarget;
// Define the file set.
FileSetBeginDefine( szFileSet );
SetStatusWindow( -1, "Copying program files..." );
CompressGet( "DATA.Z", "*.*", INCLUDE_SUBDIR );
FileSetEndDefine( szFileSet );
TransferFiles:
// Prepare InstallSHIELD to record deinstallation information.
DeinstallStart( svTarget, svUninstLogFile, DEINSTALL_KEY, 0 );
RegDBSetItem( REGDB_UNINSTALL_NAME, PRODUCT_NAME );
// Set up progress indicator and information gauge.
Disable( DIALOGCACHE );
Enable( STATUSDLG );
StatusUpdate( ON, 90 );
// Perform the file set.
SetStatusWindow( 0, "Copying program files..." );
nResult = FileSetPerformEz( szFileSet, 0 );
switch (nResult)
case FS_DONE: // Successful completion.
case FS_CREATEDIR: // Create directory error.
MessageBox( "Unable to create a directory under " + TARGETDIR + "."+
"Please check write access to this directory.", SEVERE );
exit;
default: // Group all other errors under default label.
NumToStr( szTemp, nResult );
MessageBox( "General file transfer error."+
"Please check your target location and try again."+
"\n\n Error Number:"+szTemp +
"\n Related File: "+ERRORFILENAME,
SEVERE );
exit;
endswitch;
Disable( STATUSDLG );
// Create program folders and icons.
InstallProgramItems:
SetStatusWindow( 95, "Creating Program Group and Icons...." );
AppCommand( PROGMAN, CMD_RESTORE );
svFolder = PROGRAM_FOLDER_NAME;
CreateProgramFolder( svFolder );
Delay(1);
szProgram = svTarget ^ "README\\README.WRI";
ShowProgramFolder( svFolder, SW_SHOW );
AddFolderIcon( svFolder, APP_NAME,
szProgram,
svTarget ^ "Readme",
"", 0, "", REPLACE );
AddFolderIcon( svFolder, "Sample1",
svTarget ^ "SAMPLES\\SAMPLE1\\SAMPLE1.VBP",
svTarget ^ "SAMPLES\\SAMPLE1",
"", 0, "", REPLACE );
AddFolderIcon( svFolder, "Sample2",
svTarget ^ "SAMPLES\\SAMPLE2\\SAMPLE2.VBP",
svTarget ^ "SAMPLES\\SAMPLE2",
"", 0, "", REPLACE );
AddFolderIcon( svFolder, "Sample3",
svTarget ^ "SAMPLES\\SAMPLE3\\SAMPLE3.VBP",
svTarget ^ "SAMPLES\\SAMPLE3",
"", 0, "", REPLACE );
AddFolderIcon( svFolder, "Sample4",
svTarget ^ "SAMPLES\\SAMPLE4\\SAMPLE4.VBP",
svTarget ^ "SAMPLES\\SAMPLE4",
"", 0, "", REPLACE );
AddFolderIcon( svFolder, "Sample5",
svTarget ^ "SAMPLES\\SAMPLE5\\SAMPLE5.VBP",
svTarget ^ "SAMPLES\\SAMPLE5",
"", 0, "", REPLACE );
Delay( 1 );
LaunchApp( "REGSVR32.EXE", "/s " + svTarget ^ "Ocx\\ganttocx.ocx" );
// UNINST global variable stores the file name (with full path) of
// the uninstaller file.
szProgram = UNINST;
szProgram = szProgram + " -f" + svUninstLogFile;
AddFolderIcon( svFolder, "unInstallSHIELD", szProgram,
WINDIR,
"", 0, "", REPLACE );
Delay( 1 );
// Announce setup complete and offer to read README file.
FinalInstallProcess:
SetStatusWindow( 100, "Installation complete." );
szMsg = "Setup is complete. You may run the installed program "+
"by double-clicking on the program icon installed.";
MessageBox( szMsg, INFORMATION );
exit;
/*---------------------------------------------------------------------------*\
*
* Function: SetupScreen
*
* Purpose: This function will set up the screen look. This includes
* colors, fonts, text to be displayed, etc.
*
*
* Input:
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function SetupScreen()
number nDx, nDy;
begin
GetExtents( nDx, nDy );
Enable( FULLWINDOWMODE );
Enable( INDVFILESTATUS );
Enable( BITMAP256COLORS );
Enable( DIALOGCACHE );
SetTitle( "Installing " + APP_NAME, 24, WHITE );
SetColor( BACKGROUND, BK_BLUE ); // Dark blue.
SetColor( STATUSBAR, BLUE ); // Bright blue.
SetTitle( "Setup", 0, BACKGROUNDCAPTION ); // Caption bar text.
Enable( BACKGROUND );
Delay( 1 );
end;
/*---------------------------------------------------------------------------*\
*
* Function: CheckRequirements
*
* Purpose: This function will check all minimum requirements for the
* application being installed. If any fail, then the user
* is informed and the installation is terminated.
*
*
* Input:
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function CheckRequirements()
number nvDx, nvDy;
number nvVersion;
STRING szResult;
begin
// Check screen resolution.
GetExtents( nvDx, nvDy );
if (nvDy < 480) then
MessageBox( "This program requires VGA or better resolution.", WARNING );
exit;
endif;
end;