📄 setup.rul
字号:
//
// Purpose: This function makes the registry entries for this setup.
//
///////////////////////////////////////////////////////////////////////////////
function SetupRegistry()
NUMBER nResult, nType, nSize;
STRING szKey, szNetscapeKey1, szNetscapeKey2, szReclaimFileTypes;
STRING szUserName, szUserNameKey;
BOOL bInLocalMachine, bInCurrentUser;
begin
// TO DO : Add all your registry entry keys here.
// Call registry functions and/or create keys from
// the InstallShield IDE's Resources pane.
bRegisterForRMPs = TRUE;
// First set up the default registry entries
nResult = CreateRegistrySet("MainSet");
nResult = CreateRegistrySet("FreeAmpSet");
nResult = CreateRegistrySet("DSoundSet");
nResult = CreateRegistrySet("SoundCardSet");
if(bRegisterFileTypes = TRUE) then
nResult = CreateRegistrySet("RegisterFileTypes");
// RMP support
if(bRegisterForRMPs = TRUE) then
nResult = CreateRegistrySet("RegisterRMPFileType");
endif;
endif;
// We want to look under HKEY_CURRENT_USER
RegDBSetDefaultRoot(HKEY_CURRENT_USER);
//szKey = "Software\\" + @COMPANY_NAME + "\\" + @PRODUCT_NAME +
// " v" + @PRODUCT_VERSION + "\\Main";
szKey = @MAIN_REGISTRY_KEY;
szUserNameKey = "Software\\Microsoft\\MS Setup (ACME)\\User Info";
// Create the ones that are dynamic
//szUserName = svFirstName + " " + svLastName;
RegDBGetKeyValueEx(szUserNameKey, "DefName", nType, szUserName, nSize);
RegDBSetKeyValueEx(szKey, "UserName", REGDB_STRING, szUserName, -1);
RegDBSetKeyValueEx(szKey, "SaveMusicDirectory", REGDB_STRING, svDefaultMusicDir, -1);
if(bReclaimFileTypes = TRUE) then
szReclaimFileTypes = "1";
else
szReclaimFileTypes = "0";
endif;
RegDBSetKeyValueEx(szKey, "ReclaimFileTypes", REGDB_NUMBER, szReclaimFileTypes, -1);
// Finally we need to let Netscape know to use us
bNetscapeDetected = FALSE;
szNetscapeKey1 = "Software\\Netscape\\Netscape Navigator\\Main";
szNetscapeKey2 = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\Netscape.exe";
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
if(RegDBKeyExist(szNetscapeKey2) = 1) then bInLocalMachine = TRUE; endif;
RegDBSetDefaultRoot(HKEY_CURRENT_USER);
if(RegDBKeyExist(szNetscapeKey1) = 1) then bInCurrentUser = TRUE; endif;
if(bInLocalMachine = TRUE && bInCurrentUser = TRUE) then
bNetscapeDetected = TRUE;
// RMP support
if(bRegisterForRMPs = TRUE) then
szKey = "Software\\Netscape\\Netscape Navigator\\Suffixes";
RegDBSetKeyValueEx(szKey, "application/vnd.rn-rn_music_package", REGDB_STRING, "rmp", -1);
szKey = "Software\\Netscape\\Netscape Navigator\\Viewers";
RegDBSetKeyValueEx(szKey, "application/vnd.rn-rn_music_package", REGDB_STRING, szAppPath ^ @PRODUCT_KEY, -1);
szKey = "Software\\Netscape\\Netscape Navigator\\User Trusted External Applications";
RegDBSetKeyValueEx(szKey, szAppPath ^ @PRODUCT_KEY, REGDB_STRING, "Yes", -1);
endif;
if(bRegisterFileTypes = TRUE) then
// MP3 support
szKey = "Software\\Netscape\\Netscape Navigator\\Suffixes";
RegDBSetKeyValueEx(szKey, "audio/x-mpeg", REGDB_STRING, "mp1,mp2,mp3", -1);
RegDBSetKeyValueEx(szKey, "audio/x-mp3", REGDB_STRING, "mp3", -1);
RegDBSetKeyValueEx(szKey, "audio/x-mpegurl", REGDB_STRING, "m3u", -1);
RegDBSetKeyValueEx(szKey, "audio/x-scpls", REGDB_STRING, "pls", -1);
// Some Apps are idiots and register these so if we do not
// there is a chance Netscape will ignore the actual
// mimetype above...grrr...
RegDBSetKeyValueEx(szKey, "audio/mpeg", REGDB_STRING, "mp1,mp2,mp3", -1);
RegDBSetKeyValueEx(szKey, "audio/mp3", REGDB_STRING, "mp3", -1);
RegDBSetKeyValueEx(szKey, "audio/mpegurl", REGDB_STRING, "m3u", -1);
RegDBSetKeyValueEx(szKey, "audio/scpls", REGDB_STRING, "pls", -1);
szKey = "Software\\Netscape\\Netscape Navigator\\Viewers";
RegDBSetKeyValueEx(szKey, "audio/x-mpeg", REGDB_STRING, szAppPath ^ @PRODUCT_KEY, -1);
RegDBSetKeyValueEx(szKey, "audio/x-mp3", REGDB_STRING, szAppPath ^ @PRODUCT_KEY, -1);
RegDBSetKeyValueEx(szKey, "audio/x-mpegurl", REGDB_STRING, szAppPath ^ @PRODUCT_KEY, -1);
RegDBSetKeyValueEx(szKey, "audio/x-scpls", REGDB_STRING, szAppPath ^ @PRODUCT_KEY, -1);
// Some servers are idiots and send these so if we do not
// there is a chance Netscape will not find the real type
RegDBSetKeyValueEx(szKey, "audio/mpeg", REGDB_STRING, szAppPath ^ @PRODUCT_KEY, -1);
RegDBSetKeyValueEx(szKey, "audio/mp3", REGDB_STRING, szAppPath ^ @PRODUCT_KEY, -1);
RegDBSetKeyValueEx(szKey, "audio/mpegurl", REGDB_STRING, szAppPath ^ @PRODUCT_KEY, -1);
RegDBSetKeyValueEx(szKey, "audio/scpls", REGDB_STRING, szAppPath ^ @PRODUCT_KEY, -1);
szKey = "Software\\Netscape\\Netscape Navigator\\User Trusted External Applications";
RegDBSetKeyValueEx(szKey, szAppPath ^ @PRODUCT_KEY, REGDB_STRING, "Yes", -1);
endif;
endif;
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: SetupFolders
//
// Purpose: This function creates all the folders and shortcuts for the
// setup. This includes program groups and items for Windows 3.1.
//
///////////////////////////////////////////////////////////////////////////////
function SetupFolders()
NUMBER nResult;
STRING szPath;
begin
// TO DO : Add all your folders (or program groups) along with shortcuts (or
// program items). Call CreateProgramFolder and AddFolderIcon, and/or create
// shortcuts etc. from the InstallShield IDE's Resources pane.
//
// Note : for 16-bit setups you should add an uninstaller icon pointing to
// your log file. Under 32-bit this is automatically done by Windows.
nResult = CreateShellObjects( "" );
ProgDefGroupType(PERSONAL);
szPath = TARGETDIR ^ "FreeAmp.exe";
LongPathToQuote(szPath, TRUE);
nResult = AddFolderIcon(FOLDER_PROGRAMS ^ SHELL_OBJECT_FOLDER,
@PRODUCT_NAME,
szPath,
"",
"",
0,
"",
REPLACE);
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: CleanUpInstall
//
// Purpose: This cleans up the setup. Anything that should
// be released or deleted at the end of the setup should
// be done here.
//
///////////////////////////////////////////////////////////////////////////////
function CleanUpInstall()
begin
ListDestroy( listStartCopy );
if (bInstallAborted) then
return 0;
endif;
DialogShowAskToRestartNetscape();
DialogShowSdFinishReboot();
if (BATCH_INSTALL) then // ensure locked files are properly transferred
CommitSharedFiles(0);
endif;
return 0;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: SetupInstall
//
// Purpose: This will initialize the setup. Any general initialization
// needed for the installation should be performed here.
//
///////////////////////////////////////////////////////////////////////////////
function SetupInstall()
begin
Enable( CORECOMPONENTHANDLING );
bInstallAborted = FALSE;
// Append product version to appropriate strings
svProductName = @PRODUCT_NAME + " " + @PRODUCT_VERSION + @VERSION_STRING_SPECIAL;
svFolderName = @FOLDER_NAME;// + " " + @PRODUCT_VERSION;
svMainTitle = svProductName;
svUninstallDisplayName = @UNINST_DISPLAY_NAME + " " + @PRODUCT_VERSION + @VERSION_STRING_SPECIAL;
svUninstallKey = @UNINST_KEY + " " + @PRODUCT_VERSION + @VERSION_STRING_SPECIAL;
// Create list of end user selections to be displayed by DialogShowSdStartCopy() //
listStartCopy = ListCreate(STRINGLIST);
ListAddString( listStartCopy, "Place the summary here.", AFTER );
if (bIs32BitSetup) then
svDir = PROGRAMFILES ^ svFolderName;
else
svDir = PROGRAMFILES ^ svFolderName; // use short names
endif;
TARGETDIR = svDir;
SdProductName( svProductName );
Enable( DIALOGCACHE );
return 0;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: SetupScreen
//
// Purpose: This function establishes the screen look. This includes
// colors, fonts, and text to be displayed.
//
///////////////////////////////////////////////////////////////////////////////
function SetupScreen()
begin
Enable( FULLWINDOWMODE );
Enable( INDVFILESTATUS );
SetTitle( svMainTitle, 24, WHITE );
SetTitle( @PRODUCT_NAME + " Setup", 0, BACKGROUNDCAPTION ); // Caption bar text.
Enable( BACKGROUND );
Delay( 1 );
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: CheckRequirements
//
// Purpose: This function checks all minimum requirements for the
// application being installed. If any fail, then the user
// is informed and the setup is terminated.
//
///////////////////////////////////////////////////////////////////////////////
function CheckRequirements()
NUMBER nvDx, nvDy, nvResult;
STRING svResult;
begin
bWinNT = FALSE;
bIsShellExplorer = FALSE;
// Check screen resolution.
GetExtents( nvDx, nvDy );
if (nvDy < 480) then
MessageBox( @ERROR_VGARESOLUTION, WARNING );
abort;
endif;
// set 'setup' operation mode
bIs32BitSetup = TRUE;
GetSystemInfo( ISTYPE, nvResult, svResult );
if (nvResult = 16) then
bIs32BitSetup = FALSE; // running 16-bit setup
return 0; // no additional information required
endif;
// --- 32-bit testing after this point ---
// Determine the target system's operating system.
GetSystemInfo( OS, nvResult, svResult );
if (nvResult = IS_WINDOWSNT) then
// Running Windows NT.
bWinNT = TRUE;
// Check to see if the shell being used is EXPLORER shell.
if (GetSystemInfo( OSMAJOR, nvResult, svResult ) = 0) then
if (nvResult >= 4) then
bIsShellExplorer = TRUE;
endif;
endif;
elseif (nvResult = IS_WINDOWS95 ) then
bIsShellExplorer = TRUE;
endif;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: DialogShowSdWelcome
//
// Purpose: This function handles the standard welcome dialog.
//
//
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdWelcome()
NUMBER nResult;
STRING szTitle, szMsg;
begin
szTitle = "";
szMsg = "";
nResult = SdWelcome( szTitle, szMsg );
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: DialogShowSdLicense
//
// Purpose: This function displays the license agreement dialog.
//
//
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdLicense()
NUMBER nResult;
STRING szTitle, szMsg, szQuestion, szLicenseFile;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -