2012-04-26 28 views
1

我維克斯項目包含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」屬性的值

什麼問題?

+0

運行MSI程序是這樣的:MSIEXEC/I myprod.msi/L * V install.log的該WXS看起來是正確的給我。 – MariusCC 2012-04-26 17:18:32

+0

從日誌中提取:http://pastebin.com/5BWU3rt9 – NieAR 2012-04-27 07:19:38

回答

4

解決方案

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

使用ORCA查看MSI的ControlEvent表。我在猜測,因爲你沒有指定一個Order屬性,你的訂單是全錯的,並且在增強的ControlEvent有機會運行之前正在處理NewDialog [NEXTDIALOG]。