I am trying to create a wix installer to install and start a Windows Service under NetworkService account, but failed, what I got is "Service"() could not be installed. Verify that you have sufficient privileges to install system services."
Please advice, my code is as below:
<Component Id="service" Guid='myguid'>
<File Id='JobServiceEXE' Name='JobService.exe' DiskId='1' Source='mypath\JobService.exe' KeyPath='yes' />
<ServiceControl Id="JobService" Name="[SERVICEID]" Stop="uninstall" Remove="uninstall" Wait="yes" />
<ServiceInstall
Id="JobService" Name="[SERVICEID]" DisplayName="[SERVICENAME]" Type="ownProcess" Start="auto" ErrorControl="normal" Vital ='yes'
Account="NT Authority\NetworkService"
Description="Job Service" />
</Component>
Thank you!
Adding a WiX setup project In Visual Studio, open your solution, and add a WiX project to it: go to the Visual Studio main menu and click File -> Add -> New Project to open the Add New Project dialog. Choose the Setup Project item in the Windows Installer XML node, specify the project name and click OK.
The best way to check if you have WiX Toolset installed is by opening up the Command Prompt and trying to execute the light.exe command. You can also check in the Programs and Features section of Control Panel.
Paul's response is not correct. As per MSDN documentation, to specify the Network Service account, use "NT AUTHORITY\NETWORK SERVICE":
...the name of the account must be
NT AUTHORITY\NETWORKSERVICE
when you call CreateService or ChangeServiceConfig, regardless of the locale...
Set the property "ALLUSERS" to force an Administrator install.
see this link for further information
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With