Let the user specify in which account a service ru

2019-02-13 17:36发布

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.

标签: wix
1条回答
我想做一个坏孩纸
2楼-- · 2019-02-13 17:51

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.

查看更多
登录 后发表回答