views:

317

answers:

1

Dear All,

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!

+1  A: 

First, the message you're getting may be due to a security issue. Your installer must be run by an administrator because creating services requires administrative privileges. You might check for that in a Condition element.

Second, using NT Authority\NetworkService as the account name will fail on non-English systems, because built-in account names are localized. Instead, use plain old NetworkService which Wix recognizes specially and resolves into the correct localized name.

Paul Lalonde
Thank you for replying, would you please let me know how to check for the security issue in Condition element? I am pretty new to wix. I just changed the account name to NetworkService, but the result is still the same. Thank you.
Ray