Kind of old, but here's what you can do
<ServiceInstall Id="SomeService" Type="ownProcess" Vital="yes" Name="Some Service" DisplayName="Some Service" Description="Monitoring and management of some service" Start="auto" Account="LocalSystem" ErrorControl="normal" Interactive="no"/> <ServiceControl Id="StartSomeService" Start="install" Stop="both" Remove="uninstall" Name="Some Service" Wait="yes"> <ServiceArgument>[P_USEREMAIL]</ServiceArgument> <ServiceArgument>[P_USERPASSWORD]</ServiceArgument> <ServiceArgument>[P_DEFAULTNAMINGCONTEXT]</ServiceArgument> <ServiceArgument>[P_USEHTTPPROXY]</ServiceArgument> <ServiceArgument>[P_PROXYADDRESS]</ServiceArgument> <ServiceArgument>[P_PROXYDOMAIN]</ServiceArgument> <ServiceArgument>[P_PROXYUSERNAME]</ServiceArgument> <ServiceArgument>[P_PROXYPASSWORD]</ServiceArgument> </ServiceControl>
Update. The WIX documentation is tragically unmanageable when it comes to this element.
Basically, you can set (public) WIX variables defined as [P_ *] for normal (for example, msiexec, static, or CA arguments). These values are passed to the service at startup in the same way as if you combined these values in a string that you send as startup parameters when the service starts from the services console (or with an empty start, which I imagine). In my case, these were values separated by spaces, for example. [P_USERMAIL] - "--useremail some@email.com ", although this is arbitrary, since you will handle this in the startup code of the service you hosted.
As you probably know, these values are not saved. If the service is not initialized with the values specified by you, you must either reinstall / restore, or transfer them to the service in another way (for example, the services console, starting the network).
source share