installation - Wix:应用属性发布

标签 installation wix windows-installer wix3.5

我的 Wix 项目包含 3 个文件:

1) Product.wsx - 主 wxs 文件

2) MyDlg.wxs - 我的带有复选框的自定义对话框

3) 1.txt - 任何文件

Product.wxs:

  <Media Id="1" Cabinet="media.cab" EmbedCab="yes" />      
    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

  <Directory Id="TARGETDIR" Name="SourceDir">
     <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="My" />
     </Directory>
  </Directory>

  <DirectoryRef Id="INSTALLFOLDER">
     <Component Id="ProductComponent" Guid="{FC9CE1FD-9BF6-4746-9918-5B2DFA312A2B}">
        <File Id="img" Source="$(sys.CURRENTDIR)1.txt" Name="1.txt" KeyPath="yes" Vital="yes" DiskId="1" />
     </Component>
  </DirectoryRef>

    <Feature Id="ProductFeature" Title="My" Level="1" Absent="allow">
        <ComponentRef Id="ProductComponent" />
     <Condition Level="0">RECOGVERSION = 0</Condition>
  </Feature>

  <UI>
     <UIRef Id="WixUI_Mondo" />
     <UIRef Id="WixUI_ErrorProgressText"/>

     <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="MyDlg" Order="10" >LicenseAccepted = "1"</Publish>
     <Publish Dialog="MyDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" Order="10">NOT Installed</Publish>
     <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MyDlg" Order="10">NOT Installed</Publish>
  </UI>

MyDlg.wxs:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
   <Fragment>
      <UI>
         <Property Id="RECOGVERSION" Value="0" Secure="yes" /><br/>

         <Dialog Id="MyDlg" Width="370" Height="270" Title="My empty dialog">

            <Control Id="RecognitionServerText" Type="Text" X="25" Y="53" Width="340" Height="15" Transparent="yes" NoPrefix="yes" Text="Select version:" />
            <Control Id="RecognitionServerRadioButtonGroup" Type="RadioButtonGroup" X="16" Y="70" Width="120" Height="73" Property="RECOGVERSION" >
               <RadioButtonGroup Property="RECOGVERSION">
                  <RadioButton Height="15" Text="version 1 (old)" Value="0" Width="120" X="0" Y="0" />
                  <RadioButton Height="15" Text="version 2 (new)" Value="1" Width="120" X="0" Y="18" />
               </RadioButtonGroup>
            </Control>

            <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
               <Publish Property="RECOGVERSION" Value="0">RECOGVERSION = "0"</Publish>
               <Publish Property="RECOGVERSION" Value="1">RECOGVERSION = "1"</Publish>
               <Publish Event="NewDialog" Value="CustomizeDlg" Order="10" />
            </Control>
            <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)">
               <Publish Event="NewDialog" Value="LicenseAgreementDlg" Order="10" />
            </Control>
            <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
               <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
            </Control>

         </Dialog>
      </UI>
   </Fragment>
</Wix>

当我尝试点击自定义对话框中的“下一步”按钮时,没有任何反应。 我无法进入下一个对话框。

我尝试从 MyDlg.wxs 中删除这些行:

<Publish Property="RECOGVERSION" Value="0">RECOGVERSION = "0"</Publish>
<Publish Property="RECOGVERSION" Value="1">RECOGVERSION = "1"</Publish>

它有效,但在新窗口中,但“RECOGVERSION”属性的未更新值

问题是什么?

最佳答案

解决方案

<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
   <Publish Event="NewDialog" Value="CustomizeDlg" Order="10">1</Publish>
   <Publish Property="RECOGVERSION" Value="[RECOGVERSION]" Order="11">1</Publish>
</Control>

关于installation - Wix:应用属性发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10334585/

相关文章:

wix - 在 Wix 安装程序上设置 'AllUsers' 选项不起作用

wix - 我们可以在更改产品代码的同时将 1.0.0.0 升级到 1.0.0.1 吗?

java - 如何在 Eclipse Juno 中使用 JavaFX?

wix - 如何比较两个(或多个)MSI文件的内容?

python - PyPi站 pip 缺少sys,subprocess和timeit软件包

windows - 在 Windows 7 上使用 VBScript 安装 inf 驱动程序

ruby - 无法在 Windows 上安装 Aptana Studio 3.6

hadoop - yum安装Hadoop not found报错CENTOS

installation - 从命令行传递的 WiX 条件属性不起作用?

windows-installer - Installshield包括卫星dll