【发布时间】:2016-01-22 05:56:09
【问题描述】:
我在运行 MSI 时安装 Web 服务,但默认在本地系统下运行。我希望它在登录到系统的特定用户下运行。 我们可以通过更改服务的登录属性来做到这一点,但我想在安装时这样做。 所以,我如何在 wix 中创建一个自定义 UI 来询问用户的用户名和密码。我有 2 个文件 - service.wxs 和 product.wxs,我正在尝试类似:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<UI Id="myUI">
<TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" />
<Property Id="DefaultUIFont" Value="WixUI_Font_Normal" />
<Dialog Id="myDlg" Height="400" Width="550" Title="User Sample UI" >
<Control Id="myEdit" Type="Edit" Property="USERNAME" Height="17" Width="100" X="50" Y="50" Indirect="yes" Text="[USERNAME]"/>
<Control Id="meEdit" Type="Edit" Property="PASSWORD" Password="yes" Height="20" Width="100" X="80" Y="50" Indirect="yes" Text="[PASSWORD]"/>
</Dialog>
</UI>
</Fragment>
<Fragment>
<DirectoryRef Id="FOLDER">
<Component Id="..." Guid="*">
<File Id="..." KeyPath="yes" Source="SourceDir\Service.exe" />
<wix:ServiceInstall Id="Install" Account="[USERNAME]" Password="[PASSWORD]" Name="...." Description="..." ErrorControl="ignore" Start="auto" Type="ownProcess" Vital="yes" Interactive="no" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" />
但这不起作用,我没有弹出任何窗口。 我还需要在 product.wxs 中提供一些参考吗?
请帮忙。
【问题讨论】:
-
我的回答对你有帮助吗?