WiX MSI installs a Windows service without starting it

I am trying to create a WiX MSI installer for my Windows service that will install the service but not start it. I can't seem to find anything that explains how to do this or if it is possible.

I tried to remove the ServiceControl that I had to start the service, and also without having to switch the Start attribute to ServiceInstall. It should be possible, right? I just want the MSI file to install the service and let the user run it whenever they want.

<Component Id="ServiceInstaller" Guid="9e578e3d-0339-425c-8633-f54ffaaa4921">

    <ServiceInstall Id="ReportingServiceInstaller"
                    Type="ownProcess"
                    Vital="yes"
                    Name="WindowsService.exe"
                    DisplayName="WindowsService"
                    Description="Wickedly awesome and amazing service."
                    ErrorControl="ignore"
                    Account="NT AUTHORITY\LocalService"
                    Start="auto"
                    Interactive="no" />

    <ServiceControl Id="ServiceControl_Stop"
                    Name="WindowsService.exe"
                    Stop="both"
                    Remove="uninstall"
                    Wait="no" />

</Component>
+4
source share
1 answer

ServiceControl, . , - . ServiceInstall, . , Start ServiceInstall. , , . .exe, . :

<Component Id="ServiceInstaller" Guid="3e412e3d-0339-325c-8633-f54ffaaa4921">
        <File Id="WindowsService.exe" 
         Name="WindowsService.exe" 
         KeyPath="yes"
         Source="Path to the EXE"/>
        <ServiceInstall Id="ReportingServiceInstaller"
                Type="ownProcess"
                Vital="yes"
                Name="WindowsService"                    
                DisplayName="WindowsService"
                Description="Wickedly awesome and amazing service."
                ErrorControl="ignore"
                Account="NT AUTHORITY\LocalService"
                Start="demand"
                Interactive="no" />
</Component>
+4

Source: https://habr.com/ru/post/1618305/


All Articles