home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hacker 7
/
HACKER07.ISO
/
Games
/
mcdemo.exe
/
SETUP.RUL
< prev
next >
Wrap
Text File
|
1998-04-15
|
54KB
|
1,384 lines
/*----------------------------------------------------------------------------
MechCommander Installation Program Script
For InstallShield3
Started 2/25/97
Author: FFS
Based on
----------------------------------------------------------------------------*/
declare
#include "Sddialog.h"
// Constant declarations.
#define SPACE_REQUIRED 200000000 // Disk space in bytes. Full Install.
#define MFC_SPACE_REQUIRED 3000000
#define APP_NAME "MechCommander(tm) Demo"
#define PROGRAM_FOLDER_NAME "FASA Interactive\\MechCommander"
#define APPBASE_PATH "FasaInteractive\\MechCmdrDemo"
#define APPBASE_PATH_WIN32S "FASAINteractive\\MechCmdrDemo"
#define COMPANY_NAME "FASA Interactive"
#define PRODUCT_NAME "MechCommander Demo"
#define PRODUCT_VERSION "1.0"
#define DEINSTALL_KEY "MechCommander UnInstall"
#define UNINSTALL_NAME "MechCommander Demo"
#define PRODUCT_KEY "MechCommanderDemo"
#define MM_DLL_FILE "\\winmm.dll"
#define K32_DLL_FILE "\\kernel32.dll"
#define DX_DLL_FILE "dsetup.dll"
#define CPU_DLL_FILE "cpuinfo.dll"
#define DSETUP_DDRAW 1
#define DSETUP_DSOUND 2
#define DSETUP_DDRAWDRV 8
#define DSETUP_DSOUNDDRV 16
// Global variable declarations.
STRING svFolder, svDir, szMsg, szFileSet, szTitle, svUninstLogFile;
STRING svTarget, szProgram, szParam, szTemp, szAppPath, svMFCTarget;
STRING svSource,lSource,lDest,oldSource,oldDest,appName;
STRING askTitle,askMsg1,askMsg2,szComponents,szDlgBmp,szChkMFC;
BOOL bSpaceOk, bWinNT, bWin32s, bIsShellExplorer, bRestartMachine;
NUMBER nResult, LogFileHandle, strLocation, nOP, installType, verResult, ourWindow,nvResult,nvNextDisk,svCopyParm;
STRING szDDrawPath, szDSoundPath, szDDrawVer, szDSoundVer,szDLL, pathString, szQuestion, szLicenseFile;
BOOL bDirectDrawInstalled, bDirectSoundInstalled;
STRING mcRoot,mcDataArt,mcDataEdart,mcDataCameras,mcDataFonts,mcDataHtml,mcDataIface,mcDataMissions;
STRING mcDataWarriors,mcDataProfiles,mcDataMovies,mcDataObjects,mcDataSound,mcDataSprites,mcDataPalettes;
STRING mcDataTerrain,mcDataTiles,mcMFC,mcLogArt,mcDataSave;
STRING scRoot,scDataArt,scDataEdart,scDataCameras,scDataFonts,scDataHtml,scDataIface,scDataMissions;
STRING scDataWarriors,scDataProfiles,scDataMovies,scDataObjects,scDataSound,scDataSprites,scDataPalettes;
STRING scDataTerrain,scDataTiles,scMFC,scDataTemp,mcDataTemp,scLogArt,scDataSave;
// Function declarations.
prototype SetupScreen ();
prototype CheckRequirements ();
prototype DefineFileSet (STRING, STRING, STRING, STRING, STRING, NUMBER, NUMBER);
prototype CheckForSoundCard();
prototype RunFileSet (STRING, STRING, NUMBER);
// Prototype MydllReturn in MYDLL.DLL.
prototype WINMM.waveOutGetNumDevs();
prototype KERNEL32.GlobalMemoryStatus(POINTER);
prototype CPUINFO.wincpuid();
prototype CPUINFO.wincpufeatures();
prototype CPUINFO.cpuspeed();
#define MEM_BUFFER_SIZE 32
typedef MemoryBuffer
begin
INT dwLength; // sizeof(MEMORYSTATUS)
INT dwMemoryLoad; // percent of memory in use
INT dwTotalPhys; // bytes of physical memory
INT dwAvailPhys; // free physical memory bytes
INT dwTotalPageFile; // bytes of paging file
INT dwAvailPageFile; // free bytes of paging file
INT dwTotalVirtual; // user bytes of address space
INT dwAvailVirtual; // free user bytes
end;
MemoryBuffer memBuffer;
POINTER pMemBuffer,pPathString;
program
start:
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);
szDlgBmp = SRCDIR ^ "dlg.bmp";
DialogSetInfo(DLG_INFO_ALTIMAGE,szDlgBmp,TRUE);
// Create a Welcome dialog.
WelcomeDlg:
Disable(BACKBUTTON);
Welcome("MechCommander Installation", 0);
Enable(BACKBUTTON);
LicenseAgreement:
szTitle = "MechCommander Demo License Agreement";
szMsg = "Please read the following license agreement. Use " +
"the scroll bar to view\nthe rest of this agreement";
szQuestion = "Do you accept all the terms of the preceding license " +
"agreement? If so,\nclick on the Yes push button. " +
"If you select No, Setup will close.";
szLicenseFile = SRCDIR ^ "license.txt";
nResult = SdLicense(szTitle, szMsg, szQuestion, szLicenseFile);
if (nResult = BACK) then
goto WelcomeDlg;
endif;
//------------------------------------------------------------------------------------------------------
// Test target system for proper configuration.
// Right now, we only test operating system version.
// We Need to check
// -Processor Speed.
// -System Memory.
// -Sound Card.
// -Video Card.
// -DirectX Install and Version.
// Replace following with a switch statement based on result of CheckRequirements.
// If DirectX needs Mucking with, run the DirectX Setup program as well.
SysCheck:
nResult = CheckRequirements();
if (nResult = 1) then
goto LicenseAgreement;
endif;
if (nResult < 0) then
goto EndInstall;
endif;
//------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
// Ask user for preferred Install options here. Full or Light.
CheckInstall:
szComponents = "Full Install";
ComponentAddItem(szComponents, "Full Install (200 Mb)", 1024, TRUE);
askTitle = "MechCommander Install Options";
askMsg1 = "Choose the type of Install you would like to do.";
askMsg2 = "Once you have selected the Install Type, Press the Next Button to continue.";
nResult = SdAskOptions(askTitle,askMsg1,askMsg2,"",szComponents,EXCLUSIVE);
if (nResult = BACK) then
goto SysCheck;
endif;
installType = 1;
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------
// Ask user for a destination location for the installation.--
GetTargetDirectory:
// InstallShield sets PROGRAMFILES such that it points to 'Program Files' directory location.
if ( PROGRAMFILES = "") then
svTarget = TARGETDISK ^ "\\Program Files\\" ^ APPBASE_PATH;
else
svTarget = PROGRAMFILES ^ APPBASE_PATH;
endif;
svMFCTarget = WINSYSDIR;
SdProductName(APP_NAME);
szMsg = "Setup will install "+APP_NAME+" in the following\n"+
"folder.\n\n"+
"To install to this folder, click Next.\n\n"+
"To install to a different folder, click Browse and select another\n"+
"folder.\n\n"+
"You can choose not to install "+APP_NAME+" by\n"+
"clicking Cancel to exit Setup\n\n"+
"It is STRONGLY recommended that you defrag the drive\n"+
"in which the demo is installed!";
if (SdAskDestPath("MechCommander Demo Install Location", szMsg, svTarget, 0 ) = BACK) then
goto CheckInstall;
endif;
// Perform space check of target drive.
// If not enough space, give user opportunity to try anyway.
// This is valid IF they are installing over an old copy.
bSpaceOk = TRUE;
if (GetDiskSpace(svTarget) < SPACE_REQUIRED) then
szMsg = "There isn't enough disk space on the destination chosen\n"+
"to Install the MechCommander Demo. This may not be correct\n"+
"if the game is already installed there. Do you want to go ahead\n"+
"and install to that drive and directory anyway?";
bSpaceOk = AskYesNo(szMsg,NO);
if (bSpaceOk = NO) then
goto GetTargetDirectory;
endif;
endif;
strLocation = StrFind(SRCDIR,"SETUP");
CopyBytes(svSource,0,SRCDIR,0,strLocation);
SRCDIR = svSource;
if (AskYesNo( "Do you want to view the README file now?", YES ) = YES) then
LaunchApp( "WRITE.EXE", SRCDIR ^ "README.doc" );
Delay( 2 );
endif;
//#ifdef DEBUG
//CreateFile(LogFileHandle,SRCDIR,"mechcmdr.log");
//WriteLine(LogFileHandle,svTarget);
//WriteLine(LogFileHandle,svTarget ^"\\honorb.exe";
//CloseFile(LogFileHandle);
//#endif
// Set the App Paths key for the main program.
szAppPath = svTarget;
RegDBSetItem( REGDB_APPPATH, szAppPath );
szProgram = svTarget ^ "\\mechcmdr.exe";
RegDBSetItem( REGDB_APPPATH_DEFAULT, szProgram );
//-----------------------------------------------------------------------------
if (installType = 1) then
svCopyParm = COMP_NORMAL;
goto FullInstall;
elseif (installType = 2) then
svCopyParm = COMP_UPDATE_DATE;
goto FullInstall;
else
svCopyParm = COMP_NORMAL;
goto PartInstall;
endif;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Setup the file transfer. This is for FULL INSTALL. REALLY PAINFUL. OUCH!
FullInstall:
SetupFilesToTransfer:
TARGETDIR = svTarget;
TransferFiles:
// Prepare InstallShield3 to record deinstallation information.
DeinstallStart( svTarget, svUninstLogFile, DEINSTALL_KEY, 0 );
RegDBSetItem( REGDB_UNINSTALL_NAME, UNINSTALL_NAME );
// Set up progress indicator and information gauge.
Disable(DIALOGCACHE);
Enable(STATUSDLG);
oldSource = SRCDIR;
oldDest = TARGETDIR;
SetStatusWindow(0, "Installing MechCommander Demo....");
scRoot = oldSource;
mcRoot = oldDest;
#ifndef TEDITOR
scDataArt = oldSource ^ "data\\art\\";
mcDataArt = oldDest ^ "\\data\\art";
#endif
scDataMovies = oldSource ^ "data\\movies\\";
mcDataMovies = oldDest ^ "\\data\\movies";
scDataObjects = oldSource ^ "data\\objects\\";
mcDataObjects = oldDest ^ "\\data\\objects";
scDataSound = oldSource ^ "data\\sound\\";
mcDataSound = oldDest ^ "\\data\\sound";
scDataSprites = oldSource ^ "data\\sprites\\";
mcDataSprites = oldDest ^ "\\data\\sprites";
scDataTiles = oldSource ^ "data\\tiles\\";
mcDataTiles = oldDest ^ "\\data\\tiles";
scDataTemp = oldSource ^ "data\\savegame\\temp\\";
mcDataTemp = oldDest ^ "\\data\\savegame\\temp";
scDataSave = oldSource ^ "data\\savegame\\";
mcDataSave = oldDest ^ "\\data\\savegame";
//-------------------------------------------------------------------
if (CreateDir(mcRoot) < 0) then
MessageBox("Unable to create data directory " ^ mcRoot ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataArt) < 0) then
MessageBox("Unable to create data directory " ^ mcDataArt ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataMovies) < 0) then
MessageBox("Unable to create data directory " ^ mcDataMovies ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataObjects) < 0) then
MessageBox("Unable to create data directory " ^ mcDataObjects ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataSound) < 0) then
MessageBox("Unable to create data directory " ^ mcDataSound ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataSprites) < 0) then
MessageBox("Unable to create data directory " ^ mcDataSprites ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataTiles) < 0) then
MessageBox("Unable to create data directory " ^ mcDataTiles ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataTemp) < 0) then
MessageBox("Unable to create data directory " ^ mcDataTemp ^ " on Destination",SEVERE);
endif;
//----------------------------------------------------------------------------------------------
//------------------------------------
// Define the File Set
SRCDIR=oldSource;
TARGETDIR=mcRoot;
szFileSet = "mcSet";
//FileSetBeginDefine(szFileSet);
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander Main Files...");
//FileSetRoot(szFileSet,scRoot);
SRCDIR = scRoot;
TARGETDIR = mcRoot;
StatusUpdate(ON,5);
nvResult = XCopyFile("*.*","*.*",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander GUI Art Files...");
TARGETDIR = mcDataArt;
//FileSetRoot(szFileSet,scDataArt);
SRCDIR = scDataArt;
StatusUpdate(ON,6);
nvResult = XCopyFile("art.pak","art.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander Logistics Files...");
TARGETDIR = mcDataSave;
//FileSetRoot(szFileSet,scDataMissions);
SRCDIR = scDataSave;
StatusUpdate(ON,7);
nvResult = XCopyFile("*.pkk","*.pkk",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander Movie Files...");
TARGETDIR = mcDataMovies;
//FileSetRoot(szFileSet,scDataMovies);
SRCDIR = scDataMovies;
StatusUpdate(ON,15);
nvResult = XCopyFile("*.*","*.*",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander Object Files...");
TARGETDIR = mcDataObjects;
//FileSetRoot(szFileSet,scDataObjects);
SRCDIR = scDataObjects;
StatusUpdate(ON,20);
nvResult = XCopyFile("object2.pak","object2.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander Sound Files...");
TARGETDIR = mcDataSound;
//FileSetRoot(szFileSet,scDataSound);
SRCDIR = scDataSound;
StatusUpdate(ON,25);
nvResult = XCopyFile("*.*","*.*",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander Sprite Files...");
TARGETDIR = mcDataSprites;
SRCDIR = scDataSprites;
//FileSetRoot(szFileSet,scDataSprites);
StatusUpdate(ON,30);
nvResult = XCopyFile("leftarms.pak","leftarms.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
StatusUpdate(ON,35);
nvResult = XCopyFile("rightarms.pak","rightarms.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
StatusUpdate(ON,40);
nvResult = XCopyFile("torsos.pak","torsos.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
StatusUpdate(ON,45);
nvResult = XCopyFile("legs.pak","legs.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
StatusUpdate(ON,50);
nvResult = XCopyFile("leftarms90.pak","leftarms90.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
StatusUpdate(ON,55);
nvResult = XCopyFile("rightarms90.pak","rightarms90.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
StatusUpdate(ON,60);
nvResult = XCopyFile("torsos90.pak","torsos90.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
StatusUpdate(ON,70);
nvResult = XCopyFile("legs90.pak","legs90.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
StatusUpdate(ON,80);
nvResult = XCopyFile("shapes.pak","shapes.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
StatusUpdate(ON,90);
nvResult = XCopyFile("sprites.pak","sprites.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
StatusUpdate(ON,91);
nvResult = XCopyFile("feet.pak","feet.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
StatusUpdate(ON,92);
nvResult = XCopyFile("crater.pak","crater.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
nvResult = XCopyFile("shadow.pak","shadow.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
nvResult = XCopyFile("blip.pak","blip.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
StatusUpdate(ON,95);
nvResult = XCopyFile("cursors.pak","cursors.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander Tile Files...");
TARGETDIR = mcDataTiles;
//FileSetRoot(szFileSet,scDataTiles);
SRCDIR = scDataTiles;
StatusUpdate(ON,98);
nvResult = XCopyFile("tiles.pak","tiles.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
// If we get here, we need to construct the system.cfg file for the fact that
// much of MechCommander resides somewhere else now.
OpenFileMode(FILE_MODE_APPEND);
CreateFile(LogFileHandle,mcRoot,"system.cfg");
WriteLine(LogFileHandle,"FITini");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[UseSound]");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[UseMusic]");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[ABL]");
WriteLine(LogFileHandle,"ul SymbolTableHeapSize = 767999");
WriteLine(LogFileHandle,"ul StackHeapSize = 511999");
WriteLine(LogFileHandle,"ul CodeHeapSize = 307199");
WriteLine(LogFileHandle,"ul RunTimeStackSize = 20479");
WriteLine(LogFileHandle,"ul MaxCodeBlockSize = 20479");
WriteLine(LogFileHandle,"ul MaxRegisteredModules = 200");
WriteLine(LogFileHandle,"ul MaxStaticVariables = 100");
WriteLine(LogFileHandle,"l MaxWatchesPerModule = 20");
WriteLine(LogFileHandle,"l MaxBreakPointsPermOdule = 20");
WriteLine(LogFileHandle,"ul DebuggerEnabled = 0");
WriteLine(LogFileHandle,"ul IncludeDebugInfo = 0");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[systemHeap]");
WriteLine(LogFileHandle,"ul systemHeapSize=1708851");
WriteLine(LogFileHandle,"ul guiHeapSize=2047999");
WriteLine(LogFileHandle,"ul soundHeapSize=767999");
WriteLine(LogFileHandle,"ul logisticsHeapSize=10485759");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[systemPaths]");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"st terrainPath = \"data\\terrain\\\""); //HD
WriteLine(LogFileHandle,"st palettePath = \"data\\palette\\\""); //CD
WriteLine(LogFileHandle,"st paletteName = \"palette\"");
WriteLine(LogFileHandle,"st artPath = \"data\\art\\\""); //CD
WriteLine(LogFileHandle,"st fontPath = \"data\\fonts\\\""); //CD
WriteLine(LogFileHandle,"st savePath = \"data\\savegame\\\""); //HD
WriteLine(LogFileHandle,"st spritePath = \"data\\sprites\\\""); //CD
WriteLine(LogFileHandle,"st shapesPath = \"data\\sprites\\\""); //CD
WriteLine(LogFileHandle,"st soundPath = \"data\\sound\\\""); //HD
WriteLine(LogFileHandle,"st objectPath = \"data\\objects\\\""); //HD
WriteLine(LogFileHandle,"st cameraPath = \"data\\cameras\\\""); //CD
WriteLine(LogFileHandle,"st tilePath = \"data\\tiles\\\""); //HD
WriteLine(LogFileHandle,"st missionPath = \"data\\missions\\\""); //CD
WriteLine(LogFileHandle,"st missionName = \"MechCmdr1\"");
WriteLine(LogFileHandle,"st warriorPath = \"data\\missions\\warriors\\\""); //CD
WriteLine(LogFileHandle,"st profilePath = \"data\\missions\\profiles\\\""); //CD
WriteLine(LogFileHandle,"st interfacepath = \"data\\iface\\\""); //CD
WriteLine(LogFileHandle,"st moviepath = \"data\\movies\\\""); //CD
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"st CDterrainPath = \""+scRoot+"data\\terrain\\\""); //HD
WriteLine(LogFileHandle,"st CDpalettePath = \""+scRoot+"data\\palette\\\""); //CD
WriteLine(LogFileHandle,"st CDartPath = \""+scRoot+"data\\art\\\""); //CD
WriteLine(LogFileHandle,"st CDfontPath = \""+scRoot+"data\\fonts\\\""); //CD
WriteLine(LogFileHandle,"st CDspritePath = \""+scRoot+"data\\sprites\\\""); //CD
WriteLine(LogFileHandle,"st CDsoundPath = \""+scRoot+"data\\sound\\\""); //HD
WriteLine(LogFileHandle,"st CDobjectPath = \""+scRoot+"data\\objects\\\""); //HD
WriteLine(LogFileHandle,"st CDcameraPath = \""+scRoot+"data\\cameras\\\""); //CD
WriteLine(LogFileHandle,"st CDtilePath = \""+scRoot+"data\\tiles\\\""); //HD
WriteLine(LogFileHandle,"st CDmissionPath = \""+scRoot+"data\\missions\\\""); //CD
WriteLine(LogFileHandle,"st CDwarriorPath = \""+scRoot+"data\\missions\\warriors\\\""); //CD
WriteLine(LogFileHandle,"st CDprofilePath = \""+scRoot+"data\\missions\\profiles\\\""); //CD
WriteLine(LogFileHandle,"st CDinterfacepath = \""+scRoot+"data\\iface\\\""); //CD
WriteLine(LogFileHandle,"st CDmoviepath = \""+scRoot+"data\\movies\\\""); //CD
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[FastFiles]");
WriteLine(LogFileHandle,"l NumFastFiles = 5");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"st File0=\"art.fst\"");
WriteLine(LogFileHandle,"st File1=\"mission.fst\"");
WriteLine(LogFileHandle,"st File2=\"misc.fst\"");
WriteLine(LogFileHandle,"st FIle3=\"terrain.fst\"");
WriteLine(LogFileHandle,"st FIle4=\"shapes.fst\"");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"FITend");
CloseFile(LogFileHandle);
//----------------------------------------------------------------------------------------------
// Write the prefs.cfg for this machine.
CreateFile(LogFileHandle,mcRoot,"prefs.cfg");
WriteLine(LogFileHandle,"FITini");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[MechCommander]");
WriteLine(LogFileHandle,"b PaletteCycle = T");
WriteLine(LogFileHandle,"b DirectDraw = T");
if ((memBuffer.dwTotalPhys/1024) < (30000)) then
WriteLine(LogFileHandle,"b Use90Pixel = f");
WriteLine(LogFileHandle,"b Force45Pixel = t");
WriteLine(LogFileHandle,"b Force16Mb = t");
elseif ((memBuffer.dwTotalPhys/1024) < (60000)) then
WriteLine(LogFileHandle,"b Use90Pixel = t");
WriteLine(LogFileHandle,"b Force45Pixel = f");
WriteLine(LogFileHandle,"b Force32Mb = t");
else
WriteLine(LogFileHandle,"b Use90Pixel = t");
WriteLine(LogFileHandle,"b Force45Pixel = f");
endif;
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"FITend");
CloseFile(LogFileHandle);
Delay(1);
goto CheckDirectX;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Setup the file transfer. This is for FULL INSTALL. REALLY PAINFUL. OUCH!
PartInstall:
TARGETDIR = svTarget;
strLocation = StrFind(SRCDIR,"SETUP");
CopyBytes(svSource,0,SRCDIR,0,strLocation);
SRCDIR = svSource;
// Prepare InstallShield3 to record deinstallation information.
DeinstallStart( svTarget, svUninstLogFile, DEINSTALL_KEY, 0 );
RegDBSetItem( REGDB_UNINSTALL_NAME, UNINSTALL_NAME );
// Set up progress indicator and information gauge.
Disable(DIALOGCACHE);
Enable(STATUSDLG);
oldSource = SRCDIR;
oldDest = TARGETDIR;
SetStatusWindow(0, "Installing MechCommander....");
scRoot = oldSource;
mcRoot = oldDest;
scDataArt = oldSource ^ "data\\art\\";
mcDataArt = oldDest ^ "\\data\\art";
scDataMovies = oldSource ^ "data\\movies\\";
mcDataMovies = oldDest ^ "\\data\\movies";
scDataObjects = oldSource ^ "data\\objects\\";
mcDataObjects = oldDest ^ "\\data\\objects";
scDataSound = oldSource ^ "data\\sound\\";
mcDataSound = oldDest ^ "\\data\\sound";
scDataSprites = oldSource ^ "data\\sprites\\";
mcDataSprites = oldDest ^ "\\data\\sprites";
scDataTiles = oldSource ^ "data\\tiles\\";
mcDataTiles = oldDest ^ "\\data\\tiles";
scDataTemp = oldSource ^ "data\\savegame\\temp\\";
mcDataTemp = oldDest ^ "\\data\\savegame\\temp";
scDataSave = oldSource ^ "data\\savegame\\\\";
mcDataSave = oldDest ^ "\\data\\savegame\\";
//-------------------------------------------------------------------
if (CreateDir(mcRoot) < 0) then
MessageBox("Unable to create data directory " ^ mcRoot ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataArt) < 0) then
MessageBox("Unable to create data directory " ^ mcDataArt ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataMovies) < 0) then
MessageBox("Unable to create data directory " ^ mcDataMovies ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataObjects) < 0) then
MessageBox("Unable to create data directory " ^ mcDataObjects ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataSound) < 0) then
MessageBox("Unable to create data directory " ^ mcDataSound ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataSprites) < 0) then
MessageBox("Unable to create data directory " ^ mcDataSprites ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataTiles) < 0) then
MessageBox("Unable to create data directory " ^ mcDataTiles ^ " on Destination",SEVERE);
endif;
if (CreateDir(mcDataTemp) < 0) then
MessageBox("Unable to create data directory " ^ mcDataTemp ^ " on Destination",SEVERE);
endif;
//----------------------------------------------------------------------------------------------
//------------------------------------
// Define the File Set
SRCDIR=oldSource;
TARGETDIR=mcRoot;
szFileSet = "mcSet";
//FileSetBeginDefine(szFileSet);
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander Main Files...");
//FileSetRoot(szFileSet,scRoot);
SRCDIR = scRoot;
TARGETDIR = mcRoot;
StatusUpdate(ON,5);
nvResult = XCopyFile("*.*","*.*",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander GUI Art Files...");
TARGETDIR = mcDataArt;
//FileSetRoot(szFileSet,scDataArt);
SRCDIR = scDataArt;
StatusUpdate(ON,6);
nvResult = XCopyFile("art.pak","art.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander Logistics Files...");
TARGETDIR = mcDataSave;
//FileSetRoot(szFileSet,scDataMissions);
SRCDIR = scDataSave;
StatusUpdate(ON,9);
nvResult = XCopyFile("*.pkk","*.pkk",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander Object Files...");
TARGETDIR = mcDataObjects;
//FileSetRoot(szFileSet,scDataObjects);
SRCDIR = scDataObjects;
StatusUpdate(ON,22);
nvResult = XCopyFile("object2.pak","object2.pak",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander Sound Files...");
TARGETDIR = mcDataSound;
//FileSetRoot(szFileSet,scDataSound);
SRCDIR = scDataSound;
StatusUpdate(ON,30);
nvResult = XCopyFile("*.*","*.*",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//------------------------------------
SetStatusWindow(-1, "Copying MechCommander Tile Files...");
TARGETDIR = mcDataTiles;
//FileSetRoot(szFileSet,scDataTiles);
SRCDIR = scDataTiles;
StatusUpdate(ON,90);
nvResult = XCopyFile("*.*","*.*",svCopyParm);
if (nvResult != 0) then
szMsg = "There isn't enough space in the Directory\n"+
"selected to install MechCommander\n";
MessageBox(szMsg,SEVERE);
goto EndInstall;
endif;
//----------------------------------------------------------------------------------------------
// If we get here, we need to construct the system.cfg file for the fact that
// much of MechCommander resides somewhere else now.
OpenFileMode(FILE_MODE_APPEND);
CreateFile(LogFileHandle,mcRoot,"system.cfg");
WriteLine(LogFileHandle,"FITini");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[UseSound]");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[UseMusic]");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[ABL]");
WriteLine(LogFileHandle,"ul SymbolTableHeapSize = 767999");
WriteLine(LogFileHandle,"ul StackHeapSize = 511999");
WriteLine(LogFileHandle,"ul CodeHeapSize = 307199");
WriteLine(LogFileHandle,"ul RunTimeStackSize = 20479");
WriteLine(LogFileHandle,"ul MaxCodeBlockSize = 20479");
WriteLine(LogFileHandle,"ul MaxRegisteredModules = 200");
WriteLine(LogFileHandle,"ul MaxStaticVariables = 100");
WriteLine(LogFileHandle,"l MaxWatchesPerModule = 20");
WriteLine(LogFileHandle,"l MaxBreakPointsPermOdule = 20");
WriteLine(LogFileHandle,"ul DebuggerEnabled = 0");
WriteLine(LogFileHandle,"ul IncludeDebugInfo = 0");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[systemHeap]");
WriteLine(LogFileHandle,"ul systemHeapSize=1708851");
WriteLine(LogFileHandle,"ul guiHeapSize=2047999");
WriteLine(LogFileHandle,"ul soundHeapSize=767999");
WriteLine(LogFileHandle,"ul logisticsHeapSize=10485759");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[systemPaths]");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"st terrainPath = \"data\\terrain\\\""); //HD
WriteLine(LogFileHandle,"st palettePath = \"data\\palette\\\""); //HD
WriteLine(LogFileHandle,"st paletteName = \"palette\"");
WriteLine(LogFileHandle,"st artPath = \"data\\art\\\""); //HD
WriteLine(LogFileHandle,"st fontPath = \"data\\fonts\\\""); //HD
WriteLine(LogFileHandle,"st savePath = \"data\\savegame\\\""); //HD
WriteLine(LogFileHandle,"st spritePath = \""+scRoot+"data\\sprites\\\""); //CD
WriteLine(LogFileHandle,"st shapesPath = \"data\\sprites\\\""); //CD
WriteLine(LogFileHandle,"st soundPath = \"data\\sound\\\""); //HD
WriteLine(LogFileHandle,"st objectPath = \"data\\objects\\\""); //HD
WriteLine(LogFileHandle,"st cameraPath = \"data\\cameras\\\""); //HD
WriteLine(LogFileHandle,"st tilePath = \"data\\tiles\\\""); //HD
WriteLine(LogFileHandle,"st missionPath = \"data\\missions\\\""); //HD
WriteLine(LogFileHandle,"st missionName = \"MechCmdr1\"");
WriteLine(LogFileHandle,"st warriorPath = \"data\\missions\\warriors\\\""); //HD
WriteLine(LogFileHandle,"st profilePath = \"data\\missions\\profiles\\\""); //HD
WriteLine(LogFileHandle,"st interfacepath = \"data\\iface\\\""); //HD
WriteLine(LogFileHandle,"st moviepath = \""+scRoot+"data\\movies\\\""); //CD
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"st CDterrainPath = \""+scRoot+"data\\terrain\\\""); //HD
WriteLine(LogFileHandle,"st CDpalettePath = \""+scRoot+"data\\palette\\\""); //CD
WriteLine(LogFileHandle,"st CDartPath = \""+scRoot+"data\\art\\\""); //CD
WriteLine(LogFileHandle,"st CDfontPath = \""+scRoot+"data\\fonts\\\""); //CD
WriteLine(LogFileHandle,"st CDspritePath = \""+scRoot+"data\\sprites\\\""); //CD
WriteLine(LogFileHandle,"st CDsoundPath = \""+scRoot+"data\\sound\\\""); //HD
WriteLine(LogFileHandle,"st CDobjectPath = \""+scRoot+"data\\objects\\\""); //HD
WriteLine(LogFileHandle,"st CDcameraPath = \""+scRoot+"data\\cameras\\\""); //CD
WriteLine(LogFileHandle,"st CDtilePath = \""+scRoot+"data\\tiles\\\""); //HD
WriteLine(LogFileHandle,"st CDmissionPath = \""+scRoot+"data\\missions\\\""); //CD
WriteLine(LogFileHandle,"st CDwarriorPath = \""+scRoot+"data\\missions\\warriors\\\""); //CD
WriteLine(LogFileHandle,"st CDprofilePath = \""+scRoot+"data\\missions\\profiles\\\""); //CD
WriteLine(LogFileHandle,"st CDinterfacepath = \""+scRoot+"data\\iface\\\""); //CD
WriteLine(LogFileHandle,"st CDmoviepath = \""+scRoot+"data\\movies\\\""); //CD
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[FastFiles]");
WriteLine(LogFileHandle,"l NumFastFiles = 5");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"st File0=\"art.fst\"");
WriteLine(LogFileHandle,"st File1=\"mission.fst\"");
WriteLine(LogFileHandle,"st File2=\"misc.fst\"");
WriteLine(LogFileHandle,"st FIle3=\"terrain.fst\"");
WriteLine(LogFileHandle,"st FIle4=\"shapes.fst\"");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"FITend");
CloseFile(LogFileHandle);
//----------------------------------------------------------------------------------------------
// Write the prefs.cfg for this machine.
CreateFile(LogFileHandle,mcRoot,"prefs.cfg");
WriteLine(LogFileHandle,"FITini");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"[MechCommander]");
WriteLine(LogFileHandle,"b PaletteCycle = T");
WriteLine(LogFileHandle,"b DirectDraw = T");
if ((memBuffer.dwTotalPhys/1024) < (30000)) then
WriteLine(LogFileHandle,"b Use90Pixel = f");
WriteLine(LogFileHandle,"b Force45Pixel = t");
else
WriteLine(LogFileHandle,"b Use90Pixel = t");
WriteLine(LogFileHandle,"b Force45Pixel = f");
endif;
WriteLine(LogFileHandle,"b Force32Mb = t");
WriteLine(LogFileHandle,"");
WriteLine(LogFileHandle,"FITend");
CloseFile(LogFileHandle);
Delay(1);
//-----------------------------------------------------------------------------
//------------------------------------------------------------------------------------
// Check for Direct X installed and for WinNT which can't install it anyway.
CheckDirectX:
//------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------
// Create program folders and icons.
InstallProgramItems:
SetStatusWindow(98, "Creating Program Folder and Icons....");
if (!bIsShellExplorer) then
MessageBox("This needs Win95 or WinNT 4.0 or Better",SEVERE);
endif;
if (bWinNT) then
ProgDefGroupType(PERSONAL);
endif;
svFolder = PROGRAM_FOLDER_NAME;
CreateProgramFolder(svFolder);
ShowProgramFolder(svFolder, 0);
szProgram = oldDest ^ "MechCmdr.exe";
appName = "MechCommander Demo";
LongPathToQuote( szProgram, TRUE );
if (AddFolderIcon( svFolder,appName, szProgram, oldDest ,"", 0, "", REPLACE ) < 0) then
MessageBox("Unable to Add Icon to Menu",SEVERE);
endif;
//---------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------
// Announce setup complete and offer to read README file
FinalInstallProcess:
SetStatusWindow(100, "Installation Complete");
pathString = scRoot+"directx\\directx\\mcdxsetup.exe";
nvResult = LaunchAppAndWait(pathString,"",WAIT);
szMsg = "MechCommander Demo Setup Must restart your machine\n"+
"for MechCommander Demo to work properly\n\n"+
"Choose one of the following options and click OK to finish setup";
RebootDialog("Restart Machine",szMsg,0);
szMsg = "Setup is complete. You may run the installed program " +
"by double-clicking on the program icon.";
MessageBox( szMsg, INFORMATION );
EndInstall:
//---------------------------------------------------------------------------------------
exit;
/*---------------------------------------------------------------------------*\
*
* Function: SetupScreen
*
* Purpose: This function will set up the screen look. This includes
* colors, fonts, text to be displayed, etc.
*
\*-------------------------------------------------------------------------*/
function SetupScreen()
NUMBER nDx, nDy;
begin
GetExtents( nDx, nDy );
Enable( DEFWINDOWMODE );
Enable( INDVFILESTATUS );
Enable( BITMAP256COLORS );
SetTitle( "Installing " + APP_NAME, 24, WHITE );
SetColor( BACKGROUND, BK_BLUE ); // Dark blue.
SetColor( STATUSBAR, BLUE ); // Bright blue.
SetTitle( "Setup", 0, BACKGROUNDCAPTION ); // Caption bar text.
PlaceBitmap("setup.bmp",1,CENTERED,CENTERED,TILED);
Enable( BACKGROUND );
Delay( 1 );
end;
/*---------------------------------------------------------------------------*\
*
* Function: CheckForSoundCard
*
* Purpose: This function will check for the presence of s Digital Sound Card.
*
\*-------------------------------------------------------------------------*/
function CheckForSoundCard()
NUMBER numDevs;
STRING szDLL;
begin
szDLL = WINSYSDIR + MM_DLL_FILE;
/*--------------------------------------------------------------------------*\
*
* Load winMM.DLL into memory.
*
\*--------------------------------------------------------------------------*/
nResult = UseDLL (szDLL);
numDevs = waveOutGetNumDevs();
/*--------------------------------------------------------------------------*\
*
* The following removes MYDLL.DLL from memory.
*
\*--------------------------------------------------------------------------*/
UnUseDLL (szDLL);
return(numDevs);
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.
*
\*---------------------------------------------------------------------------*/
function CheckRequirements()
NUMBER nvDx, nvDy, nvResult, goodResult, nSoundCard;
NUMBER pCPUId, pCPUFeatures, pCPUSpeed;
STRING svResult;
STRING szList,szDLL;
LIST listInfo;
begin
// Check screen resolution.
GetExtents( nvDx, nvDy );
goodResult = 0;
listInfo = ListCreate(STRINGLIST);
if (nvDy < 480) then
MessageBox( "This program requires VGA or better resolution.", WARNING );
abort;
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 the shell being used is EXPLORER shell.
if (( nvResult = IS_WINDOWSNT ) || ( nvResult = IS_WINDOWS95 )) then
if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then
if (nvResult >= 5) then
bIsShellExplorer = TRUE;
ListAddString(listInfo,"Operating System is Windows NT 5.0 or better.",AFTER);
ListAddString(listInfo,"This Game needs NT 5.0 at least--PASSED",AFTER);
ListAddString(listInfo," ",AFTER);
else
ListAddString(listInfo,"Operating System is Windows NT 4.0 or less.",AFTER);
ListAddString(listInfo,"This Game needs NT 5.0 at least--FAILED",AFTER);
ListAddString(listInfo," ",AFTER);
MessageBox("MechCommander Requires Win95, Win98 or WinNT 5.0 at least. Unable to Install",SEVERE);
goodResult = -1;
endif;
endif;
endif;
elseif (nvResult = IS_WIN32S) then
ListAddString(listInfo,"Operating System is WIN32s.",AFTER);
ListAddString(listInfo,"This Game needs NT 5.0 or Win95, Win98 at least--FAILED",AFTER);
ListAddString(listInfo," ",AFTER);
MessageBox("MechCommander Requires Win95, Win98 or WinNT 5.0 at least. Unable to Install",SEVERE);
goodResult = -2;
elseif (nvResult = IS_WINDOWS95 ) then
ListAddString(listInfo,"Operating System is Windows 95 or better.",AFTER);
ListAddString(listInfo,"This Game needs Win95 or Win98 at least--PASSED",AFTER);
ListAddString(listInfo," ",AFTER);
bIsShellExplorer = TRUE;
else
ListAddString(listInfo,"Operating System is Windows 3.11 or less.",AFTER);
ListAddString(listInfo,"This Game needs NT 5.0 or Win95, Win98 at least--FAILED",AFTER);
ListAddString(listInfo," ",AFTER);
MessageBox("MechCommander Requires Win95, Win98 or WinNT 5.0 at least. Unable to Install",SEVERE);
goodResult = -4;
endif;
szDLL = WINSYSDIR + K32_DLL_FILE;
nResult = UseDLL (szDLL);
//------------------------------------------
// Determine the target system's Base Memory
memBuffer.dwLength = MEM_BUFFER_SIZE;
pMemBuffer = AddressStruct(memBuffer);
GlobalMemoryStatus(pMemBuffer);
Sprintf(szList,"Physical System Memory is %ldK bytes of RAM.",(memBuffer.dwTotalPhys/1024));
ListAddString(listInfo,szList,AFTER);
if ((memBuffer.dwTotalPhys/1024) < (15000)) then
MessageBox("MechCommander Requires at Least 16 MB of RAM!",SEVERE);
goodResult = -3;
ListAddString(listInfo,"This Game needs 15000K of RAM at least--FAILED",AFTER);
ListAddString(listInfo," ",AFTER);
else
ListAddString(listInfo,"This Game needs 15000K of RAM at least--PASSED",AFTER);
ListAddString(listInfo,"31000K of RAM is Recommended",AFTER);
ListAddString(listInfo," ",AFTER);
endif;
//--------------------------------------------------------
nResult = UnUseDLL (szDLL);
//--------------------------------------------------------
// Determine the target system's Processor and Speed
szDLL = CPU_DLL_FILE;
nResult = UseDLL (szDLL);
pCPUId = wincpuid();
pCPUFeatures = wincpufeatures();
pCPUSpeed = cpuspeed();
if ((pCPUId < 5) && (pCPUId > 2)) then
if (pCPUId = 3) then
ListAddString(listInfo,"System Processor is 386",AFTER);
endif;
if (pCPUId = 4) then
ListAddString(listInfo,"System Processor is 486",AFTER);
endif;
ListAddString(listInfo,"This Game needs a 133Mhz Pentium or Better--FAILED",AFTER);
else
if ((pCPUId > 4) && (pCPUId < 8)) then
if (pCPUId = 5) then
if (pCPUFeatures & 0x0080000) then
Sprintf(szList,"System Processor is %ldMhz Pentium with MMX.",pCPUSpeed);
ListAddString(listInfo,szList,AFTER);
else
Sprintf(szList,"System Processor is %ldMhz Pentium",pCPUSpeed);
ListAddString(listInfo,szList,AFTER);
endif;
if (pCPUSpeed >= 133) then
ListAddString(listInfo,"This Game needs a 133Mhz Pentium or Better--PASSED",AFTER);
ListAddString(listInfo,"A 166Mhz Pentium with MMX is Recommended",AFTER);
else
ListAddString(listInfo,"This Game needs a 133Mhz Pentium or Better--FAILED",AFTER);
endif;
endif;
if (pCPUId = 6) then
if (pCPUFeatures & 0x0080000) then
Sprintf(szList,"System Processor is %ldMhz Pentium PRO with MMX",pCPUSpeed);
ListAddString(listInfo,szList,AFTER);
else
Sprintf(szList,"System Processor is %ldMhz Pentium PRO",pCPUSpeed);
ListAddString(listInfo,szList,AFTER);
endif;
if (pCPUSpeed >= 133) then
ListAddString(listInfo,"This Game needs a 133Mhz Pentium or Better--PASSED",AFTER);
ListAddString(listInfo,"A 166Mhz Pentium with MMX is Recommended",AFTER);
else
ListAddString(listInfo,"This Game needs a 133Mhz Pentium or Better--FAILED",AFTER);
endif;
endif;
if (pCPUId = 7) then
ListAddString(listInfo,"System Processor is Pentium II",AFTER);
if (pCPUSpeed >= 133) then
ListAddString(listInfo,"This Game needs a 133Mhz Pentium or Better--PASSED",AFTER);
ListAddString(listInfo,"A 166Mhz Pentium with MMX is Recommended",AFTER);
else
ListAddString(listInfo,"This Game needs a 133Mhz Pentium or Better--FAILED",AFTER);
endif;
endif;
else
ListAddString(listInfo,"System Processor is UNKNOWN!",AFTER);
ListAddString(listInfo,"This Game needs a 133Mhz Pentium or Better--UNKNOWN",AFTER);
ListAddString(listInfo,"A 166Mhz Pentium with MMX is Recommended",AFTER);
endif;
endif;
ListAddString(listInfo," ",AFTER);
//--------------------------------------------------------
nResult = UnUseDLL (szDLL);
//--------------------------------------------------------
// Determine the target system's digital sound card status
nSoundCard = CheckForSoundCard();
if (nSoundCard != 0) then
ListAddString(listInfo,"System has Digital Sound Card Installed",AFTER);
ListAddString(listInfo,"This Game needs a Digital Sound Card--PASSED",AFTER);
ListAddString(listInfo," ",AFTER);
else
ListAddString(listInfo,"System does not have Digital Sound Card Installed",AFTER);
ListAddString(listInfo,"This Game needs a Digital Sound Card--FAILED",AFTER);
ListAddString(listInfo," ",AFTER);
MessageBox("MechCommander Requires a a Digital Output Device (Sound Card)",SEVERE);
endif;
/*
//---------------------------------------------------------------------------------------
// Version Check Direct X and offer to install.
// We only care about DirectDraw and DirectSound.
// As such, only check them.
verResult = VerFindFileVersion("ddraw.dll",szDDrawPath,szDDrawVer);
//----------------------------------------------------
// Couldn't find the file. Handle it.
if (verResult != 0) then
if (bWinNT = TRUE) then
//-------------------------------------------------------------------------------------------------
// This can't happen, in theory because we shouldn't get here if we tried to install on NT < 4.0.
// Handle it anyway.
szMsg = "This is Windows NT and I can't find DirectDraw.\n"+
"The only way that can happen is if this is a version of NT earlier than 4.0 Build 1381\n"+
"MechCommander requires that DirectDraw be installed and cannot install on this version of NT";
MessageBox(szMsg,SEVERE);
bDirectDrawInstalled = FALSE;
ListAddString(listInfo,"DirectDraw Not Installed Under WinNT.",AFTER);
ListAddString(listInfo,"This Game needs NT with DirectDraw--FAILED",AFTER);
ListAddString(listInfo," ",AFTER);
else
//-----------------------------------------------------------------------------------------------
//We are in Win95 and DirectDraw is NOT installed. Warn 'em that they need to and take 'em there.
szMsg = "This is Win95 or greater and I could not find DirectDraw.\n"+
"You must Install Direct X Version 5.0 at least or MechCommander will not work.";
MessageBox(szMsg,INFORMATION);
ListAddString(listInfo,"DirectDraw Not Installed Under Win95.",AFTER);
ListAddString(listInfo,"This Game needs Win95 with DirectDraw--FAILED",AFTER);
ListAddString(listInfo," ",AFTER);
bDirectDrawInstalled = FALSE;
endif;
else
bDirectDrawInstalled = TRUE;
Sprintf(szList,"DirectDraw Version %s Installed.",szDDrawVer);
ListAddString(listInfo,szList,AFTER);
ListAddString(listInfo,"This Game needs DirectDraw--PASSED",AFTER); //Put version Info in here.
ListAddString(listInfo," ",AFTER);
endif;
if (nSoundCard != 0) then
verResult = VerFindFileVersion("dsound.dll",szDSoundPath,szDSoundVer);
//----------------------------------------------------
// Couldn't find the file. Handle it.
if ((verResult = FILE_NO_VERSION) || (verResult = FILE_NOT_FOUND)) then
if (bWinNT = TRUE) then
//-------------------------------------------------------------------------------------------------
// This can happen if they haven't installed a Digital Sound Device on NT. We should check for
// a digital Sound Card here.
szMsg = "This is Windows NT and I can't find DirectSound.\n"+
"You may not have a digital sound card installed and MechCommander requires one.\n"+
"Or your sound card does not support DirectSound under NT. MechCommander does not\n"+
"require DirectSound but performance, especially under NT, is DRAMATICALLY improved.\n";
MessageBox(szMsg,SEVERE);
bDirectSoundInstalled = FALSE;
ListAddString(listInfo,"DirectSound Not Installed Under WinNT.",AFTER);
ListAddString(listInfo,"This Game works better with DirectSound--MARGINAL",AFTER);
ListAddString(listInfo," ",AFTER);
else
//-----------------------------------------------------------------------------------------------
//We are in Win95 and DirectDraw is NOT installed. Warn 'em that they need to and take 'em there.
szMsg = "This is Win95 or greater and I could not find DirectSound.\n"+
"You must Install Direct X Version 5.0 at least or MechCommander will not work.";
MessageBox(szMsg,INFORMATION);
bDirectSoundInstalled = FALSE;
ListAddString(listInfo,"DirectSound Not Installed Under Win95.",AFTER);
ListAddString(listInfo,"This Game works better with DirectSound--MARGINAL",AFTER);
ListAddString(listInfo," ",AFTER);
endif;
else
bDirectSoundInstalled = TRUE;
Sprintf(szList,"DirectSound Version %s Installed.",szDSoundVer);
ListAddString(listInfo,szList,AFTER);
ListAddString(listInfo,"This Game works better with DirectSound--PASSED",AFTER);
ListAddString(listInfo," ",AFTER);
endif;
endif;
*/
//------------------------------------------
// Display System Info
nvResult = SdShowInfoList("System Information","The text below Describes your system configuration",listInfo);
if (nvResult = BACK) then
goodResult = 1;
endif;
return goodResult;
end;
#include "sddialog.rul"