April 4, 2025

How to Test Winget Packages Locally (Step-by-Step Guide)

Testing Windows Package Manager (winget) packages locally is a crucial step before submitting them to the official winget repository. This ensures your package manifests function correctly, reducing issues for end-users. This guide walks you through enabling local manifest testing, installing packages from your local filesystem, and understanding the underlying processes involved.

Step 1: Clone the Winget Repository Locally

To get started, clone the official winget package repository to your local drive. For example:

git clone https://github.com/microsoft/winget-pkgs T:\winget-pkgs

Replace T:\winget-pkgs with your preferred local path.

Step 2: Enable Local Manifest Testing

By default, winget only installs packages from the official repository. To enable installation from local manifests, run the following command from an elevated (Administrator) PowerShell or Command Prompt:

winget settings --enable LocalManifestFiles

This configuration allows winget to recognize and use local manifest files.

Step 3: Install a Package from Local Manifests

After enabling the feature, you can install packages directly from your local system. Here's how to install the Zoom VDI Universal Plugin from a local manifest:

winget install --manifest T:\winget-pkgs\manifests\z\Zoom\ZoomVDIUniversalPlugin\6.3.10.25910\

Modify the path to match your local manifest location.

What Winget Does During Installation

When running the install command, winget processes several YAML manifest files within the specified directory:

  • Zoom.ZoomVDIUniversalPlugin.yaml - Defines the package and its specific version.
  • Zoom.ZoomVDIUniversalPlugin.installer.yaml - Specifies installation details like download URLs, hashes, and architecture requirements (x64 or arm64).
  • Zoom.ZoomVDIUniversalPlugin.locale.en-US.yaml - Contains localization details for English (US).
  • Zoom.ZoomVDIUniversalPlugin.locale.zh-CN.yaml - Includes localization details for Chinese (Simplified).

Winget uses the installer manifest to download the correct installer for your system, verifies the file integrity using the provided hash, and executes the MSI installer using predefined installation parameters.

Why Local Testing is Essential

Testing winget packages locally provides numerous benefits:

  • Installer Verification: Confirm your package installer works correctly before submission.
  • Immediate Feedback: Quickly identify and resolve manifest issues without waiting for pull requests to be approved.
  • Dependency Checks: Detect dependency issues early, such as missing prerequisites like Microsoft.VCRedist.2015+, required by certain applications.

Conclusion

Testing packages locally with winget is straightforward yet invaluable. It helps ensure your manifests are error-free and your package submissions to the official repository will function properly for all users. Whether you're a package maintainer or simply exploring packages before their official release, leveraging winget’s local manifest feature simplifies this essential step.

Optimize your workflow by regularly incorporating local testing into your package management process, ensuring a smoother experience for yourself and end-users alike.

Author:
Discover how we can help you >

Related Posts