Visual Studio Installer > How To Launch App at End of Installer

ThaKidd KG5ORD picture ThaKidd KG5ORD · Jul 2, 2010 · Viewed 76.4k times · Source

This is probably a stupid question and my Googling just is not functioning today.

I have an application I added a Visual Studio Installer > Setup Wizard project to. I am wondering how to add a button or check box that would launch the application after successful install. This would be located on the last page of the MSI Installer Package. I am using Visual Studio 2010 Ultimate.

I am needing this so that when the application does an automatic update, it auto launches the installer. I just need the installer to relaunch the app after the update.

This is probably very simple but for the life of me I cannot figure it out. Thanks in advance for you help.

Answer

sbenderli picture sbenderli · Jul 2, 2010

Warning: The application will end up running as a high privilege account, which has security and user experience implications.

To run any application after the installation is complete,

  1. Right-click on your setup project, click on Custom Actions.
  2. Then right-click on Commit, Add Custom Action, and choose the file you would like to run. (Note that it has to be in your application folder already, which shouldn't be a problem in your case since you are running your program anyway.
  3. Simply choose the output of your project.
  4. Then, click on this added .exe, and change InstallerClass to false. This is crucial because it will look for an installer program otherwise.
  5. You could even pass parameters to your .exe by adding them to the Arguments property