0

在 bundle.wxs 中,我试图设置一个自定义变量,该变量基于正在构建的配置,如下所示:

<Variable Name="SETTINGPROVIDERURL" Value="$(var.siteloc)"/>

我正在尝试在 VS2017 项目的“属性”>“构建”选项卡上设置“siteloc”。我正在尝试预处理器和 wixvariable 以使至少一个通过。 Visual Studio wix bootstrap 项目属性构建选项卡

在 wixproj 文件中,我可以看到这些:

 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
    <OutputPath>bin\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
    <WixVariables>siteloc=bar;</WixVariables>
    <DefineConstants>siteloc=foo;</DefineConstants>
  </PropertyGroup>

当我构建时,我得到 CNDL0150:未定义的预处理器变量'$(var.siteloc)'。如您所见,我的变量(任何一个)都没有作为参数添加到 VS 控制台中的蜡烛:

2>------ Build started: Project: KioskHostBootstrapper, Configuration: Release x86 ------
2>  C:\Program Files (x86)\WiX Toolset v3.11\bin\candle.exe -dBuildVersion=5.0.307.1 -d"DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\\" -dSolutionDir=C:\centrics\CentricsStoreFront_5_0\Source\ -dSolutionExt=.sln -dSolutionFileName=CentricsStoreFront_5_0.sln -dSolutionName=CentricsStoreFront_5_0 -dSolutionPath=C:\centrics\CentricsStoreFront_5_0\Source\CentricsStoreFront_5_0.sln -dConfiguration=Release -dOutDir=bin\Release\ -dPlatform=x86 -dProjectDir=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostBootstrapper\ -dProjectExt=.wixproj -dProjectFileName=KioskHostBootstrapper.wixproj -dProjectName=KioskHostBootstrapper -dProjectPath=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostBootstrapper\KioskHostBootstrapper.wixproj -dTargetDir=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostBootstrapper\bin\Release\ -dTargetExt=.exe -dTargetFileName=KioskHostSetup.exe -dTargetName=KioskHostSetup -dTargetPath=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostBootstrapper\bin\Release\KioskHostSetup.exe -dKioskHostInstaller.Configuration=Release -d"KioskHostInstaller.FullConfiguration=Release|x86" -dKioskHostInstaller.Platform=x86 -dKioskHostInstaller.ProjectDir=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostInstaller\ -dKioskHostInstaller.ProjectExt=.wixproj -dKioskHostInstaller.ProjectFileName=KioskHostInstaller.wixproj -dKioskHostInstaller.ProjectName=KioskHostInstaller -dKioskHostInstaller.ProjectPath=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostInstaller\KioskHostInstaller.wixproj -dKioskHostInstaller.TargetDir=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostInstaller\bin\Release\ -dKioskHostInstaller.TargetExt=.msi -dKioskHostInstaller.TargetFileName=KioskHostInstaller.msi -dKioskHostInstaller.TargetName=KioskHostInstaller -dKioskHostInstaller.TargetPath=C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostInstaller\bin\Release\KioskHostInstaller.msi -out obj\Release\ -arch x86 -ext "C:\Program Files (x86)\WiX Toolset v3.11\bin\\WixUtilExtension.dll" -ext "C:\Program Files (x86)\WiX Toolset v3.11\bin\\WixBalExtension.dll" Bundle.wxs
2>C:\centrics\CentricsStoreFront_5_0\Source\StoreFrontUtilities\KioskHost\WiXInstaller\KioskHostBootstrapper\Bundle.wxs(20,0): error CNDL0150: Undefined preprocessor variable '$(var.siteloc)'.
2>Done building project "KioskHostBootstrapper.wixproj" -- FAILED.

我试过这个SF 建议

 <PropertyGroup>
    <siteloc>fubar</siteloc>
 </PropertyGroup>

但它没有用。

我错过了什么?

4

0 回答 0