How to launch an application after install using VS.Net

I had a question. How do I launch an application after installing it with a Visual Studio deployment project? Luckily, the newsgroups know all.

To achieve this, we can add the primary output of the application (the EXE file) to the “Install” custom action. We also need to change the “InstallerClass” property of the custom action to “false”.

As a result, when the installation is finishing, the application will be lanched. However, the Windows Installer Session will be suspended to wait for the return of the application. This “Synchronous execution” behavior of the custom action is by default. If we want the Windows Installer Session to finish without waiting, we need to change the type of the custom action outside VS.Net:

1. Download and install the Windows Installer Platform SDK at the following site:

2. Install “Orca.msi” included.

3. Run Orca and open the MSI file we have generated.

4. Go to the “CustomAction” table and locate the row with “Type” = 1042. This shall be the custom action we have created to run the EXE.

5. Change the type from 1042 to 1234.

6. Save the MSI and quit Orca.

Please give it a try and see whether this achieves your goal or not. If you have any concerns or new findings, please feel free to post here.

Now Playing: Brian McKnight – You Should Be Mine (Don’t Waste Your Time)