home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PhotoFinish 4.0 (French)
/
Photofinish-v4-FrenchVersion-Win31.iso
/
init.rul
< prev
next >
Wrap
Text File
|
1996-11-28
|
9KB
|
314 lines
/*---------------------------------------------------------------------------*\
*
* Function: Init
*
* Purpose: This function initializes global settings then initializes
* the screen.
*
*
* Input:
*
* Returns:
*
* Comments:
\*---------------------------------------------------------------------------*/
function Init()
STRING szBitmapFileName, svBitmapFileName;
begin
GetGlobalSystemInfo(); //Gets Platform etc.
SetupScreen();
AppStrFromProfile( "SplashBitmapName", svBitmapFileName );
szBitmapFileName = SUPPORTDIR ^ svBitmapFileName;
PlaceBitmap( szBitmapFileName, 12, CENTERED, CENTERED, CENTERED );
ReplaceAutoExec(); //only does anything if we restarted after adding SHARE
InitAppStrings();
CheckRequirements(); //Checks system req. for Product and/or 32s
Delay( 1 );
PlaceBitmap( szBitmapFileName, 12, CENTERED, CENTERED, REMOVE );
Disable( BITMAPFADE );
//Disable logging here until after Win32s setup.
Disable( LOGGING );
Enable( DIALOGCACHE );
end;
/*---------------------------------------------------------------------------*\
*
* Function: SetupScreen
*
* Purpose: This function will set up the screen look. This includes
* colors, fonts, text to be displayed, etc.
* Displays Splash Screen, and calls Init, Then Gets System Info
* and checks requirements.
* Input:
*
* Returns:
*
* Comments: Gets BackGround Title and Caption
\*---------------------------------------------------------------------------*/
function SetupScreen()
STRING szBitmapFileName;
begin
Enable( BITMAP256COLORS );
Enable( BITMAPFADE );
AppStrFromProfile( "BackgroundCaption", BACKGROUND_CAPTION );
AppStrFromProfile( "BackgroundTitle", BACKGROUND_TITLE );
SetTitle( BACKGROUND_CAPTION, 24, WHITE );
//SetColor( BACKGROUND, BK_BLUE ); // Dark blue.
// Default
SetTitle( BACKGROUND_TITLE, 0, BACKGROUNDCAPTION ); // Caption bar text.
end;
/*---------------------------------------------------------------------------*\
*
* Function: GetGlobalSystemInfo
*
* Purpose: Gets system OS and Versions and sets Global variables:
* nPlatform, bExplorer, nWin32sBuild
* ISVersion, bNeed32s,
*
* Input:
*
* Returns:
*
* Comments: Global vatiables used in Setup.rul and Instw32s.rul
* _MyGetWin32sInfo in Inst32w32s.rul
\*---------------------------------------------------------------------------*/
function GetGlobalSystemInfo()
LIST VerInfo;
STRING sDLLName, sBuild, svPath, svVerInfo;
NUMBER nFileFound;
begin
bExplorer = FALSE;
bNeed32s = FALSE;
bNo32s = FALSE;
nPlatform = 0;
nWin32sBuild = 0;
ISVersion = 0;
//Setup.ini should have 16on16=Y meaning ISVersion = 16 if we are in win3.1x
//with or without 32s.
GetSystemInfo( ISTYPE, ISVersion, svResult );
GetSystemInfo( OS, nPlatform, svResult );
//Do this stuff for Win3.1 and Win32s
if( ISVersion = 16 || //but put in check here for after its installed.
(( nPlatform != IS_WINDOWSNT ) && ( nPlatform != IS_WINDOWS95 ))) then
if( ISVersion = 16 ) then
//Message in case we have to start over in 32-bit.
SdShowMsg( "", TRUE );
endif;
sDLLName = "W32SYS.DLL"; //Contains Win32s version info.
GetSystemInfo( WIN32SINSTALLED, nvResult, svResult );
if( nvResult = TRUE ) then //nPlatform = IS_WIN32S
nFileFound = VerFindFileVersion( sDLLName, svPath, svVerInfo );
if( nFileFound = FILE_NO_VERSION ) then
bNeed32s = TRUE; //can't get version, must be old.
elseif( nFileFound = FILE_NOT_FOUND ) then
bNeed32s = TRUE; //if this file isn't there
bNo32s = TRUE; //WIN32SINSTALLED lied.
else
VerInfo = ListCreate( STRINGLIST );
StrGetTokens( VerInfo, svVerInfo, "." );
if ( ListSetIndex( VerInfo, 2 ) = 0 ) then // O indicates it worked
ListCurrentString( VerInfo, sBuild );
StrToNum( nWin32sBuild, sBuild );
if( nWin32sBuild < CURRENT_WIN32S_BUILD ) then
bNeed32s = TRUE;
endif;
else
bNeed32s = TRUE;
endif;
endif;
else
bNo32s = TRUE;
bNeed32s = TRUE;
endif;
if( ISVersion = 16 ) then
//Message in case we have to start over in 32-bit.
Delay(2);
SdShowMsg( "", FALSE );
endif;
else
//Do this stuff for Win95 and NT
GetSystemInfo( WINMAJOR, nvResult, svResult );
if( nvResult > 3 ) then
bExplorer = TRUE;
endif;
endif;
//Force 32 bit installer.
if( ISVersion = 16 && bNeed32s = FALSE ) then
// LaunchApp( SRCDIR ^ "Setup.exe", "-f32s" );
// exit;
else
Enable( BACKGROUND );
endif;
end;
/*---------------------------------------------------------------------------*\
*
* Function: InitAppStrings
*
* Purpose: This function initializes global settings.
*
*
* Input:
*
* Returns:
*
* Comments: Calls InstallationInfo, and SdProductName
\*---------------------------------------------------------------------------*/
function InitAppStrings()
begin
if( ( nPlatform = IS_WINDOWS95 ) || ( nPlatform = IS_WINDOWSNT ) ) then
AppStrFromProfile( "DefaultPath", DEFAULT_PATH);
else
AppStrFromProfile( "DefaultPath16", DEFAULT_PATH);
endif;
AppStrFromProfile( "CompanyName", COMPANY_NAME );
AppStrFromProfile( "ProductName", PRODUCT_NAME );
AppStrFromProfile( "ProductVersion", PRODUCT_VERSION );
AppStrFromProfile( "ProductKey", PRODUCT_KEY );
AppStrFromProfile( "DefaultFolder", DEFAULT_FOLDER );
AppStrFromProfile( "UninstallName", UNINSTALL_NAME );
AppStrFromProfile( "UninstallKey", UNINSTALL_KEY );
InstallationInfo( COMPANY_NAME, PRODUCT_NAME, PRODUCT_VERSION, PRODUCT_KEY );
SdProductName( PRODUCT_NAME );
TARGETDIR = TARGETDISK ^ DEFAULT_PATH;
end;
/*---------------------------------------------------------------------------*\
*
* Function: CheckRequirements
*
* Purpose: Checks Requirements for installation
* including Win32s if necessary.
*
* Input:
*
* Returns: Exits through _ErrMsg() if fails
*
* Comments: calls _CheckSysRequirements() from Instw32s.rul for win32s, q.v.
* Uses AppStr's REQ_RAM, REQ_PROCESSOR, REQ_DISPLAY
\*---------------------------------------------------------------------------*/
function CheckRequirements()
STRING svRequired, sSysMem;
NUMBER nvRequired, nSysMem;
begin
if( bNeed32s ) then
_CheckSysRequirements(); //for Win32s
//Deals with SHARE
endif;
//Check Ram This don't werk rite
/*AppStrFromProfile( "REQ_RAM", svRequired );
StrToNum( nvRequired, svRequired );
GetSystemInfo( BASEMEMORY, nvResult, svResult );
nSysMem = nvResult;
GetSystemInfo( EXTENDEDMEMORY, nvResult, svResult );
nSysMem = nSysMem + nvResult;
if( nSysMem < ( nvRequired * 1000 ) ) then
_ErrYesNoMsg( "NotEnoughRam", svRequired );
endif;*/
//Check Processor
AppStrFromProfile( "REQ_PROCESSOR", svRequired );
StrToNum( nvRequired, svRequired );
GetSystemInfo( CPU, nvResult, svResult );
//make sure its INTEL
if( ( nvResult = IS_ALPHA ) || ( nvResult = IS_MIPS ) || ( nvResult = IS_POWERPC ) ) then
_ErrMsg( "NotIntel", TRUE );
endif;
//Switch on Required processor.
switch( nvRequired )
case 286:
if( nvResult < IS_286 ) then
_ErrYesNoMsg( "NotProcessor", svRequired );
endif;
case 386:
if( nvResult < IS_386 ) then
_ErrYesNoMsg( "NotProcessor", svRequired );
endif;
case 486:
if( nvResult < IS_486 ) then
_ErrYesNoMsg( "NotProcessor", svRequired );
endif;
case 586:
if( nvResult < IS_PENTIUM ) then
_ErrYesNoMsg( "NotProcessor", svRequired );
endif;
default:
_ErrMsg( "CantTellProcessor", FALSE );
endswitch;
//Check Display
AppStrFromProfile( "REQ_DISPLAY", svRequired );
StrToUpper( svRequired, svRequired );
if( svRequired = "EGA" ) then
nvRequired = IS_EGA;
elseif( svRequired = "VGA" ) then
nvRequired = IS_VGA;
elseif( svRequired = "SVGA" ) then
nvRequired = IS_SVGA;
elseif( svRequired = "XVGA" ) then
nvRequired = IS_XVGA;
elseif( svRequired = "UVGA" ) then
nvRequired = IS_UVGA;
endif;
GetSystemInfo( VIDEO, nvResult, svResult );
if( nvResult < nvRequired ) then
_ErrYesNoMsg( "NotDisplay", svRequired );
endif;
end;
/*---------------------------------------------------------------------------*\
*
* Function: ReplaceAutoExec
*
* Purpose: Replaces the Autoexec file if we restarted after adding share.
*
* Input:
*
* Returns:
*
* Comments: if we restarted after adding share, there will be a file called
* teakles.glb. replace autoexec with that. see SetupShare()
\*---------------------------------------------------------------------------*/
function ReplaceAutoExec()
STRING svFileName, svPath, szFileName, svReturn;
LIST listAutoExec;
begin
BatchGetFileName( svFileName );
ParsePath( svPath, svFileName, PATH );
szFileName = "teakles.glb";
if( FindFile( svPath, szFileName, svResult ) = 0 ) then
listAutoExec = ListCreate( STRINGLIST );
szFileName = svPath ^ szFileName;
ListReadFromFile( listAutoExec, szFileName );
ListWriteToFile( listAutoExec, svFileName );
VarSave( SRCTARGETDIR );
TARGETDIR = svPath;
DeleteFile( "teakles.glb" );
VarRestore( SRCTARGETDIR );
endif;
end;