If you play with sample SharpSetup installer solution dialogs and other dialog that may be added to your installer you will notice that steps use ordinary WinForms controls (such as labels, text boxes, radio buttons, check boxes, etc.) as well as special SharpSetup controls that interact with Windows Installer. Read below to learn about these controls.
If you open any step of your installer in Visual Studio designer you will have the following SharpSetup controls available in toolbox:
Control used on installation location step to set target path of the installation. It consists of a TextBox control and a Button control which opens folder selection dialog. Besides standard control settings there are two properties specific to DestinationPath control:
- DefaultPathSuffix - this is the text that will be added to path selected in folder selection dialog; by default it is application name,
- LocationProperty - name of Windows Installer path to get/set. By default INSTALLLOCATION path is manipulated by this control.
This control may be used to display disk space required by current installation along with available space, remaining space and total space for each drive separately. As the name suggests the control has a form of a list.
This is the most complex control provided with SharpSetup. It displays features of msi package in form of a tree allowing user to mark and unmark some of them for installation. You can configure initial state of a feature, whether feature state can be changed, whether feature node will be expanded of collapsed and whether feature will be displayed at all. All these settings can be controlled from WiX code, mostly by using attributes of Feature XML element in *.wxs file of Package project. This control is quite complex so it deserves seperate article to describe how it behaves.
This control allows for installation mode selection. Installtion mode may be one of: install, uninstall, reinstall, upgrade, modify, custom. You can configure available modes through Modes property. Default mode can be set through SelectedMode property. You can also use this property to read value selected by user. To configure how radio buttons are spaced you can use CellPadding property.
This control displays installtion progress. It consists of a Label control and ProgressBar control. How InstallationProgress control behaves is determined to large extent by Windows Installer internals. However it can be influenced to a certain extent by using UI/ProgressText XML elements in *.wxs file. You may send varoious messages (ActionStart/ActionData/Progress) from your custom actions to be displayed in installation progress control. This control is used in installation step.
You may use this control to present user with information whether all prerequsites of your program are satisfied. The control provides you with two events: OnCheck (raised when given prerequsite is to be checked) and OnFinish (when checking is complete and you can act on final result). The list of items to be checked can be configured using CheckItems property and final result may be read from Status property. To get an idea of how PrerequisiteList control may be used please have a look at prerequisite check step.
This control has similar purpose to the DiskCostList control: display information about space requirements of the installation. The difference is that SimpleDiskCostBox shows information about one disk only (the one on which application is to be installed) and does that in form of a group box with labels. You can configure which information will be displayed (total, available, required, remaining disk space) using InfoTypes property of the control.
Previous in series: Step lifecycle
Next in series: FeatureTree control