0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WiX4 ビルド構成の種類に応じて、変数を設定

Posted at

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を変数に設定

参照

Preprocessor

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で、コードを検索して参考にしました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?