4
votes

I am trying to build a wixproj on VSTS but so far I only got the following message:

SetupProject1\SetupProject1.wixproj(27,5): Error : The WiX Toolset v3 build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/

For my tests I have created a new wixproj with Wix Toolset v3.11RC2 on my computer and linked it to a new repo on VSTS.

VSTS hosted agent have Wix Toolset v3.10 installed.

The VSTS build use a VS Build Task, with the build Platform set to x86 in order to avoir the AnyCPU error.

I have tried with the Hosted and Hosted VS2017 agent but no luck and also tried the default Wix imports:

<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />

And those recommended for VS2017:

<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(WixCATargetsPath)" Condition=" '$(WixCATargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.CA.targets" Condition=" '$(WixCATargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.CA.targets') " />

Do I need to configure something or is it not possible at the moment?

2
See if updating your imports to full paths to the wix files lets you at least build. Then you know there's something up with the properties in your imports at least.Brian Sutherland
I don't know the path to MSBuild or Wix on a hosted agent, but if you have the info I am willing to try.Jérémie Bertrand
It looks like you need to include wix.targets and wix200x.targets and wix2010.targets with your project and import wix.targets. It will pick up the wix install location via registry search and then set up all the other paths. I think you still need to import wix.ca.targets because it exists in the wix toolset install. Try using the path "$(WIX)SDK\wix.ca.targets". $(WIX) should be the environment variable that points to the install location.Brian Sutherland
hopefully someone else who has actually used hosted agents to build wix projects can chime in with a better response, I'm basically just guessing based on the information I've been able to look at which wasn't much.Brian Sutherland
Thanks, I have tried with $(MSBuildToolPath) and $(WIX) but no luck :'( I will try with the V3.10 of Wix Toolset.Jérémie Bertrand

2 Answers

4
votes

You should install WiX Toolset v3.10. The v3.11 project templates need corresponding toolset version (v3.11).

So, if you want to use v3.11, you need to setup a on premise build agent. BTW, VS2017 needs v3.11 toolset.

Regarding for v3.10 toolset, don’t install Wix Toolset Visual Studio 2015 extension, the WiX v3.10 extension is already provided, so just install Wix v3.10 toolset directly.

Simple steps for v3.10 if you have already install Wix Toolset Visual Studio extension:

  1. Remove Wix Toolset VS extension
  2. Uninstall WiX v3.10 toolset
  3. Install Wix v3.10 toolset
  4. Create a new Wix project in VS2015
  5. Add to source control and build.

The similar issue: The WiX Toolset v3 build tools must be installed to build this project after applying template.

0
votes

To summarize my research after @starain-MSFT had answered:

It is possible to use VS2017 + Wix3.11 on your computer and build on VSTS with VS2015 + Wix3.10, you just have to:

  • use the template from Wix3.10:

    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
    
     ...
    
    <Import Project="$(WixTargetsPath)" />
    
  • avoid any C# 7 specific

The property SuppressValidation set to true might help if you are blocked by ICE warnings.

And if your build hang on VSTS, check the warnings on your computer or set the RunWixToolsOutOfProc property in your .wixproj to true.