问题描述
长话短说,这行不通:
<Icon Id="msiexec.ico" SourceFile="[SystemFolder]msiexec.exe"/>
(错误 4 系统找不到文件[SystemFolder]msiexec.exe")
(Error 4 The system cannot find the file '[SystemFolder]msiexec.exe')
这也行不通:
<Icon Id="msiexec.ico" SourceFile="$(var.SystemFolder)msiexec.exe"/>
错误 3 未定义的预处理器变量 '$(var.SystemFolder)'.
Error 3 Undefined preprocessor variable '$(var.SystemFolder)'.
推荐答案
如果您将 var.SystemFolder
作为参数传递给 candle.exe代码>.
The second sample in your question will work if you pass var.SystemFolder
as a parameter to candle.exe
.
元素映射到 Icon MSI 表.在构建时,它会尝试找到您在
SourceFile
属性中指定的路径,并将其作为二进制数据流式传输到 Icon 表的 Data
列.这意味着,应该在构建时知道路径.但这在您的第一个示例中并非如此 - SystemFolder
在安装时解析.
The <Icon>
element is mapped to the Icon MSI table. At build time it tries to find the path you specify in SourceFile
attribute and stream it as binary data to the Data
column of the Icon table. This means, the path should be known at build time. But this is not true in your first sample - SystemFolder
is resolved at install time.
这篇关于如何在 WiX Icon.SourceFile 属性中引用 SystemFolder?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!