OK, there seems to be some confusion here, let me give you a run down of how
I do it.
I include the project outputs of my service projects in an installer.
This then copies the binaries onto the machine during the install.
Then I add the project outputs to the AfterInstall custom actions section of
the installer.
This causes the MSI to install the services on the machine services list so
they run.
These steps get the services onto the machine, and setup as a service in
windows.
InstallUtil is used at the command prompt to install/uninstall a service by
passing it the path to the exe file for the service. This is normally done
when a system admin just wants to copy the service exe to a machine and
install it manually rather than by using and MSI installer.
If there is just a minor change to the service,this is not required, you
should be able to stop the service, copy the new version over the old and
start the service.
If you really want to know what has caused your code to run, I dont know of
a built in way of doing it with information accessible in the installer class
apart from using the Process class to get the current process. Then looking
at the exe name to see if is MSIExec or installutil.
Does this clear up everything for you.
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Alhambra Eidos Desarrollo" wrote:
>
I believe you just include them all in the install and put them all in the
custom actions for it.
Thanks, all is right. It's works fine !!
I guess now, the services can be installed by MSI, and too using installutil
command. If the service has Installer class, all is right.
My question now, how can I know, in my code in Installer class, if the
caller is MSI or installutil ??
Thanks again.