Answer

For some installation packages you may want to launch a file or open a folder or an URL after the install process is finished. This can be done in two ways:

1. The user can decide if the file will be launched

For this, you can follow these steps:

  • go to the Dialogs page and select "ExitDialog"
  • select the "Finish" button and select the Finish Actions tab in the "Control" section
  • enable the "Launch application at the end of the installation" option
  • select the file you want to launch

ImportantThis method doesn't allow you to launch an URL or a folder, it allows you to launch files only.

2. The user cannot decide if the file will be launched

For this you can use a custom action scheduled under the "InstallExecuteSequence" -> "InstallFinalize" standard action (you can use the "Launch file or open URL custom action" for example). This custom action will have the "Expression" field in the "Execution Condition" section set to "NOT Installed". In order to use the custom action you can follow these steps:

  • go to the Custom Actions page
  • use the "Show Standard Action" button to show the "Before Finalization" -> "InstallFinalize" standard action
  • under it create a "Launch file or open URL" custom action
  • set the "Command Line" field to the path of the file or folder you want to open (you can also set an URL)
  • set the "Expression" field in the "Execution Condition" section to (Not Installed)

NoteWith this method, the file, folder or URL will be launched when the install process is complete (when "ExitDialog" is showed).

Warning!If the installation will run on Windows Vista or above, the custom action should be moved under "InstallExecuteSequence" -> "PublishProduct". Also, it should be set as "Deferred with no impersonation".

If you want to run the custom action when the user clicks the "Finish" button on "ExitDialog" you can follow these steps:

  • make sure you are using at least an Enterprise or Architect project (you can change the project type using the Project -> Options menu)
  • go to "Dialogs" page and select "ExitDialog"
  • select the Finish Actions tab
  • enable launch application feature for the file you want to launch
  • make sure that the Checked by default option is set
  • select the launch application text control and set the "Visible" flag to False in its Properties pane
  • do the same for the checkbox control
DoAction   myapp.exe   AI_INSTALL

where "myapp.exe" is the custom action you created

TipThis functionality requires at least an Enterprise license.

If you want to let the user decide whether or not the custom action should run (the file, folder or URL is launched), you can use a custom checkbox:

  • create a checkbox control on "ExitDialog"
  • in the Properties section set the "Property Name" field to CHECK
  • in the "Text" field set the text of the checkbox (for example "Launch the application")
  • in the Custom Actions Page, add "Launch file or open URL" as an UI Custom Action
  • add a "DoAction" published event on the "Finish" button that executes the "Launch file or open URL" custom action
  • modify the "DoAction" control event's condition to use the property of the checkbox:
DoAction   myapp.exe   AI_INSTALL AND CHECK

This way, the custom action will only run if the checkbox is selected. If you want the checkbox to be selected by default, you can set any value in the "Default Value" field.