This tutorial will show how to include a dialog that will be displayed during installation only when a checkbox is ticked.
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.
- 1. Create project
- 2. Add a dialog to the project
- 3. Add the CheckBox which conditions the dialog
- 4. Condition the dialog to appear only when the checkbox is enabled
- 5. Run the project
1. Create project
Create an Enterprise project and add the necessary files to the package. For more details please see the Professional Installation tutorial.
2. Add a dialog to the project
In this tutorial we will add the predefined ReadmeDlg dialog after the FolderDlg dialog located in the "First Time Install" section of the "Install Sequence" tree.
Go to the Dialogs page.
- Select the FolderDlg dialog and use the toolbar button or the "Add Dialog..." context menu option
- In the Add Dialog select the ReadmeDlg dialog
- Select the "Scrollable Edit" control from the ReadmeDlg dialog
- In the "File Path" field from the Properties pane specify the path to the .RTF file
3. Add the CheckBox which conditions the dialog
- Select the FolderDlg item in the tree
- Use the 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
4. Condition the dialog to appear only when the checkbox is enabled
- Select the ReadmeDlg item from the tree and from the context menu select the Show only if... option
- The Edit Condition Dialog will appear
- In the Condition field write ViewReleaseNotes = "yes"
5. Run the project
The project is now
complete, build and run the package.
In 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.
The End
This concludes our tutorial. To learn more, please read the Creating Billboards tutorial.