Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Let the user specify in which account a service runs

Tags:

wix

I've got a windows service that should run under a domain account specified by the user during installation.

How is this possible with a Wix installer (i.e. ask the user for a account + password that the service should be using)?

Background

My service needs access to a network share and LocalSystem doesn't have the appropriate rights so I want to use an existing domain user account.

like image 728
nabulke Avatar asked Mar 05 '12 14:03

nabulke


1 Answers

ServiceInstall element is your friend here. It contains the attributes Account and Password. So, author a couple of controls on your dialog:

<Control Type="Edit" Property="ACCOUNT" ... />
<Control Type="Edit" Property="PASSWORD" Password="Yes" ... />

And use these properties to instruct ServiceInstall:

<ServiceInstall Id="..." Account="[ACCOUNT]" Password="[PASSWORD]" Type="ownProcess" ... />

Hope this helps.

like image 109
Yan Sklyarenko Avatar answered Nov 13 '22 05:11

Yan Sklyarenko