c# - Installer OnCommitted question -


I wrote an installer in a while that installs a service that I wanted to start when the installer was running I put the code to start the service in the OnCommited method of ServiceInstaller. I did this because I got lots of discovery on the subject, it happened like this, but I remember there were other ways to do this.

However, I'm not sure that this is the right thing to do.

Specifically, Docs says that on-cometed calls are made after the installation commission. Does it also count to uninstall? I do not want to try to start a service which I am uninstalling!

Thoughts?

Using Recommended Approach Actually, you create a service-control operation that installs the Windows Installer service After saying to start.

Comments