home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
German history - 1949 to 2000
/
0010121246.iso.zip
/
0010121246.iso
/
setup.rul
< prev
next >
Wrap
Text File
|
2000-08-31
|
9KB
|
296 lines
// ************************************************************************************
// * Olzog Update
// ************************************************************************************
declare
/* #include "sddialog.h" */
// Constant declarations.
#define SPACE_REQUIRED 4358124 // Disk space in bytes.
#define APP_NAME "Olzog Geschichte"
#define PROGRAM_FOLDER_NAME "Olzog"
#define APPBASE_PATH "\\Olzog"
#define APPBASE_PATH_WIN32S "\\Olzog"
#define COMPANY_NAME "Olzog"
#define PRODUCT_NAME "Olzog"
#define PRODUCT_VERSION "97"
#define DEINSTALL_KEY "Olzog - Geschichte"
#define UNINSTALL_NAME "Olzog2000"
#define PRODUCT_KEY "Olzog"
// Global variable declarations.
STRING svFolder, svDir, szMsg, szFileSet, szTitle, svUninstLogFile;
STRING svTarget, szProgram, szParam, szTemp, szAppPath;
BOOL bSpaceOk, bWinNT, bWin32s, bWin311, bIsShellExplorer;
NUMBER nResult;
STRING szPath, svResult;
STRING svNFO, svDate;
STRING sTmp;
NUMBER nvSize;
STRING svString, szOutput;
NUMBER nDriveType, nDriveMinSpace
LIST listID;
STRING sEin, sAus, altDir;
// 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 ) = BACK ) then
goto WelcomeDlg;
endif;
// Perform space check of target drive.
bSpaceOk = TRUE;
if (GetDiskSpace( svTarget ) < SPACE_REQUIRED) then
szMsg = "Auf dem Laufwerk \n" +
"'" + svTarget + "' \n" +
"ist nicht genⁿgend Platz vorhanden. Bitte schaffen Sie mehr Platz\n" +
"oder wΣhlen Sie ein anderes Laufwerk.";
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, "Erzeuge Programmgruppe und Ikone...." );
AppCommand( PROGMAN, CMD_RESTORE );
svFolder = PROGRAM_FOLDER_NAME;
CreateProgramFolder( svFolder );
Delay(1);
szProgram = svTarget ^ "XSEARCH.EXE";
ShowProgramFolder( svFolder, SW_SHOW );
AddFolderIcon( svFolder, APP_NAME,
szProgram,
"",
"", 0, "", REPLACE );
Delay( 1 );
// Ini Datei
WriteProfString( svTarget ^ "OLZOG.INI", "Installation", "CD", SRCDIR );
Delay( 1 );
WriteProfString( svTarget ^ "OLZOG.INI", "Installation", "EndVersion", "1" );
Delay( 1 );
// 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 );
AddFolderIcon( svFolder, "Readme ",
"NOTEPAD.EXE " + svTarget ^ "README.TXT",
svTarget,
"", 0, "", REPLACE );
Delay( 1 );
// Announce setup complete and offer to read README file.
FinalInstallProcess:
SetStatusWindow( 100, "Installation vollstΣndig." );
if ( bWin311 ) then
szMsg = "Das Setup ist vollstΣndig ausgefⁿhrt.\nBitte installieren Sie nun Video for Windows\n" +
"Sie k÷nnen die Installation ⁿber die EXIT Taste abbrechen";
MessageBox( szMsg, INFORMATION );
LaunchApp ( SRCDIR ^ "VFW/DISK1/SETUP.EXE", "" );
else
szMsg = "Das Setup ist vollstΣndig ausgefⁿhrt.";
MessageBox( szMsg, INFORMATION );
endif;
LaunchApp ( "NOTEPAD.EXE", svTarget ^ "README.TXT" );
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 );
SetTitle( "Installiere " + 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 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;
bWin311 = FALSE;
bIsShellExplorer = FALSE;
if (nvResult = IS_WINDOWS ) then
bWin311 = TRUE;
endif;
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;