2016-06-11 3 views
1

WiX。私は3つのディレクトリのうちの1つにインストールする必要があるプラグインのみを書きます。したがって、私は、カスタムダイアログを作成し、チェーンに挿入:なぜINSTALLFOLDERプロパティがRadioButtonGroupを通じて変更されていないのですか?

enter image description here

これは、このダイアログの私のコードです:私はSelectInstallDirectory.wxsファイルに再びを定義

<?xml version='1.0' encoding='Windows-1252'?> 
<!-- SelectInstallDirectory.wxs 
     © Andrey Bushman, 2016 
     Dialog window for the install directory selection of AutoCAD extension. --> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Fragment> 

    <UI> 
     <!--<Property Id="DefaultUIFont">DlgFont10</Property>--> 
     <TextStyle Id="DlgFont10" FaceName="Tahoma" Size="10" /> 
     <TextStyle Id="DlgFont20" FaceName="Tahoma" Size="20" /> 
     <TextStyle Id="DlgFont10_important" FaceName="Tahoma" Size="10" Red="255" Green="0" Blue="0"/> 
     <TextStyle Id="DlgTitleFont" FaceName="Tahoma" Size="10" Bold="yes" /> 

     <!-- I am forced to define the INSTALLFOLDER again because SelectInstallDirectory dialog 
     doesnt see this property. --> 
     <Property Id="INSTALLFOLDER" Value="$(env.ProgramData)\Autodesk\ApplicationPlugins\ProxyTools.bundle\"/> 

     <!--This dialog selects the install directory through the RadioButton items.--> 
     <Dialog Id="SelectInstallDirectory" Title="AutoCAD extension location" 
       NoMinimize="yes" Width="400" Height="270"> 

     <Control Id="TitleImage" Type="Bitmap" X="0" Y="0" Width="400" Height="65" Text="TitleImageFile"> 
      <Binary Id="TitleImageFile" SourceFile="SelectInstallDirectory_banner.jpg"/> 
     </Control> 

     <Control Id="TitleText" Type="Text" X="60" Y="20" Width="400" Height="35" 
       Transparent="yes" NoPrefix="yes"> 
      <Text>{\DlgFont20}Proxy Tools for AutoCAD</Text> 
     </Control> 

     <Control Id="Title" Type="Text" X="5" Y="85" Width="300" Height="15" 
       Transparent="yes" NoPrefix="yes"> 
      <Text>Select the target directory for the AutoCAD extension installing:</Text> 
     </Control> 

     <Control Id="rbgrPath" Type ="RadioButtonGroup" 
       X="5" Y="100" Width="500" Height="100" Property="INSTALLFOLDER"> 
      <RadioButtonGroup Property="INSTALLFOLDER"> 
      <RadioButton 
       Text="[ProgramFilesFolder]Autodesk\ApplicationPlugins\ProxyTools.bundle\" 
       Value="[ProgramFilesFolder]Autodesk\ApplicationPlugins\ProxyTools.bundle\" 
       Height="13" Width="500" X="5" Y="5"/> 
      <RadioButton 
       Text="$(env.ProgramData)\Autodesk\ApplicationPlugins\ProxyTools.bundle\" 
       Value="$(env.ProgramData)\Autodesk\ApplicationPlugins\ProxyTools.bundle\" 
       Height="13" Width="500" X="5" Y="20"/> 
      <RadioButton 
       Text="$(env.AppData)\Autodesk\ApplicationPlugins\ProxyTools.bundle\" 
       Value="$(env.AppData)\Autodesk\ApplicationPlugins\ProxyTools.bundle\" 
       Height="13" Width="500" X="5" Y="35"/> 
      </RadioButtonGroup> 
     </Control> 

     <Control Id="warning_acad2012" Type="Text" X="5" Y="175" Width="100" Height="30" 
       Transparent="yes" NoPrefix="yes"> 
      <Text>{\DlgTitleFont}WARNING</Text> 
     </Control> 

     <Control Id="warning_acad2012_text" Type="Text" X="10" Y="190" Width="380" Height="40" 
       Transparent="yes" NoPrefix="yes"> 
      <Text>{\DlgFont10_important}Don't select the "$(env.ProgramData)\Autodesk\ApplicationPlugins\ProxyTools.bundle\" variant if you will use AutoCAD 2012, because its bundle-autoloader don't monitor of that directory.</Text> 
     </Control> 

     <Control Id="Back" Type="PushButton" X="205" Y="243" Width="70" 
       Height="17" Default="no" Text="&lt;&lt; Previous"> 
      <Publish Event="NewDialog" Value="LicenseAgreementDlg">1</Publish> 
     </Control> 

     <Control Id="Install" Type="PushButton" X="280" Y="243" Width="56" 
       Height="17" Default="yes" Text="Install"> 
      <Publish Event="NewDialog" Value="SetupTypeDlg">INSTALLFOLDER</Publish> 
     </Control> 

     <Control Id="Cancel" Type="PushButton" X="340" Y="243" Width="56" Height="17" 
       Default="no" Text="Cancel"> 
      <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish> 
     </Control> 
     </Dialog> 
    </UI> 
    </Fragment> 
</Wix> 

ご注意くださいINSTALLFOLDERディレクトリです。私のダイアログにはINSTALLFOLDERプロパティが他のファイルで定義されていると表示されません(下図参照)。それは正しくですか? Product要素に

<Directory Id="TARGETDIR" Name="SourceDir"> 
    <Directory Id="$(var.ADSK_LOCATION)"> 
    <Directory Id="Adsk" Name="Autodesk"> 
     <Directory Id="Adsk_Plugins" Name="ApplicationPlugins"> 
     <Directory Id="INSTALLFOLDER" Name="$(var.EXTENSION_FOLDER_NAME)"> 
      <Directory Id="LICENSE" Name="license"/> 
      <Directory Id="RESOURCES" Name="resources"/> 
      <Directory Id="HELP" Name="help"/> 
      <Directory Id="MENU" Name="menu"> 
      <Directory Id="CUI" Name="cui"/> 
      <Directory Id="CUIX" Name="cuix"/> 
      </Directory> 
      <Directory Id="BIN" Name="bin"> 
      <Directory Id="BIN_RU" Name="ru"/> 
      </Directory> 
     </Directory> 
     </Directory> 
    </Directory> 
    </Directory> 

私はこれを追加しました:

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

    <!-- My dialog for the INSTALLFOLDER value getting. --> 
    <DialogRef Id="SelectInstallDirectory" /> 

    <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="SelectInstallDirectory" Order="3">LicenseAccepted = "1"</Publish> 
    <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="SelectInstallDirectory">1</Publish> 
</UI> 

今私のカスタムダイアログがチェーン内に存在します。しかし、ダイアログ・ウィンドウでターゲット・ディレクトリーの別のバリアントを選択すると、INSTALLFOLDERの値は実際には変更されません。

<Feature Id="$(var.SolutionName)" Title="$(var.ProductName)" Description="The complete package." Display='expand' 
      Level="1" ConfigurableDirectory="INSTALLFOLDER" AllowAdvertise='no' InstallDefault='local' Absent='disallow' 
      TypicalDefault='install'> 

enter image description here

私はそれをどのように修正することができます:私のルートFeature要素はConfigurableDirectoryプロパティ(私はこのプラグインのデバッグのために、この属性を使用する)ためにその変数の値を使用していますか?

答えて

1

重要な問題は、ダイアログが表示される時点で、単にプロパティを設定するだけでディレクトリを変更することができないことです。その代わりに何とかMsiSetTargetPathに電話する必要があります。通常、ダイアログからこれを行う最善の方法は、SetTargetPath Control Eventです。プロジェクトでは、これは次のようになります。

: : : 
<Control Id="Install" Type="PushButton" X="280" Y="243" Width="56" 
      Height="17" Default="yes" Text="Install"> 
    <Publish Event="SetTargetPath" Value="INSTALLFOLDER">1</Publish> 
    <Publish Event="NewDialog" Value="SetupTypeDlg">INSTALLFOLDER</Publish> 
</Control> 
: : : 

プロパティの設定が機能するのはなぜですか? Costingは通常、初期プロパティに基づいて一連のディレクトリ計算を行い、内部で多くのターゲットパスを設定します。したがって、CostFinalizeアクションの前に、プロパティを設定することができます(また、必須である)。 CostFinalizeの後、MsiSetTargetPathをより直接的に呼び出す必要があります。

関連する問題