WiX v4で、ビルド構成の種類に応じて、変数を設定する。
*****.wixproj
<PropertyGroup>
<Configurations>Debug;Release;Hoge</Configurations>
</PropertyGroup>
- Debug
- Release
- Hoge
の、ビルド構成です。
Common.wxi
<?xml version="1.0" encoding="utf-8"?>
<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?if $(Configuration) = Hoge?>
<?define ReadmeFilePath="..\Files\a.txt"?>
<?else?>
<?define ReadmeFilePath="..\Files\b.txt"?>
<?endif?>
</Include>
Hogeでは、a.txt。それ以外では、b.txtを変数に設定
参照
Package.wxs
<?include Common.wxi?>
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Component Directory='INSTALLFOLDER' >
<File Source="$(ReadmeFilePath)" />
</Component>
メモ
サンプルや解説があまり無いため、GitHubで、コードを検索して参考にしました。