Is Winget worth paying attention to?
I recently played with Winget — an open-sourced package manager developed by Microsoft for Windows 10 and 11. It drew attention during the Build conference, so it was worth a try.
Essentially Winget is a set of command-line instructions for managing programs. For example, winget list
displays a list of installed software and information about current and latest versions (see the image below).
It’s worth noting the Source column — if the word winget is there, then the program can be updated using the winget upgrade
command. The image above shows I can upgrade Visual Studio 2022, Build Tools 2019 (highlighted in green), and Docker Desktop to the latest available versions.
The program cannot be updated if the winget keyword is absent in the Source column. That is why I can’t upgrade a DownloadMaster application (highlighted in yellow). However, the list of supported programs expands daily.
My key interest was whether Winget could help me set up my working environment on a new machine. I belong to people who postpone reinstalling Windows until the last moment because “there’s a lot installed,” and starting from scratch is too time-consuming. So I started experimenting with the winget export
and winget import
commands.
The export command output is a JSON file with a list of software and their versions. See an example below.
winget export -o c://winget-config.json [--include-versions]
{
"$schema" : "https://aka.ms/winget-packages.schema.2.0.json",
"CreationDate" : "2023-07-02T09:50:28.062-00:00",
"Sources" :
[
{
"Packages" :
[
{
"PackageIdentifier" : "Docker.DockerDesktop",
"Version" : "4.3.1"
},
{
"PackageIdentifier" : "Python.Python.3.10",
"Version" : "3.10.0"
},
{
"PackageIdentifier" : "OpenJS.NodeJS.LTS",
"Version" : "16.13.0"
}
],
...
}
Assuming you have the file, the next step is to install all the exported software on a new machine with a single command. All you need is to run the import command, kick back, and relax:
winget import c://winget-config.json [--ignore-versions]
After some time, your working environment will be ready to go.
Let me explain how the --ignore-versions
parameter works. If specified, Winget will ignore the versions specified in the JSON file and install the latest instead. During my experiment, I realized that this is not convenient: for some programs, the version doesn’t really matter (Zoom, Slack, Skype, Chrome, etc.), while for others, it does (e.g., Node.js or Python). I overcome this by editing the JSON file. In the image below, you can see that I removed the Version field for Zoom but left the property for Node.js.
To summarize, I found the tool convenient enough for personal purposes. However, I also tried Winget to automate developer onboarding at my work. Instead of maintaining documentation listing all the software and links, we need to keep a simple JSON file in the source control (my personal GitHub example)! It also helps to keep track of software versions in the team and avoid compatibility issues, thus saving valuable time.
Package managers are not a revolution — they have existed for over a decade (e.g., Chocolatey). Nevertheless, Winget has proven to be a very convenient tool for Windows that was missing for a long time.