Upgrading Chocolatey versions through Intune

Upgrading Chocolatey versions through Intune

NOTE

The Chocolatey Intune integration shipped as part of v3.0.0 of the Chocolatey Licensed Extension.

NOTE

The Chocolatey Intune integration requires a valid Chocolatey for Business or Chocolatey for Business Trial license.

Upgrade Considerations

As with all upgrades, it is highly recommended that you do a test deployment to ensure the upgrade process works in your environment prior to deploying it to all systems.

Minor / Patch Version Upgrades

Chocolatey CLI Upgrade

The upgrade of minor, or patch, Chocolatey CLI versions that have been deployed through Intune is relatively straightforward. For example when upgrading from v1.3.1 to v1.4.0 of Chocolatey CLI, the process looks like this:

  1. Ensure you have downloaded Chocolatey CLI v1.4.0: choco download chocolatey --version 1.4.0.
  2. Convert the Chocolatey CLI Package: choco convert chocolatey.1.4.0.nupkg --to=intune.
  3. Push the converted package to Intune: choco push chocolatey.1.4.0.intunewin --to=intune.
  4. Deploy the upgrade to a group of test computers.
  5. When you are ready for full deployment to the rest of your computers, you can replace this version as the dependency on your Chocolatey Licensed Extension and Chocolatey License packages to make it more streamlined.

Updating Existing Chocolatey License and Chocolatey Licensed Extension Packages

When you are ready for full deployment to all computers, you need to update the Chocolatey CLI that your Chocolatey License and Chocolatey Licensed packages depend on. Below is an example of how to upgrade from Chocolatey CLI v1.2.1 to v1.4.0, but the process is the same whatever version you are using:

  1. Navigate to the Intune Windows apps pane and search for Chocolatey License.
  2. For each of the “Chocolatey License” and “Chocolatey Licensed Extension” packages:
    1. Navigate to the Properties pane, scroll to Dependencies and click Edit.
    2. Select the three dots to the right of your Chocolatey CLI package (Chocolatey (v1.2.1)) and select Remove.
    3. Click + Add.
    4. Find and Select the new Chocolatey CLI package (Chocolatey (v1.4.0)).
    5. Click Review + save twice followed by Save.

Chocolatey License Extension Upgrade

The upgrade of Chocolatey Licensed Extension versions that have been deployed through Intune is relatively straightforward. For example when upgrading from v5.0.0 to v5.0.3 of Chocolatey Licensed Extension, the process is:

  1. Ensure you have downloaded Chocolatey Licensed Extension v5.0.3: choco download chocolatey.extension --version 5.0.3.
  2. Convert the Chocolatey Licensed Extension Package: choco convert chocolatey.extension.5.0.3.nupkg --to=intune.
  3. Push the converted package to Intune: choco push chocolatey.extension.5.0.3.intunewin --to=intune.
  4. Deploy the upgrade to a group of test computers.

When you are ready for full deployment to the rest of your computers, you can update your existing packages.

Updating Existing Chocolatey Packages

When you are ready for full deployment to all computers, you need to update the Chocolatey Licensed Extension that your packages depend on. Below is an example of how to upgrade from Chocolatey Licensed Extension v5.0.0 to v5.0.3, but the process is the same whatever version you are using:

  1. Navigate to the Intune Windows apps pane and search for the package you want to update.
  2. Navigate to the Properties pane, scroll to Dependencies and click Edit.
  3. Select the three dots to the right of your Chocolatey Licensed Extension package (Chocolatey Licensed Extension (v5.0.0)) and select Remove.
  4. Click + Add.
  5. Find and Select the new Chocolatey Licensed Extension package (Chocolatey Licensed Extension (v5.0.3)).
  6. Click Review + save twice followed by Save.

Major Versions

Chocolatey Products

Due to the related dependencies and how they are typically specific across major versions of Chocolatey products, a specific upgrade process must be followed. For example, when upgrading from v1.x to a v2.x version of a Chocolatey product, the process is:

  1. Ensure you are on the latest stable versions of the Chocolatey products for your current major version. For v1.x of Chocolatey CLI, this will be v1.4.0 of Chocolatey CLI, v5.0.3 of Chocolatey Licensed Extension, v1.1.3 version of Chocolatey GUI, v1.0.3 of Chocolatey GUI Licensed Extension, and v1.1.2 of Chocolatey Agent.
  2. Verify what your “Chocolatey License” package version is in Intune (It will be in the format of Year.Month.Day.NodeCount with leading zeroes. For example a 100 node count license expiring June 15 2024 will be version 2024.06.15.100).
  3. Ensure you have downloaded all of the Chocolatey products to your working directory.
  • If you are using an Architect license, run choco download chocolatey chocolatey.extension chocolateygui --ignore-dependencies
  • If you are using a Business license, run choco download chocolatey chocolatey.extension chocolateygui chocolateygui.extension chocolatey-agent --ignore-dependencies
  1. Convert Chocolatey CLI: choco convert chocolatey.<version>.nupkg --to=intune (This will create an all encompassing intunewin file that contains all Chocolatey products. See the FAQ for further information.).
  2. Convert Chocolatey Licensed Extension: choco convert chocolatey.extension.<version>.nupkg --to=intune.
  3. Push Chocolatey CLI to Intune: choco push chocolatey.<version>.intunewin.
  4. Push Chocolatey Licensed Extension to Intune: choco push chocolatey.extension.<version>.intunewin.
  5. If your Chocolatey License package version contains a leading 0 see the next section.
  6. You can now deploy any other Chocolatey package.

Chocolatey License Considerations

NOTE

If your license expires on a date with a single digit day or month (for example: July 31, 2024 (2024-7-31) or October 5, 2023 (2023-10-5)), care must be taken when upgrading Chocolatey CLI due to version number normalization in version 2.x.

If your Chocolatey License package version contains a leading 0; follow the preceding steps for updating Chocolatey Products, then:

  1. Navigate to the Intune Windows apps pane and search for Chocolatey Licensed Extension.
  2. For each entry here navigate to the Properties pane, scroll to Dependencies and click Edit.
  3. Select the three dots to the right of your License Package (“Chocolatey License (v2024.6.15.100)” in above example) and select Remove.
  4. Click + Add.
  5. Find and Select the license with the leading zeroes (“Chocolatey License (v2024.06.15.100)” in above example).
  6. Click Review + save twice followed by Save.