Set service Startup type in WiX installer

前端 未结 3 606
感情败类
感情败类 2021-01-22 22:43

I am trying to set a pre-installed service\'s startup type to Automatic, using WiX. Another task was to start the service on install, which I achieved with:

相关标签:
3条回答
  • 2021-01-22 22:56

    Solved by editing the registry via RegistryKey, see example:

    <RegistryKey Root="HKLM"
                 Key="SYSTEM\CurrentControlSet\Services\[Service Name]"
                 Action="create">
        <RegistryValue Type="integer" Name="Start" Value="2" />
        <RegistryValue Type="integer" Name="DelayedAutostart" Value="0" />
    </RegistryKey>
    

    Note service may appear as Automatic (Delayed Start) in Services GUI. However, after restarting, Services GUI displayed the service startup type as Automatic.

    0 讨论(0)
  • 2021-01-22 22:57

    Set the "DelayedAutoStart" parameter to "no", rather than "yes".

    0 讨论(0)
  • 2021-01-22 23:06

    MSI doesn't support changing the startup type of a service that the package doesn't install. ServiceConfig doesn't let you get around that:

    Applies only to installed auto-start services or services installed by this package with SERVICE_AUTO_START in the StartType field of the ServiceInstall table.

    0 讨论(0)
提交回复
热议问题