Coder Social home page Coder Social logo

Comments (9)

afroewis avatar afroewis commented on May 29, 2024 1

When using upgrade, it upgrades the package if the version in the source folder is newer than the installed one.

I also noticed that the installation works if I provide the version with --version. With this switch, I can even install older versions.

I guess I just shouldn't use --force.
Thanks for your help.

from choco.

pauby avatar pauby commented on May 29, 2024

choco install foo-cc --source 'C:\temp\bad1' -Y --force -d

You mentioned that the package is in the C:\temp\bad folder. But you specified the source as C:\temp\bad1?

from choco.

afroewis avatar afroewis commented on May 29, 2024

Sorry, that was a typo when writing the issue. In my extensive tests, the correct directory was used. I will edit my issue to remove this confusion.

from choco.

pauby avatar pauby commented on May 29, 2024

I can't reproduce the issue here (note there are no issues with having '-' in the package name):

image

Note that my package above is empty and doesn't have any Chocolatey scripts. Can you provide your package?

from choco.

afroewis avatar afroewis commented on May 29, 2024

Thanks for your efforts so far. Did you use filename that contains dots (like foo-cc.24.5.24095.5.nupkg?)

I can't provide my package (secret stuff), but I will try to reproduce it with an empty package this weekend!

from choco.

pauby avatar pauby commented on May 29, 2024

The dots are the version number. The filename of the package was foo-cc.24.5.24095.5.nupkg.

from choco.

afroewis avatar afroewis commented on May 29, 2024

I tried to reproduce the problem but didn't succeed. When renaming the file, the installation still fails. That's weird. I am convinced it was that way.

However, I looked more into this issue and I found out that my problem is related to the version of the package.

I have two files:

  • ClassLibrary1.1.2.0.nupkg
  • ClassLibrary1.1.3.0.nupkg

First, I install version 1.2.0 without any problems:
choco install ClassLibrary1 --source "C:\temp\foo" -f -y

Then, I try to install version 1.3.0:
choco install ClassLibrary1 --source "C:\temp\<path-to-1-3>" -f -y

Output:

choco install ClassLibrary1 --source "C:\temp\foo" -f -y
Chocolatey v2.2.2
Installing the following packages:
ClassLibrary1
By installing, you accept licenses for the packages.
ClassLibrary1 v1.2.0 already installed. Forcing reinstall of version '1.2.0'.
 Please use upgrade if you meant to upgrade to a new version.
ClassLibrary1 not installed. The package was not found with the source(s) listed.

My expectation was that when using --force , it will install the package in the folder, even though a different version of it is already installed.

from choco.

pauby avatar pauby commented on May 29, 2024

What happens when you do what the message suggests and use upgrade?

--force installs the same version again in this case. Note that using --force is not recommended as, as this case demonstrates, it will not do what you think.

from choco.

pauby avatar pauby commented on May 29, 2024

I can even install older versions.

Note that you need to add --allow-downgrade to install older versions over a new version.

from choco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.