开发者

WIX ServiceInstall - setting the service to run under the NetworkService account

I am trying to create a WIX installer to install my windows service to run under the NetworkService account and getting an Insufficient Priviledges er开发者_如何学Pythonror during the installation.

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

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

I'm sure someone must have acheived this previously and wondered if they'd be kind enough to share a code snippet?


NOTE: The answer below is only relevant on the older builds of WIX and Windows at the time the question was raised. The current version of the WIX service credentials will work if you set the native "NT AUTHORITY" domain and "NetworkService" account (no space necessary now).


Original Answer:

The correct identity name is "NT Authority\Network Service" not "NT Authority\NetworkService". A space is required then it works.

Funny that the default "LocalSystem" works directly with WIX 3.5, but for other well known accounts you have to prefix with "NT Authority...", for example "LocalService" does not work either when used directly.

i.e. fix this with:

Account='NT Authority\Network Service'


It seems a few remnants of a previously failed install were preventing me from removing and reinstalling with Account="NT Authority\NetworkService". All is well in the universe again.


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

So, at least under recent systems you must use NT AUTHORITY\NETWORKSERVICE as documented 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" />


I used customAction to find the user credentials are correct or not.

If user credentials are matches the account in the machine they want to install,I will allow them to proceed to next dialog(UI) other wise I will show another Dialog indicating the user that account not found.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜