WiX undefined preprocessor variable

前端 未结 1 394
春和景丽
春和景丽 2021-02-02 05:58

I\'m starting to use WiX in order to do automated builds to create msi\'s of my c# projects and am experiencing the error \"Undefined preprocessor variable \'$(var.MyPro

相关标签:
1条回答
  • 2021-02-02 06:29

    As you already remarked, your nant build script is not using the wixproj file at all.

    You are mixing two different ways to build a wix setup here:

    1. You can use the candle.exe and light.exe command line tools directly. This ignores the .wixproj file. This is what you are doing in your nant build script. To pass values for preprocessor variables like $(var.MyProject.TargetDir), use options like -dMyProject.TargetDir=c:\foo.

    2. You can author a .wixproj file with votive (the visual studio add-on for wix). Like all visual studio project files, a wixproj file is actually a msbuild file which can be build with msbuild.exe. Variables like $(var.MyProject.TargetDir) are automatically set by the msbuild tasks for building wix setups if the correct project reference exists.

    I recommend you build the wixproj file with the <msbuild> nant task. This ensures that your nant build does the same as when you build the setup manually from visual studio.

    0 讨论(0)
提交回复
热议问题