📄 setup.rul
字号:
/*----------------------------------------------------------------------------*\
*
* IIIIIII SSSSSS
* II SS InstallSHIELD (R)
* II SSSSSS (c) 1990-1995, Stirling Technologies, Inc.
* II SS All Rights Reserved.
* IIIIIII SSSSSS
*
*
* This source code is intended as a supplement to Stirling Technologies,
* Inc., product documentation. Refer to your Stirling Technologies, Inc.,
* product documentation for more detailed information.
*
*
* File Name: SETUP.RUL
*
* Description: InstallSHIELD SDK Edition MFC Sample script.
*
*
*
*
* Author: Stirling Technologies, Inc. Date: 2-4-95
*
* Comments: This sample script installs a simple MFC application
* to a Windows 95 or Windows NT platform. The installation
* includes application program files, sample files,
* and help files. For information on using this script,
* see the file README.TXT.
* With minor modifications, this script can be
* adapted to create new, customized installations.
*
*
*
\*----------------------------------------------------------------------------*/
// Size of components.
#define SIZE_REQ_SAMPLES 12000
#define SIZE_REQ_HELP 32000
#define SIZE_REQ_PROGRAM 1300000
#define APP_NAME "Drawing Client"
#define PROGRAM_GROUP_NAME "YourCompany Applications"
#define APPBASE_PATH "YourCompany\\DrawCli\\"
#define COMPANY_NAME "YourCompany"
#define PRODUCT_NAME "Drawing Client"
#define PRODUCT_VERSION "2.0"
#define PRODUCT_KEY "drawcli.exe"
#define UNINSTALL_KEY "DrawCliV3"
#define APPBASE_DIR95 "Program Files"
#define BASE_REGISTRYNT "Software\\Microsoft\\Windows NT\\CurrentVersion\\App Paths\\"
#define BASE_REGISTRY95 "Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\"
#define STR_COMPLETE95 "by selecting the program icon in the Programs menu.\n\n"
#define STR_COMPLETENT "by selecting the program icon in the program group.\n\n"
declare
// Global variable declarations.
STRING svGrp, szMsg, szFileSet, szTitle, szAppPath, szAppSharedDir;
STRING szProgram, szTemp, svUninstLogFile, szRegKey;
STRING svMainDirectory[ _MAX_STRING ];
BOOL bSpaceOk, bReshowSetupType;
NUMBER nResult, nStatusId, nType;
BOOL bIncludeProgram, bIncludeSamples, bIncludeHelp;
BOOL bWinNT;
// Function declarations.
prototype SetupScreen();
prototype CheckRequirements();
prototype CheckSpaceRequirements( number, number, number, string );
prototype CreateRegDBEntries();
program
StartHere:
Disable( BACKGROUND );
// Set up the installation screen.
SetupScreen();
// Set installation info., which is required for registry entries.
InstallationInfo( COMPANY_NAME, PRODUCT_NAME, PRODUCT_VERSION, PRODUCT_KEY );
// Create a Welcome dialog.
WelcomeDlg:
Disable( BACKBUTTON );
Welcome( "Welcome", 0 );
Enable( BACKBUTTON );
// Test target system proper configuration.
CheckRequirements();
// Ask user for a destination location for the installation.
GetTargetDirectory:
svMainDirectory = TARGETDISK ^ APPBASE_DIR95 ^ APPBASE_PATH;
szMsg = "Please enter the destination path\n"+
"To accept the default, select > (Next)";
if ( AskDestPath( "Choose Destination Location", szMsg,
svMainDirectory, 0 ) = BACK ) then
goto WelcomeDlg;
endif;
szAppSharedDir = svMainDirectory ^ "System";
nType = TYPICAL;
DetermineUserSelection:
nType = SetupType( "Selection of Installation Type", "", svMainDirectory, nType, 0 );
if ( nType = BACK ) then goto GetTargetDirectory; endif;
bReshowSetupType = FALSE;
switch (nType)
case TYPICAL:
bIncludeSamples = TRUE;
bIncludeProgram = TRUE;
bIncludeHelp = TRUE;
case COMPACT:
bIncludeProgram = TRUE;
case CUSTOM:
SetDialogTitle( DLG_ASK_OPTIONS, "Select Components" );
bIncludeSamples = TRUE;
bIncludeProgram = TRUE;
bIncludeHelp = TRUE;
szMsg = "Select the components that you wish to install.\n"+
"If the check box is unchecked, that component will not be "+
"installed. Click Next to continue with the installation.";
nResult = AskOptions( NONEXCLUSIVE, szMsg,
"Application Program Files", bIncludeProgram,
"Sample Files", bIncludeSamples,
"On-Line Help Files", bIncludeHelp );
if ( nResult = BACK ) then goto DetermineUserSelection; endif;
// Handle user clicking Cancel button.
if (nResult = CANCEL) then
if (AskYesNo( "Are you sure you would like to exit setup?", NO ) = YES) then
abort;
else
bReshowSetupType = TRUE;
endif;
endif;
endswitch;
if (bReshowSetupType = TRUE) then goto DetermineUserSelection; endif;
// Check to see if target system meets space requirements.
bSpaceOk = CheckSpaceRequirements( bIncludeSamples,
bIncludeProgram,
bIncludeHelp,
svMainDirectory );
// Ask user to try again if not enough space available.
if (bSpaceOk = FALSE) then goto DetermineUserSelection; endif;
FolderSelection:
if ( bWinNT ) then
svGrp = PROGRAM_GROUP_NAME;
// Allow user to modify folder name.
if ( SelectFolder( "Folder Selection", svGrp, svGrp ) = BACK ) then
goto DetermineUserSelection;
endif;
endif;
FileTransferSetup:
// Prepare InstallSHIELD to record deinstallation information.
DeinstallStart( svMainDirectory, svUninstLogFile, UNINSTALL_KEY, 0 );
RegDBSetItem( REGDB_UNINSTALL_NAME, APP_NAME );
// Set registry App Paths key information for the main application.
szAppPath = svMainDirectory ^ "PROGRAM" + ";" + szAppSharedDir;
RegDBSetItem( REGDB_APPPATH, szAppPath );
szProgram = svMainDirectory ^ "PROGRAM\\drawcli.exe";
RegDBSetItem( REGDB_APPPATH_DEFAULT, szProgram );
// Define the "General" file set.
szFileSet = "General";
TARGETDIR = svMainDirectory;
FileSetBeginDefine( szFileSet );
SetStatusWindow( -1, "Copying program files..." );
// Always copy README & related files, located at
// the root level in the DATA.Z library file.
CompressGet( "data.z", "*.*", COMP_NORMAL );
if (bIncludeProgram) then
TARGETDIR = svMainDirectory ^ "PROGRAM";
CompressGet( "data.z", "program\\*.*", INCLUDE_SUBDIR );
if ( bWinNT ) then
TARGETDIR = TARGETDISK ^ "\\WINNT35\\SYSTEM32";
else
TARGETDIR = TARGETDISK ^ "\\WINDOWS\\SYSTEM";
endif;
CompressGet( "data.z", "shared\\*.*",
SHAREDFILE | COMP_UPDATE_VERSION );
// CompressGet( "data.z", "shared\\*.*", COMP_NORMAL );
// TARGETDIR = szAppSharedDir;
// CompressGet( "data.z", "shared\\*.*", SHAREDFILE | COMP_NORMAL );
endif;
if (bIncludeSamples) then
TARGETDIR = svMainDirectory ^ "SAMPLES";
CompressGet( "data.z", "samples\\*.*", INCLUDE_SUBDIR );
endif;
if (bIncludeHelp) then
TARGETDIR = svMainDirectory ^ "HELP";
CompressGet( "data.z", "help\\*.*", INCLUDE_SUBDIR );
endif;
FileSetEndDefine( szFileSet );
DoFileTransfer:
// Set up progress indicator and information gauge.
Enable( STATUSDLG );
StatusUpdate( ON, 50 );
// Perform the file set.
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 );
abort;
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, SEVERE );
abort;
endswitch;
SetRegistryEntries:
CreateRegDBEntries( );
Delay(2);
Disable( FEEDBACK_FULL );
Disable( STATUSDLG );
// Create program groups (folders) and icons.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -