How To Manage Your Windows Apps With Winget

Software category image

Introduction

Here is an example of how to manage your Windows apps with winget (Windows Package Manager and how to use customized build scripts.

The Windows Package Manager contains a command-line interface (winget) and a public app repository to manage apps on your system. It allows installation, update, and deletion of items in your software catalog. A similar and maybe better-known system is chocolatey. So here is how to manage your Windows apps with winget.

Many apps don’t provide automatic update features but with winget, you can still get the most recent versions of any apps on your system automatically. Even after a clean install of the operating system, it can help you install your most needed applications to start with. This is also very handy if you are regularly setting up virtual machines.

Install winget

The app should already be installed on your system if you have a recent version of Windows 10 or 11. To verify, open any command-line tool (like cmd or Powershell) and execute the command winget -v.

Version information of winget
Version information of winget

If you see an error message that the command is unknown, follow these installation steps to get the app.

  1. Open Microsoft Store
  2. Look for App-Installer
  3. Update the app

winget is distributed via the AppInstaller app and should now be part of your local system. Verify by executing the command above once more.

Entry of App-Installer in the Windows settings menu Apps and features
Entry of App-Installer in the Windows settings menu Apps and features

If you still have problems with winget, check out the Microsoft documentation about the installation process.

Show your local apps

Use the command winget list to show all installed apps on your system.

List the first 10 installed apps
List the first 10 installed apps

For some apps, winget can’t extract the version because they might not be part of the repository. Sometimes winget also fails to match apps that were installed from another source than winget. This will improve in the future. Every entry denoted with winget as source can be managed without problems.

Find apps

Use the command winget search to show all apps from the repository that match the search query.

Look for VSCode in the winget repository
Look for VSCode in the winget repository

winget tells you the reason for every hit. It uses tags, monikers, and the package name to find a match. Use the help (winget search --help) to see more options for result filtering.

Install apps

Use the command winget install xxx to install the most recent version of an app.

Start installation of VSCode
Start installation of VSCode

Update apps

Use the command winget upgrade xxx to upgrade an installed app to the most recent version. If there isn’t any more recent version, the process stopps.

Start upgrade of Visual Studio 2022
Start upgrade of Visual Studio 2022

Build automation scripts

Now we start with the good parts. As you saw, it is simple to manage apps with winget. But it is cumbersome to always enter all commands for an app upgrade. That’s why I want to show you how to create scripts for automation.

To get started, I recommend you have a look at winstall. It’s a web service where you can create scripts with a nice user interface and download the result. See the example image below.

Generate custom scripts with winstall
Generate custom scripts with winstall

This script will install Spotify, NodeJS, and EarTrumped in the most recent versions on your system. In the next image, there is an example of a customized PowerShell script that I use to update my developer tools.

To complete the automation process, we need to run this script regularly. Therefore you can use tools like the Windows Task Scheduler. Also, have a look at the -h or --silent switch of the winget install and winget upgrade command. It will request a silent installation without user interaction if available.

Conclusion

In this article, you learned how to manage your Windows apps with winget. App management can be simplified by a lot with the Windows Package Manager. Use it to set up an empty system or automate your software updates with it. Automation fans love this tool!


Want More Flutter Content?

Join my bi-weekly newsletter that delivers small Flutter portions right in your inbox. A title, an abstract, a link, and you decide if you want to dive in!

Become A Firebase Expert!

Take a deep dive into Firebase and learn how to really handle their services. This ebook makes you an instant Firebase professional!

Flutter โค๏ธ Firebase

Get started with Firebase and learn how to use it in your Flutter apps. My detailed ebook delivers you everything you need to know! Flutter and Firebase are a perfect match!