[wix-devs] NuGet support for wixlibs

Heath Stewart Heath.Stewart at microsoft.com
Mon Mar 7 15:05:56 PST 2016


I've talked with the NuGet team quite a bit about this and don't think it will happen - at least not any time soon. However, I did evolve a strategy which works without scripting support that is checked into wix4. See commit 24c1d14313e6809202903ab3bf8401f739d0b4d1.

The only thing I've evolved further with some help from Andrew Arnott (who does a lot with solution explorer / common project system) is to create a target that imports wixlibs and/or WiX extensions as references. Seems MPF (which Votive uses) doesn't like references added by .targets files so we hook the build targets to add them during build only. I.e., something like this:

<Target Name="ReferenceMyWixlib" BeforeTargets="CoreBuild">
  <ItemGroup>
    <WixLibrary Include="..\wix\mywixlib.lib" />
  </ItemGroup>
</Target>

Put that in a file like build\MyNuGetPackageName.targets (matching MyNuGetPackageName, of course) and this works.

In case the NuGet team ever does add first-party support for wixlibs, they ask you do not put wixlibs (or WixExtensions) under the special "lib" root directory of a package.

Heath Stewart
Visual Studio, Microsoft
http://blogs.msdn.com/heaths

-----Original Message-----
From: wix-devs [mailto:wix-devs-bounces at lists.wixtoolset.org] On Behalf Of Tom Glastonbury
Sent: Monday, March 7, 2016 1:32 AM
To: wix-devs at lists.wixtoolset.org
Subject: [wix-devs] NuGet support for wixlibs

This is about using NuGet packages to distribute wixlibs, and follows on
from:

https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwindows-installer-xml-wix-toolset.687559.n2.nabble.com%2fNuGet-support-for-wixlibs-extensions-td7598683.html&data=01%7c01%7cHeath.Stewart%40microsoft.com%7cfea97d298d7f4a19d9bf08d3466b4a69%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=o42PpMp3LKwZ4WLZa1VJvnQXCt6lMeQsC3N2vMC%2bkvk%3d

I'm not sure if WiX has grown built-in support for this since that thread was posted, but I failed to find anything despite vigorous Googling. We needed this functionality in-house at my workplace, so I created a NuGet package that, when added to a WiX Library project, extends the build process to produce a NuGet package that can be added to a WiX project, adding a reference to the wixlib. In case it might be useful for others, I've put the project on github and published the generator package to nuget.org. The project is called WixNuGetPackager.

https://github.com/zanyants/WixNuGetPackager
https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fwww.nuget.org%2fpackages%2fWixNuGetPackager&data=01%7c01%7cHeath.Stewart%40microsoft.com%7cfea97d298d7f4a19d9bf08d3466b4a69%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=3TGX1LviYAq%2fialzkSW5j7pWg8zPaiXnwKsAeyZXY78%3d

See the github project homepage for details of use, and notably a disclaimer regarding limited test scenarios.

Thanks,

Tom
____________________________________________________________________
WiX Toolset Developer Mailing List provided by FireGiant https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwww.firegiant.com%2f&data=01%7c01%7cHeath.Stewart%40microsoft.com%7cfea97d298d7f4a19d9bf08d3466b4a69%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=70rQyQUxMZ6q7kKQu8%2f9DfaPejsucYRmJS8%2f5H23z5o%3d


More information about the wix-devs mailing list