是否有任何公开的 HowTos/示例,说明如何通过 WIX 创建/使用自定义 Windows 虚拟帐户?
具体来说,我们希望使用仅具有所需权限的专用用户帐户来安装服务。我们不想为此帐户生成或管理密码,也不能保证所有服务器都位于一个域中。
看起来虚拟帐户将是一个很好的解决方案,但我不知道如何在wix中创建虚拟帐户,或者如何向其添加组/权限。
最佳答案
WIX 似乎不直接支持虚拟帐户。但是,虚拟帐户是从该服务派生的。所以你只需使用帐户 NT Service\<ServiceName>
(其中 <ServiceName>
是使用该帐户的服务名称)配置服务时。
例如:
<ServiceInstall Id="ServiceInstaller" Type="ownProcess" Vital="yes"
Name="OurAgent" DisplayName="our agent name"
Account="NT Service\OurAgent"
Description="Our Agent Description" Start="auto"
ErrorControl="critical" Interactive="no">
<ServiceConfig DelayedAutoStart="yes" OnInstall="yes" OnReinstall="yes"/>
</ServiceInstall>
之后,您可以使用此命令将其添加到所需的组中:
net localgroup "Performance Monitor Users" /add "nt service\OurAgent"
Wix 安静执行工具对此很有用:
http://wixtoolset.org/documentation/manual/v3/customactions/qtexec.html
关于windows - 如何使用 wix 创建虚拟帐户的示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45553117/