Automatically start a windows service after install
Posted
by
Chuck Savage
on Stack Overflow
See other posts from Stack Overflow
or by Chuck Savage
Published on 2011-11-11T17:45:50Z
Indexed on
2011/11/11
17:52 UTC
Read the original article
Hit count: 144
c#
|windows-services
Which of the two of these are preferable (and why) from the service installer, I've seen both mentioned on different websites (and here on stackoverflow Automatically start a Windows Service on install and How to automatically start your service after install?).
// Auto Start the Service Once Installation is Finished.
this.AfterInstall += (s, e) => new ServiceController("service").Start();
this.Committed += (s, e) => new ServiceController("service").Start();
© Stack Overflow or respective owner