J'essaie d'installer une fonction avec la condition suivante: "INSTALLTHIS =" YES "". La propriété "INSTALLTHIS" initialement défini "NON". L'action "test_command" définit "INSTALLTHIS" aussi "OUI". La boîte de message dans "test_command2" montre que la valeur de cette propriété a été définie "OUI". Je m'attendrais à ce que "ProductFeature" soit installé parce que "INSTALLTHIS =" YES "" est vrai sauf qu'il n'est pas installé.WIX - Installation conditionnellement
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Product Id="*" Name="test" Language="1033" Version="1.0.0.0" Manufacturer="test_wix" UpgradeCode="351b96ea-a1af-4542-8be9-9e8e07878a99">
<Property Id="INSTALLTHIS" Value="NO" Secure="yes"></Property>
<Feature Id="ProductFeature" Title="SetupProject1" Level="0">
<ComponentRef Id="ClientSoftware" />
<Condition Level="1">
<![CDATA[INSTALLTHIS="YES"]]>
</Condition>
</Feature>
<CustomAction Id="test_command" Script="vbscript">
<![CDATA[
Session.Property("INSTALLTHIS") = "YES"
]]>
</CustomAction>
<CustomAction Id="test_command2" Script="vbscript">
<![CDATA[
MsgBox(Session.Property("INSTALLTHIS")) <!-- SAYS YES IN THE MESSAGE BOX -->
]]>
</CustomAction>
<InstallExecuteSequence>
<Custom Action="test_command" After="CostFinalize">NOT Installed</Custom>
<Custom Action="test_command2" After="test_command">NOT Installed</Custom>
</InstallExecuteSequence>
</Product>
(j'ai supprimé le XML inutiles comme les paramètres d'annuaire, ComponentGroup, Component)