I have created a setup project using Visual Studio 2008. After the application is finished installing, I would like to have it start up immediately. Any thoughts on how this can be done?
相关问题
- How does the setup bootstrapper detect if prerequi
- Generic Generics in Managed C++
- How to Debug/Register a Permanent WMI Event Which
- the application was unable to start correctly 0xc0
- 'System.Threading.ThreadAbortException' in
Here's how to make your application launch after install (using VS2010):
Assuming you already have 2 projects like:
MyApp.Application
andMyApp.Installer
.MyApp.Application
and chooseAdd
>New Item...
>Installer Class
(name it whatever you want)View Code
Override the
Commit
method like this:Update
MyApp.exe
to use the name of your applicationMyApp.Installer
project & chooseView
>Custom Actions
Commit
folder & chooseAdd custom action
Application Folder
>OK
>OK
References:
I have used a custom action in VS 2005. Not sure if this is enhanced in VS 2008.
I've used a script to place a checkbox "Launch [ProductName]" on the final form of the MSI. I cannot take any credit for the script though. You can find the script over on Aaron Stebner's blog at MSDN http://blogs.msdn.com/astebner/archive/2006/08/12/696833.aspx
There's an interesting article about it on CodeProject and some good answers there also (which is where I found Aaron's article). http://www.codeproject.com/KB/install/Installation.aspx
Finally, there's also some other similar questions on StackOverflow
How to run executable at end of Setup Project?
How to automatically start my application when my setup is done in C# setup project