让用户指定服务在哪个帐户中运行 [英] Let the user specify in which account a service runs
问题描述
我有一个 Windows 服务,它应该在安装过程中用户指定的域帐户下运行.
I've got a windows service that should run under a domain account specified by the user during installation.
Wix
安装程序如何实现这一点(即询问用户该服务应该使用的帐户 + 密码)?
How is this possible with a Wix
installer (i.e. ask the user for a account + password that the service should be using)?
背景
我的服务需要访问网络共享,LocalSystem
没有适当的权限,所以我想使用现有的域用户帐户.
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.
推荐答案
ServiceInstall 元素是你的朋友这里.它包含属性帐户和密码.因此,在您的对话框中创建几个控件:
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" ... />
并使用这些属性来指示 ServiceInstall:
And use these properties to instruct ServiceInstall:
<ServiceInstall Id="..." Account="[ACCOUNT]" Password="[PASSWORD]" Type="ownProcess" ... />
希望这会有所帮助.
这篇关于让用户指定服务在哪个帐户中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!