0

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>
Vincent
  • 1,459
  • 15
  • 37

2 Answers2

1

"Inserting" dialogs works by adding rows to the ControlEvent table in the MSI. This table has an Order column which can be used to get your NewDialog control event to run with a higher priority then the existing event.

I run an open source project called IsWiX that has project templates to accelerate setup development. One of the features of this template is what you are trying to do here. The UI-CustomDialog.wxs fragment defines a custom dialog and inserts the rows to place it in the loop. The UI.wxs fragment references the WixUI_FeatureTree dialog set and has a commented out reference to the UI-CustomDialog fragment. Uncomment and the dialog becomes active.

The different dialog sets have different dialogs so the before and after dialog names have to be tweaked when referencing different sets.

<!-- Insert into dialog sequencing by inserting control events on previous and next dialogs-->

<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomDlg">1</Publish>

<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="CustomDlg" Order="3">NOT Installed</Publish>

http://iswix.codeplex.com/SourceControl/latest#main/Source/Application/IsWiXAddIn/SetupProjectTemplate/UI.wxs http://iswix.codeplex.com/SourceControl/latest#main/Source/Application/IsWiXAddIn/SetupProjectTemplate/UI-CustomDialog.wxs

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
0

You need to change the dialog "Id" (and filename?) to something different so that you don't get Id conflicts. Then you can include/reference your personal copy of the modified dialog.

jbudreau
  • 1,287
  • 1
  • 10
  • 22