How to reference SystemFolder in WiX Icon.SourceFile property?

心已入冬 提交于 2019-12-25 06:16:41

问题


To make the long story short, this doesn't work:

<Icon Id="msiexec.ico" SourceFile="[SystemFolder]msiexec.exe"/>

(Error 4 The system cannot find the file '[SystemFolder]msiexec.exe')

And this doesn't work too:

<Icon Id="msiexec.ico" SourceFile="$(var.SystemFolder)msiexec.exe"/>

Error 3 Undefined preprocessor variable '$(var.SystemFolder)'.


回答1:


The second sample in your question will work if you pass var.SystemFolder as a parameter to candle.exe.

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.



来源:https://stackoverflow.com/questions/11136274/how-to-reference-systemfolder-in-wix-icon-sourcefile-property

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!