home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 31
/
XENIATGM31.iso
/
terademo
/
setup.bak
< prev
next >
Wrap
Text File
|
1997-01-09
|
13KB
|
461 lines
/*----------------------------------------------------------------------------*\
(c)1996 Eidos Interactive Ltd.
Simis Terracide InstallShield Script.
Adrian Hawkins.
\*----------------------------------------------------------------------------*/
declare
// Constant declarations.
#define TERRA_SPACE_REQUIRED 29000000 // Disk space in bytes.
#define PART_SPACE_REQUIRED 1000 // Disk space in bytes.
#define TERRA_APP_NAME "Terracide"
#define PROGRAM_FOLDER_NAME "Eidos Interactive"
#define INSTALL_BASE_PATH "Terracide"
#define COMPANY_NAME "Eidos Interactive"
#define PRODUCT_NAME "Terracide"
#define PRODUCT_VERSION "1.0"
#define PRODUCT_KEY "Terracide"
#define TERRA_DEINSTALL_KEY "3-Level Terracide Internal Demo"
#define TERRA_UNINSTALL_NAME "3-Level Terracide Internal Demo"
// Global variable declarations.
STRING svFolder, svDir, szMsg, szFileSet, szTitle, svUninstLogFile;
STRING svTarget, szProgram, szParam, szTemp, szAppPath, szSplash, szSourceDir;
BOOL bSpaceOk, bFullInstall, bWin, bWinNT, bWin32s, bIsShellExplorer;
BOOL bInstallTerracide, bInstallTombRaider;
NUMBER nResult, nInstallType, nPrograms, nSpaceRequired, nSpaceAvail;
LIST listData;
LONG lResult;
// Function declarations.
prototype SetupScreen();
prototype CheckRequirements();
prototype ShowOptions();
prototype ShowPrograms();
#include "sddialog.h"
program
StartHere:
Disable (BACKGROUND);
// Set installation info., which is required for registry entries.
InstallationInfo (COMPANY_NAME, PRODUCT_NAME, PRODUCT_VERSION, PRODUCT_KEY);
// Set up thr installation screen.
SetupScreen ();
Enable (DIALOGCACHE);
Disable (BACKBUTTON);
// Create a Welcome dialog.
WelcomeDlg:
Welcome ("", 0);
Enable (BACKBUTTON);
// Test target system for proper configuration.
CheckRequirements();
bInstallTerracide = TRUE;
GetConfig: // CD-ROM or hard disk install.
nInstallType = ShowOptions ();
bFullInstall = TRUE;
switch (nInstallType)
case BACK :
goto WelcomeDlg;
case 101 :
bFullInstall = TRUE;
case 102 :
bFullInstall = FALSE;
endswitch;
// Ask user for a destination location for the installation.
GetTargetDirectory:
if (bFullInstall) then
nSpaceRequired = 0;
svTarget = TARGETDISK ^ INSTALL_BASE_PATH;
if (AskDestPath( "", "", svTarget, 0 ) = BACK)
goto GetConfig;
nSpaceRequired = nSpaceRequired + TERRA_SPACE_REQUIRED;
endif;
// Perform space check of target drive.
bSpaceOk = TRUE;
nSpaceAvail = GetDiskSpace (svTarget ^ INSTALL_BASE_PATH);
if (nSpaceAvail < nSpaceRequired) then
szMsg = "There is not enough space available on the disk\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;
Confirm:
// Store retrieved information in list.
listData = ListCreate (STRINGLIST);
ListAddString (listData, "Setup Type:" , AFTER);
ListAddString (listData, "Install Terracide" , AFTER);
if (bFullInstall = TRUE) then
ListAddString (listData, " Full Installation - Run from hard disk." , AFTER);
else
ListAddString (listData, " Minimal Installation - Run from CD-ROM." , AFTER);
endif;
ListAddString (listData, "" , AFTER);
ListAddString (listData, "Destination Directory:" , AFTER);
ListAddString (listData, " " + svTarget, AFTER);
ListAddString (listData, "" , AFTER);
// Set title and static text for SdStartCopy.
szTitle = "Check Setup Information";
szMsg = "Setup has enough information to begin the file-transfer\n" +
"operation. If you want to review or change any of the\n" +
"settings, click Back. If you are satisfied with the\n" +
"settings, click Next to begin copying files.";
// Call SdStartCopy to display user selections.
lResult = SdStartCopy (szTitle, szMsg, listData);
if (lResult = BACK) then
goto GetConfig;
endif;
SetupFilesToTransfer:
// Get rid of the old teracide.ini settings ...
TARGETDIR=WINDIR;
DeleteFile("Teracide.ini");
if (bFullInstall = TRUE) then
Enable (BITMAPFADE);
// Set the App Paths key in the registry for the main program.
szAppPath = svTarget ^ "Terawin.exe";
RegDBSetItem( REGDB_APPPATH, szAppPath );
szProgram = svTarget ^ "Terawin.exe";
RegDBSetItem( REGDB_APPPATH_DEFAULT, szProgram );
szFileSet = "MyFileSet";
szSplash = SRCDIR ^ "Setup.bmp";
PlaceBitmap (szSplash, 12, 10, 10, UPPER_RIGHT);
// Move windows to fit splash bitmap.
PlaceWindow (FEEDBACK, 10, 10, LOWER_LEFT);
PlaceWindow (STATUSDLG, CENTERED, 10, LOWER_LEFT);
SetStatusWindow( -1, "Copying program files..." );
// TransferFiles
// Prepare InstallShield to record deinstallation information.
DeinstallStart( svTarget, svUninstLogFile, TERRA_DEINSTALL_KEY, 0 );
RegDBSetItem( REGDB_UNINSTALL_NAME, TERRA_UNINSTALL_NAME );
// Set up progress indicator and information gauge.
Disable( DIALOGCACHE );
Enable( STATUSDLG );
StatusUpdate( ON, 100 );
TARGETDIR = svTarget;
SRCDIR = SRCDIR ^ "Teracide";
nResult=XCopyFile("*.*","*.*",INCLUDE_SUBDIR);
// Perform the file set.
switch (nResult)
case 0: // Successful completion.
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;
endif;
Delay( 1 );
Disable( STATUSDLG );
InstallProgramItems:
// Create a folder
CreateProgramFolder (PROGRAM_FOLDER_NAME);
// Show it
ShowProgramFolder (PROGRAM_FOLDER_NAME, SW_SHOW);
SetStatusWindow( 100, "Creating Folder...." );
// Add a shortcut to the target executable, or the CD-ROM
if (bFullInstall = TRUE) then
szProgram = svTarget ^ "Terawin.exe";
LongPathToQuote( szProgram, TRUE );
AddFolderIcon(PROGRAM_FOLDER_NAME, "Terracide", szProgram + " -h",
svTarget ,
"", 0, "", REPLACE );
AddFolderIcon(PROGRAM_FOLDER_NAME, "Terracide ReadMe", svTarget ^ "Readme.Txt",
svTarget ,
"", 0, "", REPLACE );
else
szProgram = SRCDIR ^ "Teracide" ^ "Terawin.exe";
LongPathToQuote( szProgram, TRUE );
AddFolderIcon( PROGRAM_FOLDER_NAME, "Terracide", SRCDIR ^ "Teracide" ^ "Terawin.exe" + " -h",
SRCDIR ^ "Teracide",
"", 0, "", REPLACE );
AddFolderIcon(PROGRAM_FOLDER_NAME, "Terracide ReadMe", SRCDIR ^ "Teracide" ^ "Readme.Txt",
SRCDIR ^ "Teracide",
"", 0, "", REPLACE );
endif;
// Refresh the folder
ShowProgramFolder (PROGRAM_FOLDER_NAME, SW_SHOW);
if (bFullInstall = TRUE) then
// Add an unInstall icon
AddFolderIcon ( PROGRAM_FOLDER_NAME,
"unInstallShield for Terracide Demo", "UnInst -f" + svUninstLogFile,
WINDIR,
"",
0,
"",
REPLACE);
ShowProgramFolder (PROGRAM_FOLDER_NAME, SW_SHOW);
endif;
ShowProgramFolder (PROGRAM_FOLDER_NAME, SW_SHOW);
// Announce setup complete and offer to run setup for Tomb Raider.
SetStatusWindow( 100, "Installation complete." );
szMsg = "Setup is complete.\n"+
"You may run Terracide by double-clicking the icon in the Terracide folder.\n\n" +
"Terracide can be removed by clicking the unInstall icon, or by choosing\n" +
"'Add/Remove Programs' from Control Panel.\n\n" +
"To activate the in-game menu, press the <ALT> key.";
MessageBox (szMsg, INFORMATION);
Delay( 2 );
if(AskYesNo("Would you also like to install DirectX 3 ?",YES)=YES) then
ChangeDirectory (SRCDIR);
ChangeDirectory ("..");
ChangeDirectory ("..");
LaunchApp( SRCDISK ^ "DIRECTX" ^ "DIRECTX" ^ "DXSETUP.EXE", "" );
else
// Show the Terracide readme.
if (bFullInstall = TRUE ) then
LaunchApp( "Notepad.exe", svTarget ^ "Readme.Txt" );
else
LaunchApp( "Notepad.exe", SRCDIR ^ "Teracide" ^ "Readme.Txt" );
endif;
endif;
exit;
/*---------------------------------------------------------------------------*\
\*---------------------------------------------------------------------------*/
function ShowOptions ();
STRING szTitle;
STRING szMsg;
NUMBER nReturn;
LIST listButtons, listDescrip;
begin
// Setup the necessary variables.
szTitle = "Terracide Setup Options";
szMsg = "Click the kind of Terracide Setup your prefer.";
// Grey out the Next button, since we do not want
// users to use it.
Disable( NEXTBUTTON );
// create the list of buttons and their descriptions.
listButtons = ListCreate (STRINGLIST);
listDescrip = ListCreate (STRINGLIST);
// set button list
// Add the bitmap buttons to the listButtons list. The second parameter
// is a specially formatted string designating a bitmap resource found
// in _ISRES.DLL.
ListAddString (listButtons, "@12001;1;255,0,255", AFTER);
ListAddString (listButtons, "@12002;1;255,0,255", AFTER);
// set description list
ListAddString( listDescrip, "Run Terracide From Hard Disk.\n" +
"All files will be installed onto your hard\n" +
"disk.\n", AFTER );
ListAddString( listDescrip, "Run Terracide From CD-ROM.\n" +
"Selecting this option may result in slow\n" +
"gameplay.\n", AFTER);
// Display the set of buttons.
nReturn = SdOptionsButtons( szTitle, szMsg,listButtons, listDescrip );
// Destroy the lists.
ListDestroy( listButtons );
ListDestroy( listDescrip );
Enable (NEXTBUTTON);
return nReturn;
end;
/*---------------------------------------------------------------------------*\
*
* 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 );
SetTitle( "Terracide Internal Demonstration" + "\n(c)1996 Eidos Interactive.", 24, WHITE );
SetColor( BACKGROUND, BK_BLUE ); // Dark blue.
SetColor( STATUSBAR, BLUE ); // Bright blue.
SetTitle( "Terracide Demonstration Setup", 0, BACKGROUNDCAPTION ); // Caption bar text.
Enable( BACKGROUND );
// Show the bitmap.
/* Enable( BITMAPFADE );
PlaceBitmap( SUPPORTDIR ^ "Splash.BMP", 1, 10, 10, UPPER_LEFT | BITMAPICON );
Disable( BITMAPFADE ); */
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 nvResult;
STRING svResult;
begin
// Check screen resolution.
GetExtents( nvDx, nvDy );
if (nvDy < 480) then
MessageBox( "This program requires VGA or better resolution.", WARNING );
exit;
endif;
// Determine the target system's operating system.
GetSystemInfo( OS, nvResult, svResult );
bWinNT = FALSE;
bWin32s = FALSE;
bIsShellExplorer = FALSE;
if (nvResult = IS_WINDOWSNT) then
bWinNT = TRUE; // Running Windows NT.
// Check to see if NT is using EXPLORER Shell
if( QueryShellMgr( svResult ) = 0 ) then
if( StrCompare( svResult, "EXPLORER.EXE" ) = 0 ) then
bIsShellExplorer = TRUE;
endif;
endif;
elseif (nvResult = IS_WIN32S) then
bWin32s = TRUE; // Running Win32s.
endif;
end;
#include "sddialog.rul"