Chocolatey: How to retain certain version of a package but install new version when available also?
I have a software with v1.0 installed with chocolatey. I want to keep that version but want chocolatey to install v2.0 also (next to the older one) when I do the next choco update all
.
Is:
choco pin add -n=<softname> --version=<1.0>
and:
choco install <softname>
enough? Did I miss something? Is there another way to do this?
EDIT.: as user @Seth noted, yes the software allows multiple installations.
In package management, you should have one version of a piece of software installed. If the underlying software supports multiple versions, what you are looking to do is create a package id per something about the version that is your breaking areas.
PREFERRED: A Package Id Per Some Part of The Version (Major, Major Minor, etc)
Aka ruby1.9
, ruby2.0
, ruby2.x
. If you are talking about .NET Framework, that is a package ID per full version as the software sits side by side.
This allows you to have a nice upgrade path for all of those versions and it is completely compatible with all integrations you might use with Chocolatey.
NOT RECOMMENDED: Side By Side Installation
There is also a way to run multiple package installations and track multiple versions of a single package id, but it doesn't support upgrade and it is not able to be used with configuration management, so it's not something we would recommend. However I don't know your constraints, so if you do need to do this,
you would run choco install
with --allow-multiple-versions
. From the documentation:
-m, --sxs, --sidebyside, --side-by-side, --allowmultiple, --allow-multiple, --allowmultipleversions, --allow-multiple-versions
AllowMultipleVersions - Should multiple versions of a package be
installed? Defaults to false.