I wanted to automatically run my application after setup completed. I searched high and low for this option and it just isn’t included in the Setup Project options for Visual Studio.NET 2003. It looks like it will be in 2005 though. Here is the easy way to do it
- Add an installer class to your application with the following code:
Public Overrides Sub Install(ByVal stateSaver As IDictionary) MyBase.Install(stateSaver) Dim Asm As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly System.Diagnostics.Process.Start(Asm.Location) End Sub
- Right click on your setup project and go to View – Custom Actions
- Right click on Install under Custom Actions and select Add Custom Action…
- Select the primary output of your project from the application folder
- Do the same for the Commit
That’s it. Your installer will now run your application after setup.