我正在使用 Wix 安装 Windows 服务,但需要选择使用 LocalSystem 帐户或使用用户提供的帐户。我应该如何在硬编码值和用户值之间切换?对于我拥有的服务:
<ServiceInstall Id="ServiceInstaller" Type="ownProcess" Vital="yes" Start="auto"
Account="[SERVICELOGONUSER]" Password="[SERVICELOGONPASSWORD]" ErrorControl="normal"
Interactive="no"/>
在 UI 中,我有以下属性:
<Property Id="SERVICELOGONUSER" Value="LocalSystem"/>
在一个对话框中,我有:
<Control Type="CheckBox" Width="200" Height="25" X="25" Y="75" Id="LocalCheckBox"
Property="UseLocalSystem" CheckBoxValue="1" Text="Use LocalSystem Account"/>
<Control Type="Edit" Width="200" Height="15" X="25" Y="115" Id="AccountTextbox"
Property="SERVICELOGONUSER">
<Condition Action="disable">UseLocalSystem = 1</Condition>
<Condition Action="enable"><![CDATA[UseLocalSystem <>1]]></Condition
</Control>
但这只会显示用户可以编辑的硬编码值。