WIX ServiceInstall - setting up the service to work under the NetworkService account

I am trying to create a WIX installer to install my Windows service to run under the NetworkService account and get a "Not enough privileges" error during installation.

I found this post where someone seems to be experiencing the same problem, but there was no real solution:

http://n2.nabble.com/Re-WiX-users-Digest-Vol-40-Issue-129-td3782055.html

I'm sure someone must have taken care of this before and wondered if they would be kind enough to share a piece of code?

+4
source share
4 answers

NOTE. The answer below only applies to older builds of WIX and Windows at the time of raising the question. The current version of the WIX service credentials will work if you install your own "NT AUTHORITY" and "NetworkService" (now there is no space).


Original answer:

The correct identifier is NT Authority \ Network Service, not NT Authority \ NetworkService. A space is required, then it works.

It's funny that by default "LocalSystem" works directly with WIX 3.5, but for other well-known accounts you should use the prefix "NT Authority ...", for example, "LocalService" does not work with direct use.

i.e. fix this with:

Account = "NT Service \ Network Service"

+4
source

It seems that a few remnants of a previously failed installation prevented me from uninstalling and reinstalling with Account = "NT Authority \ NetworkService". All is well in the universe again.

+1
source

I had the following snippet running under Windows 8.1 FR and Windows 2012R2 ENU. But with NT AUTHORITY\NETWORK SERVICE error with invalid privileges failed.

So, at least in recent systems you should use NT AUTHORITY\NETWORKSERVICE as described in MSDN .

  <ServiceInstall Id="xserviceInstall" Name="$(var.xServiceid)" DisplayName="$(var.xServiceid)" Description="x service" Start="auto" Type="ownProcess" ErrorControl="ignore" Account="NT AUTHORITY\NETWORKSERVICE" Arguments="-w -N" Vital="yes" /> 
+1
source

I used customAction to find the user credentials correctly or not.

If the user credentials match the account on the machine that they want to install, I will allow them to proceed to the next dialog (UI) in another way. I will show another dialog indicating that the account was not found.

0
source

All Articles