Skip to the content.

How to submit a winget package to the package repository

Index

Introduction

When using Windows client systems, installing applications and keeping them up-to-date used to be quite a hassle in the old days. In the past, I used to rely on Chocolatey to keep all my applications up-to-date. Nowadays, I prefer to use the built-in winget tool to install and update packages on Windows client devices.

However, sometimes you can run into one of these scenarios:

Not all application publishers, including Microsoft, update the Winget package when a new version of their application is released. A lot of winget packages are being submitted by the community. Other times, it just takes quite a while for a package to get updated, and personally I don’t like waiting. Thankfully, everybody can submit a winget package.

Apart from doing yourself a favour, you will actively contributing to the community, helping other users of the application that use winget for package management. And it’s a great learning experience, covering loads of different technology and tooling.

This article will show you how to update an existing winget package. In this example, I have used the Bicep cli as an example, as this is a package I frequently submit.

Background: The winget package repository

The winget package repository is stored on Github and can be found here: winget-pkgs The actual software is not stored in this repository, but only manifest files that point to the actual installation package on a different location. This can be another GitHub repository, or the publisher’s website for example.

All winget packages are stored in the manifests folder sorted on package/publisher’s name, for example:

Prerequisites

Steps

Preparation and validation

For the Bicep Cli, I have subscribed to the repository’s releases using the watch option - custom and selecting only releases

The instructions below are based on the release of Bicep v0.27.1

IMPORTANT: Make sure you copy the bicep-setup-win-64.exe and not the bicep-win64.exe

Create the winget manifest files for the installer package

Modify the manifest files and store them in a new branch of your forked repository

Validate the manifest files

Test the manifest with Windows Sandbox

> .\SandboxTest.ps1 ..\manifests\m\Microsoft\Bicep\0.27.1\                                 
--> Validating Manifest
Manifest validation succeeded.

--> Checking dependencies
--> Starting Windows Sandbox, and:
    - Mounting the following directories:
      - C:\Users\MarcoJanse\AppData\Local\Temp\SandboxTest as read-only
      - C:\git\GitHub\MarcoJanse\winget-pkgs\Tools as read-and-write
    - Installing WinGet
    - Configuring Winget
    - Installing the Manifest 0.27.1
    - Refreshing environment variables
    - Comparing ARP Entries

Below is a screenshot of the sandbox and it’s output if everything works.

Windows Sandbox Winget installation of Microsoft.Bicep

Commit an push your changes

Create a pull request to the microsoft/winget-pkgs repository

You can find my original pull request for this here: feat: microsoft-bicep-v0.27.1 #153499 | winget-pkgs repo on Github.com

After successful merging of your pull request

After the pull request has been approved and merged into main

Closing notes

I hope you liked this post and learned a some things about winget, git, VSCode, Windows Sandbox and you enjoyed contributing to the community. You might do lots of people a favour if you contribute often.

References