New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolset Installer does not install in correct location for Build Tools #5700

Closed
auxym opened this Issue Oct 10, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@auxym

auxym commented Oct 10, 2017

Before marking this as duplicate, please note that I have seen issues #5622 and #5525. I don't believe that the suggested fix to the project templates fully fixes the issue on machines where only Build Tools (not Visual Studio) is installed.

Referenced in the above issues, the wix targets are imported from "$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets"

When installed on a machine with a full VS installation (eg the professional version), this path resolves to C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft. In this case, wix targets are correctly installed in this path.

However, when only the bare Build Tools are installed (eg on a build server), the path resoves to C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft. The WiX toolset installer does not appear to look for this path at install, because even after installing on our build server, I had to manually copy files from C:\Program Files (x86)\MSBuild\Microsoft.

I have tried both the stable 3.11.0.1701 installer as well as the 3.14.0.712 weekly installer. Both seem to exhibit the same behavior. The build server is running Build Tools 2017 on Windows 7 and .Net 4.7 is the latest framework version installed.

@robmen

This comment has been minimized.

Show comment
Hide comment
@robmen

robmen Oct 10, 2017

Member

Manually copying the files is the wrong thing to do. In future updates, you'll likely have issues (we say this from experience because people tried manually copying files in the past then created a stream of bugs against us when VS behavior changed).

The root issue is that MSBuild 15 introduced a breaking change in the handling of C:\Program Files (x86)\MSBuild\Microsoft. We updated our template .wixprojs to work correctly with this breaking change but existing projects must be updated as mentioned in #5525 and #5622.

The location C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft is not stable and can be multi-instanced. It can be targeted via VSIX install (and Votive does this) but the Build Tools install does not support VSIX installs. Given all the gaps in the VS story around extending MSBuild fully, the best fix was to update the template .wixprojs to adapt to the breaking change.

Member

robmen commented Oct 10, 2017

Manually copying the files is the wrong thing to do. In future updates, you'll likely have issues (we say this from experience because people tried manually copying files in the past then created a stream of bugs against us when VS behavior changed).

The root issue is that MSBuild 15 introduced a breaking change in the handling of C:\Program Files (x86)\MSBuild\Microsoft. We updated our template .wixprojs to work correctly with this breaking change but existing projects must be updated as mentioned in #5525 and #5622.

The location C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft is not stable and can be multi-instanced. It can be targeted via VSIX install (and Votive does this) but the Build Tools install does not support VSIX installs. Given all the gaps in the VS story around extending MSBuild fully, the best fix was to update the template .wixprojs to adapt to the breaking change.

@robmen robmen closed this Oct 10, 2017

@auxym

This comment has been minimized.

Show comment
Hide comment
@auxym

auxym Oct 10, 2017

Hi @robmen, as stated in my initial post, I have tried to update my .wixproj files according to #5525 and #5622.

<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') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
    <Error Text="The WiX Toolset v3 build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target>

As well as removing the $(WixTargetsPath) property definition at the top.

However, the import still relies on $(MSBuildExtensionsPath32), which on my build server, msbuild tells me resolves to C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft.

Therefore, I cannot say I understand how the modifications to the .wixproj is supposed to fix the issue.

auxym commented Oct 10, 2017

Hi @robmen, as stated in my initial post, I have tried to update my .wixproj files according to #5525 and #5622.

<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') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
    <Error Text="The WiX Toolset v3 build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
</Target>

As well as removing the $(WixTargetsPath) property definition at the top.

However, the import still relies on $(MSBuildExtensionsPath32), which on my build server, msbuild tells me resolves to C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft.

Therefore, I cannot say I understand how the modifications to the .wixproj is supposed to fix the issue.

@robmen

This comment has been minimized.

Show comment
Hide comment
@robmen

robmen Oct 10, 2017

Member

The Import will look in both the VS2017 location and the ProgramFilesFolder locations when the $(MSBuildExtensionsPath32) property is explicitly in the Project attribute. This works for for others so you'll want to dig into what is different about your use.

For additional support contact wix-users mailing list.

Member

robmen commented Oct 10, 2017

The Import will look in both the VS2017 location and the ProgramFilesFolder locations when the $(MSBuildExtensionsPath32) property is explicitly in the Project attribute. This works for for others so you'll want to dig into what is different about your use.

For additional support contact wix-users mailing list.

@auxym

This comment has been minimized.

Show comment
Hide comment
@auxym

auxym Oct 10, 2017

I didn't know msbuild implicitly looked in both locations, even though the property appears to be set to a single path.

I updated all the .wixproj files I had, and I can confirm it seems to fix the issue.

Sorry for creating this duplicate, then, and thanks a lot for helping out.

auxym commented Oct 10, 2017

I didn't know msbuild implicitly looked in both locations, even though the property appears to be set to a single path.

I updated all the .wixproj files I had, and I can confirm it seems to fix the issue.

Sorry for creating this duplicate, then, and thanks a lot for helping out.

@barnson barnson added the external label Oct 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment