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

How do I launch a file after an installation?

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 only files.

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 shown).

WarningIf the installation will run on Windows Vista 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:

  • create the custom action under "UI Custom Actions" (instead of "InstallExecuteSequence" -> "InstallFinalize")
  • go to the Dialogs page and select the "Finish" button
  • go to the "Published Events Tab" and add this control event:
DoAction   myapp.exe   AI_INSTALL

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

NoteNote that this can be done only in an Enterprise project.

If you want to let the user choose if the custom action runs (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")
  • modify the "DoAction" control event to use the property of the checkbox:
DoAction   myapp.exe   AI_INSTALL AND CHECK

This way, the custom action will run only 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.

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