chocolatey / Chocolatey.Cake.Recipe

A set of convention based Cake scripts for building Chocolatey projects
Apache License 2.0
5 stars 9 forks source link

Wix dependency missing #159

Open flcdrg opened 3 weeks ago

flcdrg commented 3 weeks ago

Checklist

What You Are Seeing?

Building choco reports an error because it can't find tools\WiX.3.11.2\build\wix.props

What is Expected?

Wix dependencies should be included so build doesn't report this error

How Did You Get This To Happen?

  1. ./build.ps1

System Details

Installed Packages

N/A

Output Log

Restore
========================================
Restoring src/chocolatey.sln...
MSBuild auto-detection: using msbuild version '17.9.8.16306' from 'C:\Program Files (x86)\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin'.
C:\vagrant\src\chocolatey.install\chocolatey.install.wixproj(3,3): error MSB4019: The imported project "C:\vagrant\tools\WiX.3.11.2\build\wix.props" was not found. Confirm that the expression in the Import declaration "..\..\tools\WiX.3.11.2\build\wix.props" is correct, and that the file exists on disk.

Additional Context

No response

TheCakeIsNaOH commented 3 weeks ago

This can be worked around by adding #tool nuget:?package=WiX&version=3.11.2 to the second line of the recipe.cake. https://github.com/TheCakeIsNaOH/choco/commit/7021fcf25943b65dd90cef7507cf0604c294c6d9

It may be something that needs to be fixed in Chocolatey.Cake.Recipe

flcdrg commented 3 weeks ago

Yeah, I just manually installed the package via nuget install but I'm assuming fixing it here in the Recipe repo is a better option

gep13 commented 2 weeks ago

@flcdrg @TheCakeIsNaOH I am not sure the best approach here...

The whole thought process behind Chocolatey.Cake.Recipe is that it can be used across multiple projects, and not all of those are going to make use of WiX, so adding it as a dependency on the whole recipe is not the right approach in my opinion.

The suggestion that @TheCakeIsNaOH makes putting the onus on the project itself to put this dependency in place.

While this isn't ideal, it does mean that it won't be added everywhere.

Perhaps we could make the Recipe smarter, by looking for the presence of a .wixproj file in the .sln file, and if there, add the dependency.

TheCakeIsNaOH commented 2 weeks ago

Perhaps we could make the Recipe smarter, by looking for the presence of a .wixproj file in the .sln file, and if there, add the dependency.

I think this would be the right long term course of action. Alternatively, using a simple configuration switch in each project to determine if the package should be installed would allow central control of the versioning.