Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run executable at end of Setup Project?

Tags:

I have a Visual Studio Setup Project that I use to install a fairly simple WinForms application. At the end of the install I have a custom user interface page that shows a single check box which asks the user if they want to run the application. I've seen other installers do this quite often. But I cannot find a way to get the Setup Project to run an executable after the install finishes. An ideas?

NOTE: You cannot use Custom Actions because these are used as part of the install process, I want to run my installed application once the user presses the 'Close' button at the end of the install.

like image 762
Phil Wright Avatar asked Sep 13 '08 14:09

Phil Wright


4 Answers

I believe this is one of the real limitations of the Visual Studio installation project. You need to be able to modify the last page of the installation UI but VS.NET does not give you a way to do this. You could modify the tables in the .MSI after it has been built but VS.NET would probably overwrite these changes each time it is built. You may be able to override the last page using a merge module that you include in the installation project. Either way you will need to become familiar with how the UI dialogs are authored in an .MSI and this is not trivial.

You may want to consider switching to a free script based installer or buy a commercial setup authoring application (just don't buy InstallShield for the love of Pete). Take a look at InstallAware (although I have not used it).

like image 70
jmatthias Avatar answered Oct 20 '22 03:10

jmatthias


I've just found a very easy way which does not require external tools. You only have to add a class file to the main project and a custom action to the setup project.

http://www.codeproject.com/KB/install/Installation.aspx

like image 43
Tommy Blackbird Avatar answered Oct 20 '22 04:10

Tommy Blackbird


You also can use custom actions

like image 40
Sly Avatar answered Oct 20 '22 05:10

Sly


I've done this for internal apps by creating a VB Script harness that launches the setup executable, waits for it to close, and then launches the second program.

You could also accomplish this with a little more polish using a few Win API calls in a C executable.

like image 44
Nick Avatar answered Oct 20 '22 05:10

Nick