10

I have a VS2012 Solution with 3 build configurations:

  • Debug
  • Release
  • "Mine"

In the Configuration Manager, I have some .NET projects with options based on the Mine configuration. All ok.

I have a WiX installer project which in the Configuration Manager, appears to only support Release and Debug as options - I cannot add Mine as an option there.

As a consequence, when I build my WiX project, while each dependent C# project uses the Mine configuration, the WiX project uses Release.

Generally this would not be a problem, however I have a BeforeBuild action which is using $(Configuration). And this is pulling in Release instead of my desired and selected "Mine".

Any ideas how I can pass or reference Mine from MSBuild from a project that does not include it? Is there another $(ActiveConfiguration) or similar?

Thanks

2 Answers 2

12

I do believe it's a bug in WiX. If you edit your wxproj file, you should see that there is no record for "Mine". To fix such issues, you need to edit wixproj file manually and copy the relevant section for "Release" mode and dupliate it and change it to "Mine".

Some links: http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Adding-deleting-project-configurations-td7582655.html

http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Changing-configuration-and-or-platform-in-solution-Configuration-Manger-does-nothing-td7588992.html

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, but neither link works. Maybe you'd like to update.
0

Just in case it helps, I was using Wix 3.14 in VS2022 to build installer for an Office add-in (VSTO). Point to remember is that you need to actually have all configurations listed in your wixproj file for it to follow solution configuration. Even if you used Wix Project Templates to create your installer project, your wixproj may not have matching platform/configuration entry, which you need to add manually.

Simply right-click your wix project, unload it and edit the wixproj file to add the following:

  <!-- Common build attributes -->
  <PropertyGroup>
    <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
    <ErrorReport>prompt</ErrorReport>
    <WarningLevel>4</WarningLevel>
    <LangVersion>9.0</LangVersion>
    <DefineConstants>VSTO40;TRACE</DefineConstants>
  </PropertyGroup>

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <PlatformTarget>x86</PlatformTarget>
    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
    <DefineConstants>$(DefineConstants);DEBUG</DefineConstants>
  </PropertyGroup>

  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <Optimize>false</Optimize>
    <PlatformTarget>x64</PlatformTarget>
    <EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
  </PropertyGroup>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.