How to reference SystemFolder in WiX Icon.SourceFi

2019-08-16 14:48发布

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)'.

标签: wix wix3.5
1条回答
仙女界的扛把子
2楼-- · 2019-08-16 15:55

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.

查看更多
登录 后发表回答