What I'm trying to do is exactly what is described here under Inserting a custom dialog into a built-in dialog set
:
http://wixtoolset.org/documentation/manual/v3/wixui/wixui_customizations.html
The documentation linked above says I should copy everything in between and including the <Fragment>
from WixUI_InstallDir.wxs
into my own source file. I can then adjust the Publish
statements and insert my own UI.
When I try that though, I get the following:
error LGHT0091: Duplicate symbol 'WixUI:WixUI_InstallDir' found. This typically means that an Id is duplicated. Check to make sure all your identifiers of a given type (File, Component, Feature) are unique.
I guess that's because I have the following in my Product.wxs
:
<UIRef Id="WixUI_InstallDir" />
But if I remove that, how am I supposed to reference the InstallDir UI? Because when I remove it, it compiles, but the InstallDir UI doesn't show up anymore.
I'm sure I'm doing something completely wrong but this is my first time messing with WiX, so take it easy on me :)
For reference, this is my full Product.wxs
:
The ... is where the exact copy (from <Fragment>
until </Fragment>
) of WixUI_InstallDir.wxs
resides, I left it out to prevent this post from getting too long.
<?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>