我正在尝试做的正是这里描述的内容Inserting a custom dialog into a built-in dialog set
:
http ://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html
上面链接的文档说我应该将其中的所有内容复制到我自己的源文件中,包括<Fragment>
from 。WixUI_InstallDir.wxs
然后我可以调整Publish
语句并插入我自己的 UI。但是,当我尝试这样做时,我得到以下信息:
错误 LGHT0091:找到重复的符号“WixUI:WixUI_InstallDir”。这通常意味着一个 Id 是重复的。检查以确保给定类型(文件、组件、功能)的所有标识符都是唯一的。
我想那是因为我的Product.wxs
:
<UIRef Id="WixUI_InstallDir" />
但是如果我删除它,我应该如何引用 InstallDir UI?因为当我删除它时,它会编译,但 InstallDir UI 不再显示。
我确定我在做完全错误的事情,但这是我第一次弄乱 WiX,所以放轻松:)
作为参考,这是我的全部内容Product.wxs
:
... 是确切副本(从<Fragment>
until </Fragment>
)WixUI_InstallDir.wxs
所在的位置,我将其省略以防止这篇文章变得太长。
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
xmlns:util='http://schemas.microsoft.com/wix/UtilExtension'
xmlns:sql='http://schemas.microsoft.com/wix/SqlExtension'>
<Product Id="*" Name="product" Language="1033" Version="1.0.0.0" Manufacturer="man" UpgradeCode="GUID">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate />
<Feature Id="ProductFeature" Title="Shell.MACAM" Level="1">
<ComponentRef Id="SqlComponent" />
</Feature>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER"/>
<UIRef Id="WixUI_InstallDir" />
<util:User Id='SQLUser' Name='[SQLUSER]' Password='[SQLPASSWORD]' />
<UI>
<Dialog Id="AskUserForSQLServer" Width="370" Height="270">
<Control Type="Text" Id="SQLServerNameLabel" Width="50" Height="15" X="4" Y="8">
<Text>SQL Server:</Text>
</Control>
<Control Type="Edit" Id="SQLServerName" Width="181" Height="15" X="60" Y="4">
</Control>
</Dialog>
</UI>
<UIRef Id="WixUI_Minimal" />
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="INETPUB" Name="Inetpub">
<Directory Id="INSTALLFOLDER" Name="Shell.MACAM">
<Component Id='SqlComponent' Guid='GUID'>
<CreateFolder/>
<sql:SqlDatabase Id='SqlDatabase' Database='[SQLDATABASE]' User='SQLUser' Server='[SQLSERVER]'
CreateOnInstall='yes' DropOnUninstall='yes' ContinueOnError='yes'>
</sql:SqlDatabase>
</Component>
</Directory>
</Directory>
</Directory>
</Fragment>
...
</Wix>