<p>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?</p>

<p>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.</p>

[{'answer_id': 60643, 'author': 'Nick', 'author_id': 1490, 'author_profile': 'https://Stackoverflow.com/users/1490', 'pm_score': 1, 'selected': False, 'text': "<p>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.</p>\n\n<p>You could  also accomplish this with a little more polish using a few Win API calls in a C executable.</p>\n"}, {'answer_id': 60703, 'author': 'jmatthias', 'author_id': 2768, 'author_profile': 'https://Stackoverflow.com/users/2768', 'pm_score': 4, 'selected': True, 'text': "<p>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.</p>\n\n<p>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).</p>\n"}, {'answer_id': 294786, 'author': 'Jonathan Parker', 'author_id': 4504, 'author_profile': 'https://Stackoverflow.com/users/4504', 'pm_score': 1, 'selected': False, 'text': '<p>You can use MSILAUNCH (though I\'ve only got it to work with MSICREATE).</p>\n\n<p><a href="http://www.cornerhouse.ca/en/msi.html" rel="nofollow noreferrer">http://www.cornerhouse.ca/en/msi.html</a></p>\n'}, {'answer_id': 1879815, 'author': 'Sly', 'author_id': 72174, 'author_profile': 'https://Stackoverflow.com/users/72174', 'pm_score': 2, 'selected': False, 'text': '<p>You also can use custom actions</p>\n'}, {'answer_id': 4266763, 'author': 'Tommy Blackbird', 'author_id': 494744, 'author_profile': 'https://Stackoverflow.com/users/494744', 'pm_score': 3, 'selected': False, 'text': '<p>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.</p>\n\n<p><a href="http://www.codeproject.com/KB/install/Installation.aspx" rel="noreferrer">http://www.codeproject.com/KB/install/Installation.aspx</a></p>\n'}, {'answer_id': 7396841, 'author': 'Grub', 'author_id': 723459, 'author_profile': 'https://Stackoverflow.com/users/723459', 'pm_score': 0, 'selected': False, 'text': '<p>I managed it by doing invoking the Main method the assembly using the following line:</p>\n\n<pre><code>(typeof(ClassWithinAssemblyToExecute)).Assembly.EntryPoint.Invoke(null, new Object[] {} )\n</code></pre>\n'}, {'answer_id': 14583019, 'author': 'Thomas', 'author_id': 508127, 'author_profile': 'https://Stackoverflow.com/users/508127', 'pm_score': 0, 'selected': False, 'text': '<p>you can do it by custom installer. just add installer class and there u will see many event like after install, before install. just hook up after install and from there run ur exe by process class. i would suggest u google to find more about custom installer.\nhere is one good link that might help u <a href="http://www.codeproject.com/Articles/19560/Launching-Your-Application-After-Install-using-Vis" rel="nofollow">http://www.codeproject.com/Articles/19560/Launching-Your-Application-After-Install-using-Vis</a></p>\n\n<p>thanks</p>\n'}]
['https://Stackoverflow.com/questions/60565', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/6276/']