The toolset package will not install for a custom-action project
Opened this issue · 1 comments
This defeats the purpose of the NuGet package from a build-server POV when custom-action projects are part of the solution.
My WIXPROJ has the following:
<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.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" /> </Target>
My custom-action CSPROJ has a similar section like:
<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') " /> <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixCATargetsImported)' != 'true' "> <Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" /> </Target>
I can successfully add the WiX.Toolset package to the WIXPROJ. But when I add it to the CSPROJ, I get the following in the Output-Package Manager:
Attempting to gather dependency information for package 'WiX.Toolset.UnofficialFork.3.11.0' with respect to project 'InstallerCustomActions', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'WiX.Toolset.UnofficialFork.3.11.0' with DependencyBehavior 'Lowest'
Resolving actions to install package 'WiX.Toolset.UnofficialFork.3.11.0'
Resolved actions to install package 'WiX.Toolset.UnofficialFork.3.11.0'
Package 'WiX.Toolset.UnofficialFork.3.11.0' already exists in folder 'C:\CopperLeaf\VC2015_Dev\packages'
Added package 'WiX.Toolset.UnofficialFork.3.11.0' to 'packages.config'
Executing script file 'C:\CopperLeaf\VC2015_Dev\packages\WiX.Toolset.UnofficialFork.3.11.0\tools\Install.ps1'...
Install failed. Rolling back...
Executing script file 'C:\CopperLeaf\VC2015_Dev\packages\WiX.Toolset.UnofficialFork.3.11.0\tools\Uninstall.ps1'...
[WiX.Toolset] You need to restart Visual Studio to load the updated WiX Toolset files and prevent build errors.
Removed package 'WiX.Toolset.UnofficialFork.3.11.0' from 'packages.config'
System.Management.Automation.RuntimeException: 'InstallerCustomActions' is not a WiX project! This package will only work on WiX projects. ---> System.Management.Automation.RuntimeException: 'InstallerCustomActions' is not a WiX project! This package will only work on WiX projects.
--- End of inner exception stack trace ---
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at NuGetConsole.Host.PowerShell.Implementation.RunspaceDispatcher.<>c__DisplayClass21_0.b__0()
at NuGetConsole.Host.PowerShell.Implementation.RunspaceDispatcher.WithLock(Action act)
at NuGetConsole.Host.PowerShell.Implementation.RunspaceDispatcher.InvokeCore(Pipeline pipeline, IEnumerable1 inputs) at NuGetConsole.Host.PowerShell.Implementation.RunspaceDispatcher.Invoke(String command, Object[] inputs, Boolean outputResults) at NuGetConsole.Host.PowerShell.Implementation.SyncPowerShellHost.ExecuteHost(String fullCommand, String command, Object[] inputs) at NuGetConsole.Host.PowerShell.Implementation.PowerShellHost.Execute(IConsole console, String command, Object[] inputs) at NuGetConsole.ScriptExecutor.<>c__DisplayClass29_0.<ExecuteScriptCoreAsync>b__0() at System.Threading.Tasks.Task
1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
We use this package in our CustomAction DLL project and it works fine even on build machine.
As I read the installation script, it may not be added directly from the NuGet UI. It will work if you add it manually or force the installation.