如何在自定义操作中正确使用RadioButton控制的WIX属性? [英] How do I correctly use a WIX property controlled by a RadioButton in a custom action?

查看:75
本文介绍了如何在自定义操作中正确使用RadioButton控制的WIX属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用VS 2010和WIX 3.10创建了一个基本的WIX项目。我在Mondo UI流程中添加了一个自定义对话框,以提示选择单选按钮。在InstallFinalize之前,自定义操作应显示一个消息框,显示所选目标文件夹(PropertyThatWorks)和单选按钮(PropertyThatDoesNotWork)中的选定值。它显示了PropertyThatWorks的正确值,但它始终显示PropertyThatDoesNotWork的原始值,而不是单选按钮更改的值。我已经通过MSI日志确认了单选按钮更改了PropertyThatDoesNotWork的值。我缺少什么?



以下是WIX脚本:





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 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>

推荐答案

(var.WIX Property Issue Custom Actions.TargetDir)\
(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>
<Dir ectory 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.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.TargetFileName)" Source="


这篇关于如何在自定义操作中正确使用RadioButton控制的WIX属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆