SetStatusWindow Example

InstallShield 2015 ยป InstallScript Language Reference

This function cannot be used in a Basic MSI installation.

/*--------------------------------------------------------------*\

*

* InstallShield Example Script

*

* Demonstrates the SetStatusWindow function.

*

* SetStatusWindow is called to set the progress bar and

* to display text in the progress indicator.

*

* Note: Before running this script, create the directories

*       and file referenced by the preprocessor constants.

*

\*--------------------------------------------------------------*/

 

#define  SOURCE_DIR  "C:\\Source"

#define  TARGET_DIR  "C:\\Target"

#define  TARGET_FILE "ISExampl.txt"

 

// Include Ifx.h for built-in InstallScript function prototypes.

#include "Ifx.h"

 

  export prototype ExFn_SetStatusWindow(HWND);

 

function ExFn_SetStatusWindow(hMSI)

begin

 

    // Enable progress indicator.

    Enable (STATUS);

    

    // Set the progress bar to 33% and display a message.

    SetStatusWindow (33, "Now copying file...");

    

    // Delay for two seconds to ensure the window is displayed correctly.

    Delay (2);

    

    // Copy the file in the source directory to the target directory

    CopyFile (SOURCE_DIR ^ TARGET_FILE, TARGET_DIR ^ TARGET_FILE);

    

    // Set the progress bar to 66% and display a message.

    SetStatusWindow (66, "Now deleting file...");

    Delay (2);

    

    // Delete copied file in the Target directory.

    DeleteFile (TARGET_FILE);

    

    // Set the percent indicator to 100% and display a message.

    SetStatusWindow (100, "SetStatusWindow example completed.");

    Delay (2);

 

end;