how to create a winget package

Created on: June 17, 2025

Answered using GPT-4.5 by Chat01

Question

how to create a winget package

Answer

Creating a Winget package involves packaging your software in a structured YAML manifest file that Winget can read and install. Here's a step-by-step guide:

1. Prepare the Application

  • Ensure your software installer is publicly hosted, accessible via a direct URL.
  • Ideally, installers should be an MSI, EXE, MSIX, or ZIP file.

2. Set Up Winget Tools

  • Install Winget CLI: Ensure you have Winget installed (it typically comes with newer Windows 10/11 versions).
    powershell
    winget --version
  • Install wingetcreate:
    powershell
    winget install wingetcreate

3. Generate Manifest

  • Use wingetcreate to generate your package manifest interactively:
    powershell
    wingetcreate new <URL_of_installer>
  • Follow prompts to input metadata such as:
    • Package Identifier (e.g., PublisherName.AppName)
    • Package Name and Version
    • Installer Type (MSI, EXE, etc.)
    • Installer Switches for silent installs (/silent, /quiet, /S vary by installer)

4. Edit the Generated Manifest (Optional)

The command above generates YAML files (Installer.yaml, Locale.yaml, Version.yaml). Review and modify details as needed:

Example YAML snippet:

yaml
PackageIdentifier: YourCompany.YourApp PackageVersion: 1.0.0 Installers: - Architecture: x64 InstallerType: msi InstallerUrl: https://yourdomain.com/installer.msi InstallerSha256: <calculated_sha256_hash> ManifestType: installer ManifestVersion: 1.5.0

5. Validate the Manifest

Validate your manifest using:

powershell
winget validate <path_to_manifest_files>

6. Submit Your Package

  • Fork the official Winget repository:
    https://github.com/microsoft/winget-pkgs
  • Submit a Pull Request (PR) by adding your manifest files into the correct directory structure (manifests/<publisher>/<application>/<version>).

7. Review and Merge

  • Microsoft will automatically run validation checks.
  • Community maintainers review your PR.
  • After approval, your package becomes publicly installable via:
    powershell
    winget install YourCompany.YourApp

Helpful Commands

  • Test installing locally before submission:
powershell
winget install -m <path_to_manifest_files>

Best Practices

  • Clearly document silent install switches.
  • Use descriptive and precise package identifiers.
  • Regularly update your manifests with new releases.

By following these steps, you’ll effectively create and distribute a Winget package.

Share this Q&A