Sunday, April 1, 2012

Wix + TFS : problem with building on x64 build agents

I ran into interesting problem recently, trying to build wix custom action project on our build agent (simple wix project had no problem).
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1360): Could not resolve this reference. Could not locate the assembly "Microsoft.Deployment.WindowsInstaller". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
The worst part was that when I logged in to the machine and built same stuff from visual studio – it worked as a charm.
So, after some investigation, I found that on x64 machines Wix installer writes its information only under wow6432Node. And naturally, x64 MSBuild process can’t find them.

Solution 1:
Add new string  as HKLM\SOFTWARE\Microsoft\.NETFramework\AssemblyFolders\WiX 3.5 with value set to C:\Program Files (x86)\Windows Installer XML v3.5\SDK\(same as under Wow6432Node - HKLM\SOFTWARE\Wow6432Node\Microsoft\.NET
Framework\AssemblyFolders\WiX 3.5)

Solution 2: 
(which turned to be much easier) choose to run MSBuild on x86 (when edit build definition)


Hope that helps somebody :)

1 comment: