How to single-click run my application from its installation package?

ImportantThe following article uses options that are available starting with the Professional edition and project type.

The solution is to create a compact installation package that will launch your application whether it's installed on the target machine or not. As a result, your clients will always launch the application when they execute its installation file.

If it's the first time install, your application will be launched after a simple progress unattended installation. If the package is already installed, the application should launch directly.

This article will guide you step by step through the required settings in your Advanced Installer project:

1. Go to Product Details Tab and check "Disable Modify" from "Programs and Features (Control Panel)" group.

2. Go to Install Parameters Page and enable "Limit to basic user interface (simple progress and error handling)" installation option.

3. Add your application files in the Files and Folders Page.

4. From the Build Page, Configuration Settings Tab select "Archive installation files into CAB files" > "One CAB archive containing all the installation files" > "Include CAB file into the MSI database".

5. Add a "Launch file" predefined custom action after "Install Execution Stage" -> "Paths Resolution" with the following settings:

  • Command Line : "[#YourApplication.exe]"
  • Execution Options - all Execution Options must be unchecked
  • Execution Condition: Installed AND (NOT REMOVE) AND (NOT PATCH)

6. Create a VBS file on your hard drive with the following content:

Function StopInstallationProcess()

  StopInstallationProcess = 3
  Exit Function

End Function

7. Add the VBS file as an attached custom action after the predefined one and change its following settings:

  • Function Name: StopInstallationProcess
  • Execution Condition: Installed AND (NOT REMOVE) AND (NOT PATCH)

8. Add another "Launch file or open URL" predefined custom action after "Finish Execution" action group. This custom action must have the same settings as the previous one except for its execution condition which should be changed to (NOT Installed).

9. To test the functionality simply build and run the project.

NoteIf you have the "Package Type -> EXE" option enabled from the Configuration Settings Tab in the Build page; the same settings will apply.