5

我正在阅读其他人编写的 WIX 脚本。有一些代码真的让我很困惑。

<Custom Action='UnLoadSchedulerPerfCounters' After='InstallInitialize'>
    <![CDATA[(Installed) AND (!Scheduler = 3)]]>
</Custom>
<Custom Action='RollbackSchedulerPerfCounters' After='WriteRegistryValues'>
        <![CDATA[(&Scheduler = 3)]]>
</Custom>

!Scheduler那么,和有什么区别&Scheduler呢?&当属性以or为前缀时有什么特殊含义!吗?

4

2 回答 2

7

来自http://www.tramontana.co.hu/wix/lesson5.php#5.3

在名称前添加一些特殊字符将赋予它们额外的含义:

%     environment variable (name is case insensitive)
$     action state of component
?     installed state of component
&     action state of feature
!     installed state of feature

最后四个可以返回以下整数值:

-1   no action to be taken
1    advertised (only for components)
2    not present
3    on the local computer
4    run from the source
于 2008-10-29T11:01:36.120 回答
5

这些是 Windows Installer 条件语法上的运算符。有关完整列表,请参阅此 MSI SDK 文档:http: //msdn.microsoft.com/en-us/library/aa368012.aspx

于 2008-10-29T15:39:50.880 回答