Overview of Windows Package Manager
masterwinget) and a set of services designed to automate the discovery, installation, upgrading, removal, and configuration of software.repository·master·Indexed 12 days ago
https://github.com/microsoft/winget-cliA command-line tool for discovering, installing, and managing software packages on Windows via the Microsoft Store and community repositories. Includes documentation on installation, troubleshooting, the Microsoft.WinGet.Client PowerShell module, COM APIs for C++ and C#, and package manifest JSON schemas.
winget) and a set of services designed to automate the discovery, installation, upgrading, removal, and configuration of software.The source command manages the repositories (sources) that WinGet uses to discover and install applications. You can use it to add, remove, list, and update sources.
Note: The source command is currently intended for internal use only. Additional sources are not supported at this time.
Warning: Only add a new source if you trust it as a secure location.
winget source [<command>] [<options>]When submitting a "Product" (apps, games, titles, or additional content) to the Windows Package Manager repository via a Pull Request, your submission must adhere to specific Product Policies.
Key principles for submissions include:
If you have feedback regarding these policies, you can submit it via the GitHub issues forum.
The Microsoft.Management.Configuration API allows developers to programmatically manage configuration sets, check for conflicts, and apply configurations with progress monitoring.
Key workflows include:
ConfigurationProcessor.OpenConfigurationSet to load a configuration from a file.ConfigurationProcessor.CheckForConflicts to identify overlapping or contradictory settings between multiple configuration sets.ConfigurationProcessor.ApplySetAsync to apply a configuration set asynchronously. This method supports progress reporting via the Progress property on the returned operation.ConfigurationProcessor.ConfigurationChange to watch for additions, state changes, or removals of configuration sets, and ConfigurationSet.ConfigurationSetChange to watch for changes within a specific set.using Microsoft.Management.Configuration;
// Example workflow: Load, Check Conflicts, and Apply
ConfigurationProcessor processor = new ConfigurationProcessor(factory);
ConfigurationSet configSet = processor.OpenConfigurationSet(file);
// Check for conflicts
var conflicts = processor.CheckForConflicts(new List<ConfigurationSet> { configSet }, true);
// Apply with progress
var operation = processor.ApplySetAsync(configSet, ApplyConfigurationSetFlags.None);
operation.Progress = (data) => { /* Handle progress */ };
await operation.AsTask();Undocked RegFree WinRT allows non-packaged desktop applications to leverage user-defined Windows Runtime (WinRT) types using application manifests. This is particularly useful for supporting older OS versions (down to Windows 8.1), as Windows 10 19h1 and later support this feature natively.
The package uses the Detours library to detour RoActivateInstance, RoGetActivationFactory, RoGetMetadataFile, and RoResolveNamespace to reimplement the RegFree WinRT feature.
Setup:
winrtact.dll into your build folder alongside your executable.ForceSymbolReferences.Microsoft.Windows.UndockedRegFreeWinrt.Initialize(); to initialize the detours and load the catalog.// For Managed code initialization
Microsoft.Windows.UndockedRegFreeWinrt.Initialize();The Windows Package Manager Configuration PowerShell Module allows you to manage WinGet configurations via PowerShell. It consists of two main components: Microsoft.WinGet.Configuration.Cmdlets (the cmdlet implementations) and Microsoft.WinGet.Configuration.Engine (the core logic).
Get-WinGetConfiguration: Retrieves configuration from a file.Get-WinGetConfigurationDetails: Retrieves details for a specific configuration set.Invoke-WinGetConfiguration: Executes a configuration.Start-WinGetConfiguration: Starts a configuration process.Complete-WinGetConfiguration: Completes a configuration job.Telemetry is enabled by default. To disable it, set the POWERSHELL_TELEMETRY_OPTOUT environment variable to 1, yes, or true.
The src/VcpkgPortOverlay directory contains custom vcpkg ports used by the project. These ports are mostly derived from the official vcpkg registry but include small, necessary modifications such as:
sfs-client).The winget list command provides a tabular view of installed packages. Enhanced functionality includes:
-s <source> reduces the list to only packages available from that specific source.-u or --unavailable displays apps installed in Add/Remove Programs that do not match any configured WinGet source.When WinGet encounters a package with a ZIP installer type, it follows this execution flow:
NestedInstallerFile must reside at the top level of the ZIP.NestedInstallerType (e.g., running an .exe or .msi found inside the extracted folder).For portable applications bundled in an archive, WinGet maintains a metadata table of all created files (paths, flags, hashes, and symlink targets) to enable proper uninstallation and verification, rather than relying solely on standard ARP entries.
When submitting a Product to the Windows Package Manager repository, all content and metadata must adhere to strict safety and appropriateness standards. This includes the Product name, publisher name, icons, descriptions, screenshots, trailers, and any content delivered from a server that the Product connects to.
Products must not contain content that:
When using the C API:
pure_zip(): Returns 0 if the ZIP file is clean. Returns a non-zero error code if anomalies are detected.pure_zip_bomb(): Returns 1 if the error code indicates a ZIP bomb, otherwise returns 0.pure_error_code(): Returns the constant name (e.g., PURE_E_ZIP_BOMB_FIFIELD) of the error code.pure_error_string(): Returns the human-readable error message string for the given error code.The Microsoft.Management.Configuration API enables 'Developer+' configuration scenarios by allowing interaction with configuration sets.
Every configuration unit performs three primary actions:
The API supports multiple processes watching for state changes. You can subscribe to the ConfigurationSet.ConfigurationSetChange event to monitor changes to both the configuration set lifetime and the individual configuration unit states.