Updating Winget to Resolve the Latest CDN Issue with Pckgr
Recent changes to the Winget CDN rendered older versions of Winget unable to update their source and read the manifests from the CDN. The best solution is to update to the latest version of Winget, which at the time of writing this is version 1.6.2771.
This upgrade has impacted on the installations for some of our customers, causing application installs and updates to fail. With that in mind, we have created a package that efficiently checks the version of Winget installed on your system. If an outdated version is detected, the package will automatically initiate the installation of the latest version.
Let’s break it down a little bit:
Detection Script
This script begins by detecting if Winget is installed on the device. If installed, it determines the installed version to check if an update is required.
Here’s a brief breakdown of the detection script:
- The script identifies the paths to all winget.exe executables (We have found cases where some devices still have multiple installations of Winget installed)
- It then creates a dictionary to store the version numbers.
- The latest version number is extracted and compared.
- If the version is 1.6 or newer, the script outputs ‘Installed’.
- Otherwise, it prompts for an installation.
Installation Script
The installation script fetches the latest Winget version from the official GitHub repository. It determines the latest release and associated license file, then installs the package on the system. Post-installation, the path variable is updated to include the location of the new Winget executable.
Here’s a brief breakdown of the installation script:
- The script defines a function to fetch the latest official release link from GitHub.
- It retrieves URLs for both the msixbundle (the installation package) and the License1.xml (the license file).
- The script then downloads and installs the latest version of Winget.
- Finally, it cleans up any temporary files.
What is the difference between Winget Pre-Install and the Winget package?
The Winget Pre-Install is applied as a dependency to all our packages. It was originally built for earlier Windows 10 builds that may have been missing Winget, it runs a detection to see if Winget is missing or corrupt and then will install all the dependencies and the Winget CLI from scratch. The new Winget package only installs the Winget CLI if it’s detected as outdated. This can be applied only to devices that require an update or deployed to the entire fleet to keep updated.
Conclusion
We recommend deploying this to your workstations to ensure that Winget has been updated to the latest version. Pckgr will continue to scan for new versions from Winget and update the package as needed. Please note that the Winget package is different from the Winget Pre-Install and it is used to completely install Winget and all dependencies if missing from the device or unable to run successfully.

Leave a comment