Windows Installer, Java Installer, Freeware Installer
Home|Contact|Site Map|TOC|Search
Download  Features   Java  Licensing  Purchase  Testimonials  Support  Forums

Conditionally displaying an install dialog.

This tutorial will show how to include a dialog that will be displayed during installation only when a certain condition is satisfied.

Let's assume that you want the user to see the release notes of your application only if he desires. To do this you will add a dialog to your project that contains the release notes. The predefined Readme dialog should be appropriate for this task. The user selection will be retrieved with the use of a CheckBox control.

The general method for conditionally displaying a dialog is to configure the Published Events for the Next and Back buttons from the dialogs that precede and respectively follow the conditional dialog.

  1. Creating the project.
  2. Adding the dialog to the project
  3. Add the CheckBox that the user will select
  4. Setting the published events
  5. Run the project

Creating the project.

Create an enterprise project.

Add the necessary files to the package. For more details please see the Professional Installation tutorial.

Adding the dialog to the project

After adding the files, add the predefined Readme dialog.

DialogsSwitch to the Dialogs page.

The dialog should be displayed during a normal installation so we will add it in the "First Time Install" section of the "Install Sequence" tree, under the FolderDlg dialog.

New DialogSelect "FolderDlg" in the tree and use the [ Add Dialog ] toolbar button. In the Add Dialog dialog select the "ReadmeDlg" item from the "Built-in" dialog list.

Specify the path of the RTF file that contains the release notes of the application in the "File Path" field of the Properties pane. This field is available when the "Scrollable Edit" control is selected on the dialog.

Add the CheckBox that the user will select

Select the "FolderDlg" item in the tree.

Add ControlUse the [ New Control ] toolbar button to add a new Check Box control.

In the Properties pane set the following attributes for this control:

Name=ViewReleaseNotesCheckBox
Text=View release notes
Property Name=ViewReleaseNotes
Value=yes
      

Setting the published events

We shall configure two "NewDialog" published events for the Next button from the FolderDlg dialog. One of them will invoke "ReadmeDlg" (if the user selects the CheckBox and the ViewReleaseNotes property is set to "yes") and the other will trigger "VerifyReadyDlg" (if the CheckBox is not selected and the ViewReleaseNotes property is not set). The screenshot below illustrates how the events are set:

Next Control Events

We shall use the same approach for the Back button from "VerifyReadyDlg" as shown below:

Back Control Events

Run the project

BuildThe project is now complete, build and run the package.

NoteIn this tutorial we have used the property attached to a CheckBox control to configure the condition for an install dialog. However, any predefined Windows Installer or user-defined property could be used to condition a dialog.

Privacy Policy | Windows Installer | Search Engine Ranking | Link Analyzer