[wix-users] Start windows service with some parameters only once

Russell Haley russ.haley at gmail.com
Mon Feb 19 11:38:05 PST 2018

On Mon, Feb 19, 2018 at 6:02 AM, Oleg Kolomiytsev via wix-users
<wix-users at lists.wixtoolset.org> wrote:
> Hi all,
> I am looking for a way to start windows service via wixtoolset with some
> parameters only once (during installing my app). I am trying to achive this
> goal with "Arguments" attribute from "ServiceInstall" element but params are
> passed each time I restart my service.
>         <ServiceInstall Id="Service Id"
>                         Name="Service Name"
>                         DisplayName="Service Display Name"
>                         Interactive="yes"
>                         Vital="yes"
>                         Start="auto"
>                         Type="ownProcess"
>                         Description="Service Description"
>                         ErrorControl="normal"
>                         Arguments="--param" />
> Is there a way to pass arguments to windows service only once (when
> application is installed)

Chris is currently schooling me on other things but I'll throw my two
cents in there.

As an example I have a windows service that checks for parameters on
*command line* startup and does stuff, then exists before trying to
start the service. With that in mind, I ask: are you trying to "run it
as an application" once, or start the service once? A potential
solutions for running it as an application is to create a custom
action that calls a batch script. This requires you know the
parameters you wish to pass when you create your installer.

> ____________________________________________________________________
> WiX Toolset Users Mailing List provided by FireGiant
> http://www.firegiant.com/

More information about the wix-users mailing list