Вопрос

I have a couple of WIX projects that start install and start services. As I need the installers to work on non-English machines, I have been using WixQueryOsWellKnownSID properties to provide localised account names for the services.

But I have obviously got something wrong; because although the services install, they do not start in certain locales. So far, I know the installers work in Holland, France, Japan, & China; but do not work in Germany & Belgium, (the language on the Belgium machines was French).

During install, we get an "Service 'ServiceName' failed to start. Verify that you have sufficient privileges to start system services." error message. If I ignore the error and then open the Services MMC, the Service is shown as having a localised account name, (NT-AUTORITÄT\NETZWERKDIENST on a German machine); if I then manually set the service account to network service, the Services MMC displays Netzwerkdienst, and the service runs fine.

I have tested this with Windows7 and Server2008R2 - same issue on both OS's.

The WIX service code:

<PropertyRef Id="WIX_ACCOUNT_NETWORKSERVICE"/>

<Component Id="ProductComponent" Guid="5bcdeb4a-9832-4a01-9863-60bc0634a8fd">
          <File Id="$(var.WebLoggerSR2Service.TargetName)" Name="$(var.WebLoggerSR2Service.TargetFileName)" 
                Source="$(var.WebLoggerSR2Service.TargetPath)" DiskId="1" KeyPath="yes" Checksum="yes"></File>
          <ServiceInstall Id="ServiceInstaller" Type="ownProcess" Name="$(var.WebLoggerSR2Service.TargetName)"
                          Description="!(loc.SVCINST_DESCRIPTION)" 
                          ErrorControl="normal" Start="auto" Account="[WIX_ACCOUNT_NETWORKSERVICE]"/>
          <ServiceControl Id="StartWixServiceInstaller"
                          Name="$(var.WebLoggerSR2Service.TargetName)" Start="install" Wait="no" /> 
          <ServiceControl Id="StopWixServiceInstaller" Name="$(var.WebLoggerSR2Service.TargetName)"
                          Stop="both" Wait="yes" Remove="uninstall" />
          <Util:EventSource xmlns:Util="http://schemas.microsoft.com/wix/UtilExtension"
                         Name="$(var.WebLoggerSR2Service.TargetName)" Log="Application"
                         EventMessageFile="[NETFRAMEWORK20INSTALLROOTDIR]EventLogMessages.dll" />
          <RemoveFolder Id="INSTALLLOCATION" On="uninstall"/> 
</Component>

I am using WIX version 3.9.16.0 with Votive on Visual Studio 2012

Это было полезно?

Решение

Maybe just a comment but too long for that space....

The docs on NetworkServiceAccount say:

This account can be specified in a call to the CreateService and ChangeServiceConfig functions. Note that this account does not have a password, so any password information that you provide in this call is ignored. While the security subsystem localizes this account name, the SCM does not support localized names. Therefore, you will receive a localized name for this account from the LookupAccountSid function, but the name of the account must be NT AUTHORITY\NetworkService when you call CreateService or ChangeServiceConfig, regardless of the locale, or unexpected results can occur. (learn.microsoft.com)

This is pretty weird if it's correct because it seems to be saying that CreateService (which is what MSI is ultimately calling) needs the English form of the name, but when you actually ask for it you'll get the localized name. That's why you see the localized name n MMC, so my dumb question is have you tried just using the standard English form on the other language OS versions?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top