Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit ed5d89b

Browse files
committed
Fix VS2017 build integration using redirect targets
VS2017 has privatized MSBuild in such a way that it cannot see the installed WiX Toolset build tools. Therefore we add targets to our VSIX to do the work to find the actual installed WiX Toolset build tools.
1 parent 64b0758 commit ed5d89b

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

src/Votive2017/Votive2017.csproj

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,19 @@
2626
<None Include="source.extension.vsixmanifest" />
2727
</ItemGroup>
2828

29+
<ItemGroup>
30+
<Content Include="redirects\v3\wix.targets">
31+
<IncludeInVSIX>true</IncludeInVSIX>
32+
<InstallRoot>MSBuild</InstallRoot>
33+
<VSIXSubPath>Microsoft\WiX\v3.x\</VSIXSubPath>
34+
</Content>
35+
<Content Include="redirects\v4\wix.targets">
36+
<IncludeInVSIX>true</IncludeInVSIX>
37+
<InstallRoot>MSBuild</InstallRoot>
38+
<VSIXSubPath>WiX Toolset\v4\</VSIXSubPath>
39+
</Content>
40+
</ItemGroup>
41+
2942
<ItemGroup>
3043
<ProjectReference Include="..\votive\votive.csproj">
3144
<Project>{24A98296-9D58-42C1-95C0-CC36736409E2}</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="EnsureActualWixToolsetInstalled" ToolsVersion="15.0">
4+
<PropertyGroup>
5+
<WixMSBuildFolder>$(MSBuildProgramFiles32)\MSBuild\Microsoft\WiX\v3.x\</WixMSBuildFolder>
6+
</PropertyGroup>
7+
8+
<Import Project="$(WixMSBuildFolder)wix.targets" Condition=" Exists('$(WixMSBuildFolder)wix.targets') " />
9+
<Target Name="EnsureActualWixToolsetInstalled" Condition=" !Exists('$(WixMSBuildFolder)wix.targets') ">
10+
<Error Text="The WiX Toolset v3 build tools must be installed to build this project. Could not find wix.targets at '$(WixMSBuildFolder)'. To download WiX Toolset v3, see http://wixtoolset.org/releases/" />
11+
</Target>
12+
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="EnsureActualWixToolsetInstalled" ToolsVersion="15.0">
4+
<PropertyGroup>
5+
<WixInstallFolder>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\WiX Toolset\v4', 'InstallFolder', null, RegistryView.Registry32))</WixInstallFolder>
6+
</PropertyGroup>
7+
8+
<Import Project="$(WixInstallFolder)bin\wix.targets" Condition=" Exists('$(WixInstallFolder)bin\wix.targets') " />
9+
<Target Name="EnsureActualWixToolsetInstalled" Condition=" !Exists('$(WixInstallFolder)bin\wix.targets') ">
10+
<Error Text="The WiX Toolset v4 build tools must be installed to build this project. Could not find wix.targets at '$(WixInstallFolder)'. To download WiX Toolset v4, see http://wixtoolset.org/releases/" />
11+
</Target>
12+
</Project>

src/Votive2017/source.extension.vsixmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Dependencies>
1212
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.0,)" />
1313
</Dependencies>
14-
<Installation>
14+
<Installation AllUsers="true">
1515
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[15.0,16.0)" />
1616
</Installation>
1717
<Assets>

0 commit comments

Comments
 (0)