"INSTALLTHIS ="YES ""기능을 설치하려고합니다. 속성 "INSTALLTHIS"는 처음에 "NO"로 설정됩니다. 조치 "test_command"가 "INSTALLTHIS"도 "YES"로 설정합니다. "test_command2"의 메시지 상자는이 속성의 값이 "YES"로 설정되었음을 보여줍니다. 설치하지 않으면 "INSTALLTHIS ="YES ""가 참이므로 "ProductFeature"가 설치 될 것으로 예상됩니다. WIX - 조건부로 기능 설치
<?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>
는