⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setup.rul

📁 这是一个mp3的源代码
💻 RUL
📖 第 1 页 / 共 3 页
字号:

////////////////////////////////////////////////////////////////////////////////
//
//  IIIIIII SSSSSS
//    II    SS                          InstallShield (R)
//    II    SSSSSS      (c) 1996-1997, InstallShield Software Corporation
//    II        SS      (c) 1990-1996, InstallShield Corporation
//  IIIIIII SSSSSS                     All Rights Reserved.
//
//
//  This code is generated as a starting setup template.  You should
//  modify it to provide all necessary steps for your setup.
//
//
//    File Name:  Setup.rul
//
//  Description:  InstallShield script
//
//     Comments:  This template script performs a basic setup. With minor
//                modifications, this template can be adapted to create
//                new, customized setups.
//
////////////////////////////////////////////////////////////////////////////////


// Include header files

    #include "sdlang.h"
    #include "sddialog.h"

////////////////////// string defines ////////////////////////////

    #define UNINST_LOGFILE_NAME      "Uninst.isu"

//////////////////// installation declarations ///////////////////

// ----- DLL function prototypes -----


    // your DLL function prototypes
    prototype BOOL FreeAmpCustomCode.InitDDE();
    prototype BOOL FreeAmpCustomCode.UninitDDE();
    prototype BOOL FreeAmpCustomCode.RestartNetscape();

// ---- script function prototypes -----


    // generated by the Project Wizard
    prototype ShowDialogs();
    prototype MoveFileData();
    prototype HandleMoveDataError( NUMBER );
    prototype ProcessBeforeDataMove();
    prototype ProcessAfterDataMove();
    prototype SetupRegistry();
    prototype SetupFolders();
    prototype CleanUpInstall();
    prototype SetupInstall();
    prototype SetupScreen();
    prototype CheckRequirements();
    prototype DialogShowSdWelcome();
    prototype DialogShowSdLicense();
    prototype DialogShowSdSetupType();
    prototype DialogShowSdComponentDialog2();
    prototype DialogShowSdSelectFolder();
    prototype DialogShowSdStartCopy();
    prototype DialogShowSdFinishReboot();

    // your script function prototypes
    prototype DialogSdRegisterUser();
    prototype DialogShowAskAboutFileTypes();
	prototype DialogShowAskToRestartNetscape();
	prototype DialogAskForMusicFolder();


    // ----- global variables ------

    // generated by the Project Wizard
    BOOL        bWinNT, bIsShellExplorer, bInstallAborted, bIs32BitSetup;
    STRING      svDir;
    STRING      svCompany, svSerial;
    STRING      svDefGroup;
    STRING      szAppPath;
    STRING      svSetupType;
    STRING		svProductName;
    STRING		svFolderName;
    STRING		svMainTitle;
    STRING		svUninstallDisplayName;
    STRING		svUninstallKey;

    LIST        listStartCopy;


    // your global variables
    STRING      svFirstName, svLastName;
    STRING		svDefaultMusicDir;
    BOOL		bNetscapeDetected;
    BOOL		bRegisterFileTypes, bReclaimFileTypes, bRegisterForRMPs;


///////////////////////////////////////////////////////////////////////////////
//
//   MAIN PROGRAM
//
//      The setup begins here by hiding the visible setup
//      window.  This is done to allow all the titles, images, etc. to
//      be established before showing the main window.  The setup is
//      then performed in a series of calls to script defined functions,
//      with error checking at each step.
//
///////////////////////////////////////////////////////////////////////////////
program
	SetColor (BACKGROUND, RGB (0, 0, 255) | BK_SMOOTH);
	UseDLL( SUPPORTDIR ^ "FreeAmpCustomCode.dll" );	
	
	InitDDE();
    // Disable( BACKGROUND );

    CheckRequirements();

    SetupInstall();

    SetupScreen();
    bRegisterFileTypes = TRUE;
    bReclaimFileTypes = TRUE;

    if (ShowDialogs()<0) goto end_install;

    if (ProcessBeforeDataMove()<0) goto end_install;

    if (MoveFileData()<0) goto end_install;

    if (ProcessAfterDataMove()<0) goto end_install;
	
    if (SetupRegistry()<0) goto end_install;

    if (SetupFolders()<0) goto end_install;

    end_install:

    CleanUpInstall();

    UninitDDE();
   	UnUseDLL( SUPPORTDIR ^ "FreeAmpCustomCode.dll" );

    // If an unrecoverable error occurred, clean up
    // the partial installation. Otherwise, exit normally.

    if (bInstallAborted) then
        abort;
    endif;

endprogram

///////////////////////////////////////////////////////////////////////////////
//
// Function:  ShowDialogs
//
//  Purpose:  This function manages the display and navigation of
//            the standard dialogs that exist in a setup.
//
///////////////////////////////////////////////////////////////////////////////
function ShowDialogs()
    NUMBER  nResult;

begin

    Dlg_Start:
    // beginning of dialogs label

    Dlg_SdWelcome:
    nResult = DialogShowSdWelcome();
    if (nResult = BACK) goto Dlg_Start;

    Dlg_SdLicense:
    nResult = DialogShowSdLicense();
    if (nResult = BACK) goto Dlg_SdWelcome;

    //Dlg_SdRegisterUser:
    //nResult = DialogSdRegisterUser();
    //if (nResult = BACK) goto Dlg_SdLicense;

    Dlg_SdSetupType:
    nResult = DialogShowSdSetupType();
    if (nResult = BACK) goto Dlg_SdLicense;
    //we are skipping registering the user for now
    //if (nResult = BACK) goto Dlg_SdRegisterUser;

    Dlg_SdComponentDialog2:
    if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then
        goto Dlg_SdSetupType;
    endif;
    nResult = DialogShowSdComponentDialog2();
    if (nResult = BACK) goto Dlg_SdSetupType;

    Dlg_SdFileTypes:
    if ((nResult = BACK) && (svSetupType != "Custom") && (svSetupType != "")) then
        goto Dlg_SdSetupType;
    endif;
    nResult = DialogShowAskAboutFileTypes();
    if (nResult = BACK) goto Dlg_SdComponentDialog2;

    Dlg_AskForMusicFolder:
    nResult = DialogAskForMusicFolder();
    if (nResult = BACK) goto Dlg_SdFileTypes;

    Dlg_SdSelectFolder:
    nResult = DialogShowSdSelectFolder();
    if (nResult = BACK) goto Dlg_AskForMusicFolder;


//    Dlg_SdStartCopy:
//    nResult = DialogShowSdStartCopy();
//    if (nResult = BACK) goto Dlg_SdSelectFolder;

    return 0;

end;

///////////////////////////////////////////////////////////////////////////////
//
// Function: ProcessBeforeDataMove
//
//  Purpose: This function performs any necessary operations prior to the
//           actual file transfer.
//
///////////////////////////////////////////////////////////////////////////////
function ProcessBeforeDataMove()
    STRING svLogFile;
    NUMBER nResult;
    STRING svVersion;

begin

  // Create app information, uninstallation, and App Paths registry keys.

	svVersion = @PRODUCT_VERSION + @VERSION_STRING_SPECIAL;
	
    InstallationInfo( @COMPANY_NAME, svProductName, svVersion, @PRODUCT_KEY );

    svLogFile = UNINST_LOGFILE_NAME;

    nResult = DeinstallStart( svDir, svLogFile, svUninstallKey, 0 );
    if (nResult < 0) then
        MessageBox( @ERROR_UNINSTSETUP, WARNING );
    endif;

    szAppPath = TARGETDIR; // TO DO : if your application .exe is in a subfolder
                           // of TARGETDIR then add subfolder

    if ((bIs32BitSetup) && (bIsShellExplorer)) then
        RegDBSetItem( REGDB_APPPATH, szAppPath );
        RegDBSetItem( REGDB_APPPATH_DEFAULT, szAppPath ^ @PRODUCT_KEY );
        RegDBSetItem( REGDB_UNINSTALL_NAME, svUninstallDisplayName );
    endif;

    // TO DO : any other tasks you want to perform before file transfer

    return 0;
end;

///////////////////////////////////////////////////////////////////////////////
//
//  Function:  MoveFileData
//
//  Purpose:  This function handles the file transfer for
//            the setup.
//
///////////////////////////////////////////////////////////////////////////////
function MoveFileData()
    NUMBER nResult, nDisk;

begin

    nDisk = 1;
    SetStatusWindow( 0, "" );
    Disable( DIALOGCACHE );
    Enable( STATUS );
    StatusUpdate( ON, 100 );
    nResult = ComponentMoveData( MEDIA, nDisk, 0 );

    HandleMoveDataError( nResult );

    Disable( STATUS );

    return nResult;

end;


///////////////////////////////////////////////////////////////////////////////
//
// Function: HandleMoveDataError
//
//  Purpose: This function handles the error (if any) during the file transfer
//           operation.
//
///////////////////////////////////////////////////////////////////////////////
function HandleMoveDataError( nResult )
    STRING szErrMsg, svComponent , svFileGroup , svFile;

begin

    svComponent = "";
    svFileGroup = "";
    svFile = "";

    switch (nResult)
        case 0:
            return 0;
        default:
            ComponentError ( MEDIA , svComponent , svFileGroup , svFile , nResult );
            szErrMsg = @ERROR_MOVEDATA  + "\n\n" +
                @ERROR_COMPONENT + " " + svComponent + "\n" +
                @ERROR_FILEGROUP + " " + svFileGroup + "\n" +
                @ERROR_FILE      + " " + svFile;
            SprintfBox( SEVERE, @PRODUCT_NAME + " Setup", szErrMsg, nResult );
            bInstallAborted = TRUE;
            return nResult;
    endswitch;

end;

///////////////////////////////////////////////////////////////////////////////
//
// Function: ProcessAfterDataMove
//
//  Purpose: This function performs any necessary operations needed after
//           all files have been transferred.
//
///////////////////////////////////////////////////////////////////////////////
function ProcessAfterDataMove()
    STRING szReferenceFile;

begin

    // TO DO : update self-registered files and other processes that
    //        should be performed after the files have been transferred.

    // DeinstallSetReference specifies a file to be checked before
    // uninstallation. If the file is in use, uninstallation will not proceed.

    szReferenceFile = svDir ^ @PRODUCT_KEY; // TO DO : If your file is in a
                                            // subfolder of svDir add that here
    DeinstallSetReference( szReferenceFile );

    return 0;
end;

///////////////////////////////////////////////////////////////////////////////
//
// Function: SetupRegistry

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -