robertZaufall / ChocolateStoreCore

Download, modify and cache chocolatey packages locally
Apache License 2.0
9 stars 1 forks source link

Install dedicated version of a package #57

Closed natefabian18 closed 2 months ago

natefabian18 commented 3 months ago

Would it be possible to specify a specific line in the download list to be of a specific version. Im trying to install a nodejs application offline and would need the LTS version of nodejs rather than the experimental. Similar to how you can install a dedicated version though the choco command with choco install nodejs --version 20.15.0

robertZaufall commented 3 months ago

It's sure possible but I did not have the usecase myself by now.

Nodejs is an easy case to do it by hand by the way.
You can download the nodejs.install-nupkg directly from the chocolatey repository, as the binaries are embedded in the file and the package has not to be modified for local storage.
nodejs.install is sufficient - you don't need the nodejs package.

gggggeorge commented 2 months ago

First, let me say ChocolateStoreCore is very cool (I was doing basically the same thing, but editing the nupkg packages myself -which is not so much fun), especially that it iterates through any dependencies.


I'm all for this as well (ability to specify a version).

Here is a real-world example, I just encountered:

I just tried downloading firefox, and ChocolateStoreCore.exe successfully gets version 127.0.2:

image


I go to https://community.chocolatey.org/packages/Firefox

-and the latest is actually 128.0.0, as per (released yesterday 07/09/2024):

image


So, to avoid this sort of ambiguity of whatever the logic is (caching, 2nd to the latest version, etc.), could we simply have the ability to indicate the (optional) version in download.txt:

firefox 128.0.0

Some reasons why:

  1. maybe I only want version x.y.z, a few versions older than the latest/greatest.

  2. if I mess up (I accidentally delete my "store" dir), I can just run ChocolateStoreCore.exe, and it will do exactly what it did say, three weeks ago, when I ran it -this is great for repeatability.


For context, I'm using ChocolateStoreCore.exe to create the "corrected" packages (meaning external binaries are now local downloads), in the context of a Sonatype Nexus service:

Thanks, George H. 07/10/2024 4:07pm ET

robertZaufall commented 2 months ago

Should be fixed now. Use this syntax as suggested: firefox 128.0.0 or nodejs.install 20.15.0. Please let me know if this works for you.

gggggeorge commented 2 months ago

I just tried it out, and it works great, many thanks!