📄 setup.rul
字号:
begin
szLicenseFile = SUPPORTDIR ^ "license.txt";
szTitle = "";
szMsg = "";
szQuestion = "";
nResult = SdLicense( szTitle, szMsg, szQuestion, szLicenseFile );
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: DialogSdRegisterUser
//
// Purpose: This function asks the user who they are so that ater we can
// customize our interface for them.
//
///////////////////////////////////////////////////////////////////////////////
function DialogSdRegisterUser()
NUMBER nResult;
STRING szTitle, szMsg;
begin
szTitle = "User Info";
szMsg = "Please enter your first and last name below. " + @THE_PRODUCT_NAME_UC +
" will only use this information to customize its interface for" +
" you. Under no circumstance will this information be distributed.";
//nResult = SdRegisterUser( szTitle, szMsg, svFirstName, svLastName );
nResult = SdShowDlgEdit2( szTitle, szMsg, "First Name:", "Last Name:",
svFirstName, svLastName );
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: DialogAskForMusicFolder
//
// Purpose: This function asks the user for the music destination folder.
//
///////////////////////////////////////////////////////////////////////////////
function DialogAskForMusicFolder()
NUMBER nResult;
STRING szTitle, szMsg;
begin
szTitle = "Default Music Folder";
szMsg = @THE_PRODUCT_NAME_UC + " features the ability to download music " +
"directly from within the player. Where would you like to save " +
"your downloaded music files?";
SetDialogTitle(DLG_ASK_PATH, szTitle);
nResult = AskPath( szMsg, TARGETDIR ^ "My Music", svDefaultMusicDir);
StrRemoveLastSlash(svDefaultMusicDir);
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: DialogShowSdSetupType
//
// Purpose: This function displays the standard setup type dialog.
//
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdSetupType()
NUMBER nResult, nType;
STRING szTitle, szMsg;
begin
switch (svSetupType)
case "Typical":
nType = TYPICAL;
case "Custom":
nType = CUSTOM;
case "Compact":
nType = COMPACT;
case "":
svSetupType = "Typical";
nType = TYPICAL;
endswitch;
szTitle = "";
szMsg = "";
nResult = SdSetupType( szTitle, szMsg, svDir, nType );
//nResult = SdSetupTypeEx ( szTitle , szMsg , "" , svSetupType , 0 );
TARGETDIR = svDir;
switch (nResult)
case COMPACT:
svSetupType = "Compact";
case TYPICAL:
svSetupType = "Typical";
case CUSTOM:
svSetupType = "Custom";
endswitch;
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: DialogShowSdComponentDialog2
//
// Purpose: This function displays the custom component dialog.
//
//
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdComponentDialog2()
NUMBER nResult;
STRING szTitle, szMsg;
begin
if ((svSetupType != "Custom") && (svSetupType != "")) then
return 0;
endif;
szTitle = "";
szMsg = "";
//nResult = SdComponentDialog2( szTitle, szMsg, svDir, "" );
nResult = SdComponentMult ( szTitle , szMsg , TARGETDIR , "" );
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: DialogShowSdSelectFolder
//
// Purpose: This function displays the standard folder selection dialog.
//
//
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdSelectFolder()
NUMBER nResult;
STRING szTitle, szMsg;
begin
if (SHELL_OBJECT_FOLDER = "") then
SHELL_OBJECT_FOLDER = @PRODUCT_NAME + " " + @PRODUCT_VERSION;
endif;
szTitle = "";
szMsg = "";
nResult = SdSelectFolder( szTitle, szMsg, SHELL_OBJECT_FOLDER );
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: DialogShowSdStartCopy
//
// Purpose: This function displays the dialog preceding the start of the
// file transfer process.
//
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdStartCopy()
NUMBER nResult;
STRING szTitle, szMsg;
begin
szTitle = "";
szMsg = "";
nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: DialogShowAskAboutFileTypes
//
// Purpose: This function displays a dialog asking the user for permission
// to register filetypes.
//
///////////////////////////////////////////////////////////////////////////////
function DialogShowAskAboutFileTypes()
NUMBER nResult;
STRING szTitle, szMsg, szOpt1, szOpt2;
BOOL bOpt1, bOpt2;
begin
if ((svSetupType != "Custom") && (svSetupType != "")) then
return 0;
endif;
szTitle = "File Types";
szMsg = "Setup can register " + @THE_PRODUCT_NAME_LC + " to be your default MP3 player. " +
"Sometimes other applications register themselves to handle file types without " +
"asking for your permission. Do you want " + @THE_PRODUCT_NAME_LC + " to reclaim supported " +
"file types if they are registered by another application?\r\n\r\n" +
"Select the file type options you wish for setup to use. ";
szOpt1 = "Make " + @THE_PRODUCT_NAME_LC + " my default MP3 player.";
szOpt2 = "Allow " + @THE_PRODUCT_NAME_LC + " to reclaim stolen filetypes.";
bOpt1 = TRUE;
bOpt2 = FALSE;
SetDialogTitle(DLG_ASK_OPTIONS, szTitle);
nResult = AskOptions( NONEXCLUSIVE, szMsg, szOpt1, bRegisterFileTypes, szOpt2, bReclaimFileTypes);
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: DialogShowAskToRestartNetscape
//
// Purpose: This function displays a dialog if Netscape is installed asking
// for permission to restart Netscape so our filetypes will be
// properly associated.
//
///////////////////////////////////////////////////////////////////////////////
function DialogShowAskToRestartNetscape()
NUMBER nResult;
STRING szTitle, szMsg, szOpt1, szOpt2;
BOOL bOpt1, bOpt2;
begin
if(bNetscapeDetected = TRUE) then
szTitle = "Restart Netscape?";
szMsg = "Setup has detected that Netscape is installed on your computer. " +
"In order to complete the installation of " + @THE_PRODUCT_NAME_LC +
" we need to restart Netscape if it is running. After shutting down " +
"Netscape we will attempt to restart the application and " +
"return you to any web pages you are currently viewing.";
szOpt1 = "Yes, please restart Netscape for me. Thank you for asking!";
szOpt2 = "No, do not restart Netscape. I will restart Netscape myself.";
bOpt1 = TRUE;
bOpt2 = FALSE;
SetDialogTitle(DLG_ASK_OPTIONS, szTitle);
Disable(BACKBUTTON);
nResult = AskOptions( EXCLUSIVE, szMsg, szOpt1, bOpt1, szOpt2, bOpt2);
if(bOpt1 = TRUE) then
RestartNetscape();
endif;
endif;
return nResult;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: DialogShowSdFinishReboot
//
// Purpose: This function will show the last dialog of the product.
// It will allow the user to reboot and/or show some readme text.
//
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdFinishReboot()
NUMBER nResult, nDefOptions;
STRING szTitle, szMsg1, szMsg2, szOption1, szOption2,foo;
NUMBER bOpt1, bOpt2;
begin
if (!BATCH_INSTALL) then
bOpt1 = FALSE;
bOpt2 = TRUE;
szMsg1 = "Setup has finished installing " + @THE_PRODUCT_NAME_LC +
" on your computer. \r\n" +
"If you wish, Setup can display the Read Me File and launch " +
@THE_PRODUCT_NAME_LC + " for you. Choose the options you want below.";
szMsg2 = "";
szOption1 = "Read the Read Me file.";
szOption2 = "Launch " + @THE_PRODUCT_NAME_LC + ".";
nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );
if (bOpt1) then
// MessageBox(TARGETDIR^'\\Readme',INFORMATION);
LaunchApp(WINDIR^'Notepad.exe',TARGETDIR^'Readme.txt');
endif;
if (bOpt2) then
// MessageBox(TARGETDIR^'\\freeamp.exe',INFORMATION);
ChangeDirectory(TARGETDIR);
LaunchApp(@PRODUCT_KEY,'');
//nResult = CreateRegistrySet("RegisterFileTypes");
endif;
return 0;
endif;
nDefOptions = SYS_BOOTMACHINE;
szTitle = "";
szMsg1 = "";
szMsg2 = "";
nResult = SdFinishReboot( szTitle, szMsg1, nDefOptions, szMsg2, 0 );
return nResult;
end;
// --- include script file section ---
#include "sddialog.rul"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -