title: WiX Error LGHT0130 In InstallScopeDlg when modifying Wix_Advanced UI
body: <p>I am using WiX 3.6.<br>
  I am using the WIX_Advanced user interface and I want to replace the InstallScopeDlg with my own version (called InstallScopeDlgDsktp) which includes a checkbox for adding a Desktop shortcut.</p>
  
  <p>When I do this, I take all the references to the old InstallScopeDlg in the WixUI_Advanced.wxs file, and override them in my main file to instead reference my custom InstallScopeDlgDsktp module.</p>
  
  <p>However, when I try compiling, I get an error which seems to indicate there is a clash with a RadioButton table which means both my InstallScopeDlgDsktp and the original InstallScopeDlg must be adding a RadioButton based on the same property (WixAppFolder).</p>
  
  <pre><code>light Cryptobot.wixobj InstallScopeDlgDsktp.wixobj -ext WixUIExtension -out Cryptobot.msi
  Microsoft (R) Windows Installer Xml Linker version 3.6.2221.0
  
  &lt;snip&gt;wixlib\InstallScopeDlg.wxs(24): error LGHT0130 : 
  The primary key 'WixAppFolder/1' is duplicated in table 'RadioButton'.  Please remove one of the entries or rename a part of the primary key to avoid the collision.
  </code></pre>
  
  <p>I can't seem to get around this.  My question is, why is it even linking in the original InstallScopeDlg module when I am not even referencing it any more?  How do I stop the original InstallScopeDlg from adding the RadioButton?</p>
  
  <p>Code provided for reference:
  Main WXS file (UI stuff is at the bottom - can see I replaced all instances of InstallScopeDlg with InstallScopeDlgDsktp):</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="windows-1252"?&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;
  
     &lt;!-- Defines --&gt;
     &lt;?define ProductName="Cryptobot" ?&gt;
     &lt;?define ProductVersion="1.1.1" ?&gt;
  
     &lt;Product Name="$(var.ProductName) $(var.ProductVersion)" Id="*"  
        UpgradeCode="MY-UPGRADE-GUID"  
        Language="1033" Codepage="1252" Version="$(var.ProductVersion)" Manufacturer="Crafted From Code"&gt;
    &lt;!-- The Package GUID must be changed EVERY timeyou build a new .msi.  The asterisk makes this happen automatically. --&gt;
    &lt;Package Id="*" Keywords="Installer" 
       Description="$(var.ProductName) $(var.ProductVersion) Setup"
       Manufacturer="Crafted From Code"
       InstallerVersion="200" Languages="1033" Compressed="yes" /&gt;
  
    &lt;Media Id="1" Cabinet="$(var.ProductName).cab" EmbedCab="yes" /&gt;
  
    &lt;!-- Components to install --&gt;
    &lt;Directory Id="TARGETDIR" Name="SourceDir"&gt;
       &lt;Directory Id="ProgramFilesFolder"&gt;
          &lt;Directory Id="CraftedFromCode" Name="Crafted From Code"&gt;
             &lt;Directory Id="APPLICATIONFOLDER" Name="$(var.ProductName)"&gt;
                &lt;Component Id="MainExecutable" Guid="MY-GUID"&gt;
                   &lt;File Id="CryptobotEXE" Name="Cryptobot.exe" Source="..\Cryptobot\bin\Release\Cryptobot.exe" KeyPath="yes"&gt;
                      &lt;Shortcut Id="CryptobotProgramMenuShortcut" Directory="ProgramMenuDir" 
                         Name="$(var.ProductName)" Icon="Cryptobot.ico" IconIndex="0" Advertise="yes" /&gt;
                      &lt;Shortcut Id="CryptobotDesktopShortcut" Directory="DesktopFolder" 
                         Name="$(var.ProductName)" Icon="Cryptobot.ico" IconIndex="0" Advertise="yes" /&gt;
                   &lt;/File&gt;
                   &lt;RemoveFolder Id="APPLICATIONFOLDER" On="uninstall" /&gt;
                &lt;/Component&gt;
             &lt;/Directory&gt;
          &lt;/Directory&gt;
       &lt;/Directory&gt;
  
       &lt;!-- Start Menu Shortcut(s) --&gt;
       &lt;Directory Id="ProgramMenuFolder" Name="Programs"&gt;
          &lt;Directory Id="ProgramMenuDir" Name="$(var.ProductName)"&gt;
             &lt;Component Id="ProgramMenuShortcut" Guid="MY-GUID" &gt;
                &lt;RegistryValue Root="HKCU" Key="Software\Crafted From Code\Cryptobot" Name="installed" Type="integer" Value="1" KeyPath="yes" /&gt;
                &lt;RemoveFolder Id="ProgramMenuDir" On="uninstall" /&gt;
             &lt;/Component&gt;
          &lt;/Directory&gt;
       &lt;/Directory&gt;
  
       &lt;!-- Desktop Shortcut --&gt;
       &lt;Directory Id="DesktopFolder"&gt;
          &lt;Component Id="DesktopShortcut" Guid="MY-GUID"&gt;
             &lt;Condition&gt;INSTALLDESKTOPSHORTCUT&lt;/Condition&gt;
             &lt;RegistryValue Root="HKCU" Key="Software\Crafted From Code\Cryptobot" Name="installed" Type="integer" Value="1" KeyPath="yes" /&gt;
          &lt;/Component&gt;
       &lt;/Directory&gt;
  
    &lt;/Directory&gt; &lt;!-- End of TARGETDIR root directory --&gt;
  
  
    &lt;Icon Id="Cryptobot.ico" SourceFile="Cryptobot.ico" /&gt;
  
    &lt;Feature Id="Complete" Level="1" Title="$(var.ProductName)" 
       Description="The complete package." Display="expand" 
       ConfigurableDirectory="APPLICATIONFOLDER"&gt;
       &lt;ComponentRef Id="MainExecutable" /&gt;
       &lt;ComponentRef Id="ProgramMenuShortcut" /&gt;
       &lt;ComponentRef Id="DesktopShortcut" /&gt;
    &lt;/Feature&gt;
  
    &lt;!-- Upgrade rules: If a newer version is found, don't allow installation of an older version (downgrading).
    Otherwise, if an older version is already installed, remove it before installing the current version --&gt;
    &lt;Upgrade Id="MY-UPGRADE-GUID"&gt;
       &lt;UpgradeVersion OnlyDetect="yes" Property="NEWERPRODUCTFOUND" Minimum="$(var.ProductVersion)" IncludeMinimum="no" /&gt;
       &lt;!-- Setting IncludeMaximum to yes generates a linker warning, but it means that we can install over the
       same version without necessarily having to change the version number. --&gt;
       &lt;UpgradeVersion OnlyDetect="no" Property="PREVIOUSVERSIONINSTALLED" Minimum="1.0.0" IncludeMinimum="yes" Maximum="$(var.ProductVersion)" IncludeMaximum="yes" /&gt;
    &lt;/Upgrade&gt;
  
    &lt;CustomAction Id='PreventDowngrading' Error='A newer version of $(var.ProductName) is already installed.' /&gt;
  
    &lt;InstallExecuteSequence&gt;
       &lt;Custom Action='PreventDowngrading' After='FindRelatedProducts'&gt;NEWERPRODUCTFOUND&lt;/Custom&gt;
       &lt;RemoveExistingProducts After="InstallFinalize" /&gt;
    &lt;/InstallExecuteSequence&gt;
  
    &lt;InstallUISequence&gt;
       &lt;Custom Action='PreventDowngrading' After='FindRelatedProducts'&gt;NEWERPRODUCTFOUND&lt;/Custom&gt;
    &lt;/InstallUISequence&gt;
  
    &lt;!-- User Interface: Use the Advanced WiX interface, which will allow 1-click installation or 
    per user/per machine installation &amp; install directory to be specified --&gt;
    &lt;UIRef Id="WixUI_Advanced" /&gt;
    &lt;UIRef Id="WixUI_ErrorProgressText" /&gt;
    &lt;Property Id="ApplicationFolderName" Value="Crafted From Code\Cryptobot" /&gt;  
    &lt;Property Id="WixAppFolder" Value="WixPerUserFolder" /&gt; &lt;!-- Defaults to install for all users --&gt;
    &lt;Property Id="INSTALLDESKTOPSHORTCUT" Value="1" /&gt; &lt;!-- Support for a desktop shortcut --&gt;
  
    &lt;!-- Add a checkbox to launch the application when the installer exits --&gt;
    &lt;Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Launch $(var.ProductName) when setup exits." /&gt;
    &lt;!-- Have it ticked by default --&gt;
    &lt;Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOX" Value="1" /&gt;
    &lt;CustomAction Id="StartAppOnExit" FileKey="CryptobotEXE" ExeCommand="" Execute="immediate" Impersonate="yes" Return="asyncNoWait" /&gt;
  
  
    &lt;UI Id="WixUI_AdvancedCrypto"&gt;
       &lt;UIRef Id="WixUI_Advanced" /&gt;
  
       &lt;DialogRef Id="InstallScopeDlgDsktp" /&gt;
  
       &lt;Publish Dialog="AdvancedWelcomeEulaDlg" Control="Advanced" Event="NewDialog" Value="InstallScopeDlgDsktp" Order="1"&gt;!(wix.WixUISupportPerMachine) AND !(wix.WixUISupportPerUser)&lt;/Publish&gt;
  
       &lt;Publish Dialog="InstallScopeDlgDsktp" Control="Back" Event="NewDialog" Value="AdvancedWelcomeEulaDlg"&gt;1&lt;/Publish&gt;
       &lt;!-- override default WixAppFolder of WixPerMachineFolder as standard user won't be shown the radio group to set WixAppFolder --&gt;
       &lt;Publish Dialog="InstallScopeDlgDsktp" Control="Next" Property="WixAppFolder" Value="WixPerUserFolder" Order="1"&gt;!(wix.WixUISupportPerUser) AND NOT Privileged&lt;/Publish&gt;
       &lt;Publish Dialog="InstallScopeDlgDsktp" Control="Next" Property="ALLUSERS" Value="{}" Order="2"&gt;WixAppFolder = "WixPerUserFolder"&lt;/Publish&gt;
       &lt;Publish Dialog="InstallScopeDlgDsktp" Control="Next" Property="ALLUSERS" Value="1" Order="3"&gt;WixAppFolder = "WixPerMachineFolder"&lt;/Publish&gt;
       &lt;Publish Dialog="InstallScopeDlgDsktp" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerUserFolder]" Order="4"&gt;WixAppFolder = "WixPerUserFolder"&lt;/Publish&gt;
       &lt;Publish Dialog="InstallScopeDlgDsktp" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerMachineFolder]" Order="5"&gt;WixAppFolder = "WixPerMachineFolder"&lt;/Publish&gt;
       &lt;Publish Dialog="InstallScopeDlgDsktp" Control="Next" Event="NewDialog" Value="FeaturesDlg" Order="6"&gt;WixAppFolder = "WixPerUserFolder"&lt;/Publish&gt;
       &lt;Publish Dialog="InstallScopeDlgDsktp" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="7"&gt;WixAppFolder = "WixPerMachineFolder"&lt;/Publish&gt;
  
       &lt;Publish Dialog="FeaturesDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlgDsktp"&gt;NOT Installed AND WixAppFolder = "WixPerUserFolder"&lt;/Publish&gt;
       &lt;Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlgDsktp"&gt;!(wix.WixUISupportPerUser)&lt;/Publish&gt;         
  
  
       &lt;!-- Add the check box for launching the app on completion --&gt;
       &lt;Publish Dialog="ExitDialog" Control="Finish" Order="1" Event="DoAction" Value="StartAppOnExit"&gt;WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 AND NOT Installed&lt;/Publish&gt;
    &lt;/UI&gt;
  
  
  &lt;/Product&gt;
  &lt;/Wix&gt;
  </code></pre>
  
  <p>And the InstallScopeDlgDsktp file is just a copy of InstallScopeDlg with a checkbox added and the name changed:</p>
  
  <pre><code>&lt;snip&gt;
  &lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&gt;
      &lt;Fragment&gt;
          &lt;UI&gt;
              &lt;Dialog Id="InstallScopeDlgDsktp" Width="370" Height="270" Title="!(loc.InstallScopeDlg_Title)" KeepModeless="yes"&gt;
                  &lt;Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallScopeDlgBannerBitmap)" /&gt;
                  &lt;Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" /&gt;
                  &lt;Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" /&gt;
                  &lt;Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="20" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgDescription)" /&gt;
                  &lt;Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgTitle)" /&gt;
                  &lt;Control Id="BothScopes" Type="RadioButtonGroup" X="20" Y="55" Width="330" Height="120" Property="WixAppFolder" Hidden="yes"&gt;
                      &lt;RadioButtonGroup Property="WixAppFolder"&gt;
                          &lt;RadioButton Value="WixPerUserFolder" X="0" Y="0" Width="295" Height="16" Text="!(loc.InstallScopeDlgPerUser)" /&gt;
                          &lt;RadioButton Value="WixPerMachineFolder" X="0" Y="60" Width="295" Height="16" Text="!(loc.InstallScopeDlgPerMachine)" /&gt;
                      &lt;/RadioButtonGroup&gt;
                      &lt;Condition Action="show"&gt;Privileged AND (!(wix.WixUISupportPerUser) AND !(wix.WixUISupportPerMachine))&lt;/Condition&gt;
                  &lt;/Control&gt;
                  &lt;Control Id="PerUserDescription" Type="Text" X="33" Y="70" Width="300" Height="36" Hidden="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgPerUserDescription)"&gt;
                      &lt;Condition Action="show"&gt;!(wix.WixUISupportPerUser)&lt;/Condition&gt;
                  &lt;/Control&gt;
                  &lt;Control Id="NoPerUserDescription" Type="Text" X="33" Y="70" Width="300" Height="36" Hidden="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgNoPerUserDescription)"&gt;
                      &lt;Condition Action="show"&gt;NOT !(wix.WixUISupportPerUser)&lt;/Condition&gt;
                  &lt;/Control&gt;
                  &lt;Control Id="PerMachineDescription" Type="Text" X="33" Y="131" Width="300" Height="36" Hidden="yes" NoPrefix="yes" Text="!(loc.InstallScopeDlgPerMachineDescription)"&gt;
                      &lt;Condition Action="show"&gt;Privileged&lt;/Condition&gt;
                  &lt;/Control&gt;
                  &lt;Control Id="DesktopShortcutCheckBox" Type="CheckBox" X="20" Y="160" Width="290" Height="17" Property="INSTALLDESKTOPSHORTCUT" CheckBoxValue="1" Text="Create a shortcut on the desktop." /&gt;
  
                  &lt;Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" /&gt;
                  &lt;Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" /&gt;
                  &lt;Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)"&gt;
                      &lt;Publish Event="SpawnDialog" Value="CancelDlg"&gt;1&lt;/Publish&gt;
                  &lt;/Control&gt;
              &lt;/Dialog&gt;
          &lt;/UI&gt;
      &lt;/Fragment&gt;
  &lt;/Wix&gt;
  </code></pre>