Last technical article (about translations) was quite demanding. This time however we will have a look at somewhat simpler area that is managing steps in main installer GUI. We will see what dialogs are provided by SharpSetup, how they can be added to your installer solution and how to schedule them for display.

Just after creating SharpSetup solution in Visual Studio your installer will have only the most basic installer steps that is initialization step, welcome step, installation step, finish step, fatal error step and installation mode step. This very basic set of 6 steps (used depending on installation mode) can easily be extended by adding other steps. Here is the list of all step templates available with SharpSetup:

  • InitializationStep - used to inform the user that basic installer initialization like reading MSI file, costing, searching for registry keys, etc. is in progress.
  • WelcomeStep - when installer is ready welcome step is displayed to greet the user, inform about program name and present other general information.
  • PrerequisiteCheckStep - you can use the step to show a list of requirements of your software with an indication whether given requirement is fulfilled, partially fulfilled (warning) or not fulfilled (error).
  • UserRegistrationStep - may be used if you want to collect some information from user such as name, company name, product key, etc.
  • LicenseStep - used to display license agreement to the user. User will have to accept the license before continuing with the installation.
  • InstallationTypeStep - user will have a choice between main installation types such as default, full and custom.
  • InstallationLocationStep - provides user with an option to change destination path of the installation.
  • FeatureSelectionStep - provides user with an ability to select features one by one. The dialog contains feature tree, feature description and disk space utilization information.
  • InstallationModeStep - allows user to select between installation, reinstallation, upgrade and uninstall modes.
  • FatalErrorStep - shown to the user when setup cannot continue (for example newer version of your software is already installed).
  • ReadyStep - may be shown when all information has been collected and the installation is ready to begin.
  • InstallationStep - shows user progress of the installation using progress bar and status messages.
  • FinishStep - usually shown after InstallationStep as the last installer step.

So how can these steps be added to your installer? Just right-click on Gui project and select Add->New Item... menu item. In the Add New Item dialog select SharpSetup on left-hand side tree and then select specific dialog in the right part of the dialog. Next give a name to your dialog and click OK. Now the dialog is part of your SharpSetup installer solution but if you try to build and run the installer you will notice that it is not displayed anywhere. This is because you have to instantiate the dialog and schedule it to be used in the right moment of the installation sequence. To do that open SetupWizard.cs file (view code) and locate LifecycleAction method -> ModeSelected lifecycle action type and appropriate InstallationMode (Install, Uninstall, Upgrade, Reinstall). Then just insert the following line where you want your dialog to appear:

AddStep(new YourNewStep());

You may of course add the dialog to more than one installation mode, check any conditions before adding it, etc. You should also note that steps may also be added for Initialization and ConnectionOpened lifecycle action types - this is the case for InitializationStep, WelcomeStep and InstallationModeStep. Most of the time however you will use ModeSelected lifecycle action type.

Next article will focus on step lifecycle and events.

Previous in series: Multilanguage installers

Next in series: Step lifecycle