Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: (untagged)
I created a basic WIX project using VS 2010 and WIX 3.10. I added a custom dialog to the Mondo UI flow to prompt selection of a radio button. Before InstallFinalize, a custom action is supposed to display a message box showing the selected destination folder (PropertyThatWorks) and the selected value from the radio buttons (PropertyThatDoesNotWork). It shows the correct value for PropertyThatWorks, but it always shows the original value of PropertyThatDoesNotWork, not the value as changed by the radio buttons. I have confirmed via the MSI log that the value of PropertyThatDoesNotWork is being changed by the radio buttons. What am I missing?

The following is the WIX script:


XML
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="Sample Application" Language="1033" Version="1.0.0.0" Manufacturer="Example Company" UpgradeCode="9636b8cf-969b-433c-87d7-9ef62222d009">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" />

        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
        <MediaTemplate />

        <Feature Id="ProductFeature" Title="Sample Application" Level="1" ConfigurableDirectory="INSTALLFOLDER">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>

    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
    <UIRef Id="WixUI_Common"/>
    <UIRef Id="WixUI_Mondo" />
    <UIRef Id="WixUI_ErrorProgressText" />

    <Property Id="PropertyThatDoesNotWork" Value="2"/>

    <UI Id="Mondo">
      <TextStyle Id="DlgFont8" FaceName="Tahoma" Size="8" />
      <TextStyle Id="DlgTitleFont" FaceName="Tahoma" Size="8" Bold="yes" />

      <Dialog Id="PropertySelectionDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
        <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">
          <Text>{\DlgTitleFont}Please select one of the following:</Text>
        </Control>

        <Control Id="RadioButtonGroupID1" Type="RadioButtonGroup" X="30" Y="40" Width="305" Height="200" Property="PropertyThatDoesNotWork">
          <RadioButtonGroup Property="PropertyThatDoesNotWork">
            <RadioButton Value="0" X="0" Y="0" Width="200" Height="10" Text="Item 0" />
            <RadioButton Value="1" X="0" Y="20" Width="200" Height="10" Text="Item 1" />
            <RadioButton Value="2" X="0" Y="40" Width="200" Height="10" Text="Item 2" />
          </RadioButtonGroup>
        </Control>

        <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="Back">
          <Publish Event="NewDialog" Value="WelcomeDlg" Order="3">1</Publish>
        </Control>
        <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="Next">
          <Publish Event="NewDialog" Value="SetupTypeDlg" Order="3">1</Publish>
        </Control>
        <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>

      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="PropertySelectionDlg"  Order="3">1</Publish>
      <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="PropertySelectionDlg"  Order="3">1</Publish>
    </UI>

    <Binary Id="CustomActionsDll" src="$(var.WIX Property Issue Custom Actions.TargetDir)\$(var.WIX Property Issue Custom Actions.TargetName).CA.dll" />

    <CustomAction Id="WixPropertyIssueInstall" Return="check" Execute="immediate" BinaryKey="CustomActionsDll" DllEntry="WixPropertyIssueInstallAction" />

    <InstallExecuteSequence>
      <Custom Action="WixPropertyIssueInstall" Before="InstallFinalize" >NOT Installed</Custom>
    </InstallExecuteSequence>
    </Product>

    <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="Example_Company" Name="Example Company">
          <Directory Id="INSTALLFOLDER" Name="Sample Application">
            <Directory Id="PropertyThatWorks"/>
          </Directory>
        </Directory>
      </Directory>
    </Directory>
    </Fragment>

    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
      <Component Id="Sample_Application" Guid="{A229C807-0827-475E-9AA2-674C968F5DC1}">
        <File Id="Sample_Application" Name="$(var.Sample Application.TargetFileName)" Source="$(var.Sample Application.TargetPath)"/>
      </Component>
        </ComponentGroup>
    </Fragment>
</Wix>
Posted

1 solution

I was unaware that MSI properties can be scoped private or public. As such, I unknowingly defined a private property by using a mixed-case name. As per https://msdn.microsoft.com/en-us/library/aa370912(v=vs.85).aspx[^], public properties must use all upper-case.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900