Groups | Blog | Home
all groups > visual studio .net setup > september 2006 >

visual studio .net setup : Start Windows Service upon Installation Completion


Chris
9/20/2006 12:00:00 AM
Hello,

I have created an MSI (Created with VS.Net 2005 Deployment Project included
in my Windows Service Project) that installs a Windows Service, but I currently
have to manually start the service. I created an exe that calls the Net
Start command and included it with my installation, but I can't figure out
how to launch the executable once the setup is complete.

Is it possible to call an executable upon setup completion? If so, can somebody
walk me through the steps to accomplish this?

Thank you very much!!!!

Chri

Chris
9/22/2006 3:58:26 AM
I was finally able to figure out the necessary steps to start a service that
is being installed.

1) Created an exe to start the service.
string s = cmd /K "NET STOP "ITG Server Monitor"";

System.Diagnostics.Process proc;
proc = new System.Diagnostics.Process();

proc = System.Diagnostics.Process.Start("cmd.exe", s);

proc.WaitForExit();
proc.Close();
2) Added my exe to my Setup Custom Actions
3) Supplied a value for the Argument property for the Commit event of the
Custom Action
4) Changed the property for Installer to FALSE for my exe in each Custom
Action event (Install, Commit, Rollback and Uninstall)

[quoted text, click to view]

AddThis Social Bookmark Button