Search code examples
wixcustom-actioncustomdialogwix3.9

Wix - Unresolved reference to custom dialog


In my installer I try to launch a windows program on which the user has to perform some actions in parallel to the page giving the instructions. For this I added a new page (as per this tutorial). Now I want to start a custom action before this new dialog but I get the following error: error LGHT0094 : Unresolved reference to symbol 'WixAction:InstallUISequence/UserRegistrationDlg' in section 'Product:*'.

Minimal example:

<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
  <Product Name='Foobar 1.0' Id='*' Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Acme Ltd.'>
    <Package InstallerVersion='300' Compressed='yes'  />
    <Directory Id='TARGETDIR' Name='SourceDir'/>

    <UI Id="MyWixUI_FeatureTree">
      <DialogRef Id="TheNewDialog" />
      <UIRef Id="WixUI_FeatureTree" />
      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="TheNewDialog" Order="2">LicenseAccepted = "1"</Publish>
      <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="TheNewDialog">1</Publish>
    </UI>

    <CustomAction Id="WindowsFeatures" Directory="TARGETDIR" ExeCommand="OptionalFeatures.exe" Execute="immediate" Return="asyncNoWait" />
    <InstallUISequence>
     <Custom Action="WindowsFeatures" After="TheNewDialog" >
        NOT Installed AND NOT DOTNETINSTALLED
      </Custom>
    </InstallUISequence>
  </Product>

    <Fragment>
    <UI>
      <Dialog Id="TheNewDialog" Width="370" Height="270" Title="[ProductName] [Setup]" NoMinimize="yes">
        <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
          <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
        </Control>
      </Dialog>
    </UI>
  </Fragment>
</Wix>

I tried to instead of Before="TheNewDialog", set it to After="WelcomeDlg" but that gives even more interesting errors:

  • error LGHT0094 : Unresolved reference to symbol 'Property:ApplicationFolderName' in section 'Fragment:'.
  • error LGHT0094 : Unresolved reference to symbol 'Property:WixAppFolder' in section 'Fragment:'.

I have been looking around and this seems to be related to WixUI_Advanced but I have no idea how I am triggering Wix to think I am using that.

I have the feeling I am doing something silly with referencing wrong but I can't seem to get my fingers on the right way so I hope somebody can tell me how to get this working.


Solution

  • Of course, while cleaning up all the search tabs I came across something that solved it and then realised some details. The problem is that my new dialog is not in the 'InstallUISequence' but part of the flow on WelcomeDlg's sequence number. Therefore it can't be referenced in a before/after. The solution to this is to not try to set the custom even in the 'InstallUISequence' but put it in a publish of the button going towards the new page like this on the button description itself:

    <Publish Event="DoAction"  Value="WindowsFeatures">1</Publish>
    

    or like this when adding it later from a UI block

    <Publish Dialog="WelcomeDlg" Control="Next" Event="DoAction" Value="WindowsFeatures" >1</Publish>
    

    I still don't get the 'WixUI_Advanced' getting dragged into the story though.