Introduction
The Windows Package Manager COM API provides programmatic access to WinGet functionality through two primary namespaces:- Microsoft.Management.Deployment - Package installation, uninstallation, and catalog management
- Microsoft.Management.Configuration - Configuration set processing and system state management
Key Features
Package Management
- Install, Upgrade, Uninstall - Manage packages programmatically
- Search and Discovery - Find packages across multiple catalogs
- Catalog Management - Add, remove, and configure package sources
- Progress Tracking - Monitor installation progress with detailed callbacks
- Authentication - Support for Microsoft Entra ID authentication
Configuration Management
- Declarative Configuration - Define system state using YAML configuration sets
- Test, Get, Set Operations - Test current state, retrieve settings, and apply configurations
- Dependency Management - Handle configuration unit dependencies
- Progress Events - Track configuration application progress
- Conflict Detection - Identify conflicts between configuration sets
Architecture
Microsoft.Management.Deployment
Microsoft.Management.Configuration
Common Use Cases
Package Installation
Configuration Application
Language Support
C#
Use with .NET applications by adding the Windows SDK projection:C++
Use with C++/WinRT:Error Handling
All COM API operations return result objects with:- Status Enums - High-level operation status
- HRESULT Codes - Detailed error codes
- Extended Information - Result descriptions and details
Next Steps
Getting Started
Set up your development environment and create your first application
PackageManager
Learn about package installation and management
Configuration
Work with configuration sets and system state
Events & Progress
Track progress and handle events
API Contract Versions
- Microsoft.Management.Deployment: Contract version 29 (WinGet 1.29+)
- Microsoft.Management.Configuration: Contract version 4