home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual K'Nex
/
KNEX.iso
/
setup.rul
< prev
next >
Wrap
Text File
|
1998-03-13
|
10KB
|
291 lines
/*----------------------------------------------------------------------------*\
*
* IIIIIII PPPPPP EEEEEE
* II PP PP EE Imagination Pilots Entertainment (R)
* II PPPPPP EEEEEE (c) 1995, Imagination Pilots Entertainment
* II PP EE All Rights Reserved.
* IIIIIII PP EEEEEE
*
*
* This source code is intended as a supplement to the K'nex
* documentation, and is provided AS IS.
*
*
* File Name: SETUP.RUL
*
* Description: Main script file for the cross-platform K'nex
* installation.
*
*
*
* Author:Phil Davis Date: January 21, 1995
*
* Comments:
*
*
*
\*----------------------------------------------------------------------------*/
declare
//#include "c:\\programf\\stirling\\ishield\\dialogs\\include\\sddialog.h"
#include "..\\..\\..\\dialogs\\include\\sddialog.h"
#include "instw32s.h"
#include "instwing.h"
#include "sys_test.h"
#include "DECLARE.RUL"
#include "win31.h"
#include "win95su.h"
string szTemp, svRetVer, szProgramFolder, szItemName, szCommandLine, szWorkingDir;
string szIconPath, szShortCutKey, szMainDirectory, svFileName;
number nResult, nIcon, nFlag;
BOOL bReadme, bApp, bRESTART_NEEDED;
program
start:
Enable(BITMAP256COLORS);
bIS_32BIT_OS = FALSE;
bIS_16BIT_OS = FALSE;
bSuccessful = TRUE;
//----szWin32InstallCompleted = TRUE;
//----szWingInstallCompleted = TRUE;
bRESTART_NEEDED = FALSE;
// Call SdProductName to make the product name (FreeCell) available to the
// SdWelcome dialog box, and then welcome the user to the installation.
//SetTitle(STR_DEF_INSTALL + STR_DEF_TITLE, TITLE_FONTSIZE_USE, WHITE);
SdProductName( STR_DEF_TITLE );
//------------------------------------------------------------------------------
// DISPLAY MAIN INSTALL GRAPHIC. INIT VARS, AND DETERMINE WHAT OS IS RUNNING
//------------------------------------------------------------------------------
szBitmapFile = SUPPORTDIR ^ STR_BMP_WELCOME1;
if(PlaceBitmap ( szBitmapFile, 100, CENTERED, CENTERED, CENTERED ) < 0) then
MessageBox("PlaceBitmap Failed", WARNING);
exit;
endif;
//-----------------------------------------------------------------------------
// For Win31 install. Check if this is before or after Windows Restart
//-----------------------------------------------------------------------------
if _AfterRestart() then //---- Display 'Welcome back' dialog and skip to part 2 of setup.
szText = "Welcome to part 2 of the setup";
MessageBox(szText, INFORMATION);
else //----Display 'Welcome' dialog.
Disable(BACKBUTTON);
SdWelcome( "", "" );
Enable(BACKBUTTON);
endif;
//-----------------------------------------------------------------------------
// WHAT VERSION OF WINDOWS IS CURRENTLY RUNNING?
// Set the OS flag to either bIS_16BIT_OS or bIS_32BIT_OS
//-----------------------------------------------------------------------------
if(GetSystemInfo(OS,nvResult,svResult) < 0) then
MessageBox("Couldn't get Operating System info",WARNING);
else switch(nvResult)
case IS_WINDOWS:
bIS_16BIT_OS = TRUE;
szEXEName = STR_16BIT_EXE;
case IS_WIN32S:
bIS_16BIT_OS = TRUE;
szEXEName = STR_16BIT_EXE;
case IS_WINDOWS95:
bIS_32BIT_OS = TRUE;
szEXEName = STR_32BIT_EXE;
case IS_WINDOWSNT:
bIS_32BIT_OS = TRUE;
szEXEName = STR_32BIT_EXE;
endswitch;
endif;
//-----------------------------------------------------------------------------
// If OS is Windows NT or Windows 95, do not install Win32s.
// If the system is Win3.1 or Win32s then
// Call _InstallWin32s to install or upgrade Win32s on the target system.
// Specify the Win32s version you are installing (1.30 here).
//-----------------------------------------------------------------------------
if (( nvResult != IS_WINDOWSNT ) && ( nvResult != IS_WINDOWS95 )) then
_Win31_Install( );
else
_Win95_Install( );
endif;
//-----------------------------------------------------------------------------
// If any if the Win 31 system components were added set szInstallCompleted to FALSE.
//-----------------------------------------------------------------------------
if (bRESTART_NEEDED) then
szInstallCompleted = FALSE;
else
szInstallCompleted = TRUE;
endif;
//-----------------------------------------------------------------------------
// Evaluate if the system needs to be rebooted for additions to take effect.
// Call _RestartAfterInstall() if you wish the user should restart windows
// to activate Win32s.
//-----------------------------------------------------------------------------
jumpit:
_RestartAfterInstall();
//-----------------------------------------------------------------------------
// ---- CHECK THE SYSTEM AND MODIFY CONFIG.INI.
//-----------------------------------------------------------------------------
SetDialogTitle(DLG_ASK_YESNO, "Install Query");
if( AskYesNo( STR_RUN_TESTS, NO) = YES) then
_GetSystemInfo();
endif;
//-----------------------------------------------------------------------------
// Finish the installation.
// Disable the progress indicator and the information gauges.
//
// Add the K'nex program item to the IPE MM program group. The group
// will be created if it does not exist
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// Add the K'nex README Icon to IPE MM group.
//-----------------------------------------------------------------------------
if ( bIS_16BIT_OS ) then
szCmdLine = "WRITE.EXE " + szAppPath ^ STR_README_WRI;
szProgramFolder = STR_DEF_GROUP_16;
else
szCmdLine = szAppPath ^ STR_README_WRI;
LongPathToQuote(szCmdLine, TRUE);
szProgramFolder = STR_DEF_GROUP_32;
//szCmdLine = "WORDPAD.EXE" + szCmdLine;
endif;
szWorkingDir = szAppPath;
szItemName = "K'NEX README";
CreateProgramFolder(szProgramFolder);
szIconPath = "";
nIcon = 0;
szShortCutKey = "";
nFlag = REPLACE;
if (AddFolderIcon( szProgramFolder, szItemName, szCmdLine, szWorkingDir, "", 0, "", REPLACE ) < 0) then
MessageBox("Add program Icon failed", WARNING);
endif;
//-----------------------------------------------------------------------------
// Add the K'nex Icon to IPE MM group.
//-----------------------------------------------------------------------------
if ( bIS_16BIT_OS ) then
szCmdLine = szAppPath ^ STR_16BIT_EXE;
else
szCmdLine = szAppPath ^ STR_32BIT_EXE;
LongPathToQuote(szCmdLine, TRUE);
endif;
szItemName = "K'nex Construction Set K-Force Rescue";
if (AddFolderIcon( szProgramFolder, szItemName, szCmdLine, szWorkingDir, "", 0, "", REPLACE )) < 0 then
MessageBox("Add Readme Icon failed", WARNING);
endif;
//-----------------------------------------------------------------------------
// If Win31 install add Uninstall icon.
//-----------------------------------------------------------------------------
if(bIS_16BIT_OS) then
szCmdLine = WINDIR ^ "UNINST16.EXE";
szCmdLine = szCmdLine + " -f" + svUninstallLogFile;
szIconPath = szAppPath ^ "uninstal.ico";
else
LongPathToQuote(svUninstallLogFile, TRUE);
szCmdLine = WINDIR ^ "UNINST.EXE -f" + svUninstallLogFile;
szIconPath = szAppPath ^ "uninstal.ico";
LongPathToQuote(szIconPath, TRUE);
endif;
szItemName = STR_DEF_UNINSTALL;
// if (AddFolderIcon( szProgramFolder, szItemName, szCmdLine, WINDIR, szIconPath, 0, "", REPLACE ) < 0) then
if (AddFolderIcon( szProgramFolder, szItemName, szCmdLine, WINDIR, szIconPath, 0, "", REPLACE )) < 0 then
MessageBox("Add UNINSTALL Icon failed", WARNING);
endif;
//---- Pause and display the group to the user.
//ShowGroup( STR_DEF_GROUP, SW_SHOW );
Delay(1);
//-----------------------------------------------------------------------------
// Display the SdFinish dialog box, offering the user the chance to run K'nex.
//-----------------------------------------------------------------------------
if (GetSystemInfo(COLORS, nvResult, svResult) < 0) then
MessageBox("Couldn't get COLOR info", WARNING);
endif;
if (nvResult < 256) then
MessageBox("Your display must be set to at least 256 colors or higher\nto run K'nex Construction Set?", WARNING);
endif;
if(bSuccessful) then
SdFinish(STR_DEF_FTITLE, STR_DEF_FMSG1, STR_DEF_FMSG2, STR_DEF_OPT1, STR_DEF_OPT2, bReadme, bApp );
if ( bReadme ) then
ChangeDirectory(szAppPath);
LaunchApp( "WRITE.EXE", "README.WRI" );
Delay(2);
endif;
if ( bApp ) then
ChangeDirectory(szAppPath);
LaunchApp( szEXEName, "" );
endif;
else
MessageBox(STR_MSG_039, WARNING);
// Set the root
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if( RegDBDeleteKey ( WIN95_APPPATH ^ PRODUCT_KEY) < 0) then
MessageBox(STR_MSG_040, WARNING);
endif;
endif;
exit;
//#include "c:\\programf\\stirling\\ishield\\dialogs\\include\\sddialog.rul"
#include "..\\..\\..\\dialogs\\include\\sddialog.rul"
#include "instw32s.rul"
#include "instwing.rul"
#include "sys_test.rul"
#include "win31.rul"
#include "win95su.rul"