Open patriksvensson opened 6 years ago
@patriksvensson I don't think this scenario is supported currently. To be able to run pack, one must have Chocolatey installed. I agree on some sort of flag that would change its behavior some and we've been thinking about how we might do that.
Something like --portable
@ferventcoder I was thinking of (trying to) submitting a PR for this tonight. If you have any objections, speak now 😄
@patriksvensson go for it, you already know our expectations for contributing ;)
@patriksvensson it looks like @gep13 has some work on this.
I hope it's okay that we let @gep13 continue and see where it ends. Then we'll see what is left from there.
@ferventcoder Sounds good to me. I forked and started on it, but didn't get anywhere at that time.
If pack
was an independent operation in an independent library, then it could be added to dotnettools in the same way as dotnet push
allows people to easily publish chocolatey packages using the same csproj metadata as dotnet push
uses for nuget packages.
What You Are Seeing?
When using
choco pack
, attempts are made to accessC:\ProgramData
which results in warnings and errors. I do not have Chocolatey installed on the machine this error occured on, but installed thechocolatey
package (version 0.10.8) from nuget as part of a Cake script.This also affects CI builds.
What is Expected?
For choco.exe not to do attempt anything that requires Chocolatey to be installed when packing or elevated rights. If this behavior can't be changed, an opt-out flag to choco.exe would be appreciated (when running it in "portable" mode).
How Did You Get This To Happen? (Steps to Reproduce)
I ran the following command:
D:/Source/Git/spectre/jarvis/tools/chocolatey.0.10.8/chocolatey/tools/chocolateyInstall/choco.exe" pack -y --version "0.3.0-alpha0074" "D:/Source/Git/spectre/jarvis/installer/chocolatey/jarvis.temp.nuspec
Output Log
I would be happy to help out with a PR for this issue if you think it's worth pursuing (and if I get some pointers).