PackageManager.idl (72876B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 namespace Microsoft.Management.Deployment 4 { 5 [contractversion(13)] // For version 1.12 6 apicontract WindowsPackageManagerContract{}; 7 8 /// State of the install 9 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 10 enum PackageInstallProgressState 11 { 12 /// The install is queued but not yet active. Cancellation of the IAsyncOperationWithProgress in this 13 /// state will prevent the package from downloading or installing. 14 Queued, 15 /// The installer is downloading. Cancellation of the IAsyncOperationWithProgress in this state will 16 /// end the download and prevent the package from installing. 17 Downloading, 18 /// The install is in progress. Cancellation of the IAsyncOperationWithProgress in this state will not 19 /// stop the installation or the post install cleanup. 20 Installing, 21 /// The installer has completed and cleanup actions are in progress. Cancellation of the 22 /// IAsyncOperationWithProgress in this state will not stop cleanup or roll back the install. 23 PostInstall, 24 /// The operation has completed. 25 Finished, 26 }; 27 28 /// Progress object for the install 29 /// DESIGN NOTE: percentage for the install as a whole is purposefully not included as there is no way to 30 /// estimate progress when the installer is running. 31 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 32 struct InstallProgress 33 { 34 /// State of the install 35 PackageInstallProgressState State; 36 /// DESIGN NOTE: BytesDownloaded may only be available for downloads done by Windows Package Manager itself. 37 /// Number of bytes downloaded if known 38 UInt64 BytesDownloaded; 39 /// DESIGN NOTE: BytesRequired may only be available for downloads done by Windows Package Manager itself. 40 /// Number of bytes required if known 41 UInt64 BytesRequired; 42 /// Download percentage completed 43 Double DownloadProgress; 44 /// Install percentage if known. 45 Double InstallationProgress; 46 }; 47 48 /// Status of the Install call 49 /// Implementation Note: Errors mapped from AppInstallerErrors.h 50 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 51 enum InstallResultStatus 52 { 53 Ok, 54 BlockedByPolicy, 55 CatalogError, 56 InternalError, 57 InvalidOptions, 58 DownloadError, 59 InstallError, 60 ManifestError, 61 NoApplicableInstallers, 62 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)] 63 { 64 NoApplicableUpgrade, 65 }, 66 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 67 { 68 PackageAgreementsNotAccepted, 69 } 70 }; 71 72 /// Result of the install 73 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 74 runtimeclass InstallResult 75 { 76 /// Used by a caller to correlate the install with a caller's data. 77 String CorrelationData { get; }; 78 /// Whether a restart is required to complete the install. 79 Boolean RebootRequired { get; }; 80 81 /// Batched error code, example APPINSTALLER_CLI_ERROR_SHELLEXEC_INSTALL_FAILED 82 InstallResultStatus Status { get; }; 83 /// The error code of the overall operation. 84 HRESULT ExtendedErrorCode { get; }; 85 86 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)] 87 { 88 /// The error code from the install attempt. Only valid if the Status is InstallError. 89 /// This value's meaning will require knowledge of the specific installer or install technology. 90 UInt32 InstallerErrorCode { get; }; 91 } 92 } 93 94 /// State of the uninstall 95 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)] 96 enum PackageUninstallProgressState 97 { 98 /// The uninstall is queued but not yet active. Cancellation of the IAsyncOperationWithProgress in this 99 /// state will prevent the package from uninstalling. 100 Queued, 101 /// The uninstall is in progress. Cancellation of the IAsyncOperationWithProgress in this state will not 102 /// stop the installation or the post uninstall steps. 103 Uninstalling, 104 /// The uninstaller has completed and cleanup actions are in progress. Cancellation of the 105 /// IAsyncOperationWithProgress in this state will not stop cleanup or roll back the uninstall. 106 PostUninstall, 107 /// The operation has completed. 108 Finished, 109 }; 110 111 /// Progress object for the uninstall 112 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)] 113 struct UninstallProgress 114 { 115 /// State of the uninstall 116 PackageUninstallProgressState State; 117 /// Uninstall percentage if known. 118 Double UninstallationProgress; 119 }; 120 121 /// Status of the uninstall call 122 /// Implementation Note: Errors mapped from AppInstallerErrors.h 123 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)] 124 enum UninstallResultStatus 125 { 126 Ok, 127 BlockedByPolicy, 128 CatalogError, 129 InternalError, 130 InvalidOptions, 131 UninstallError, 132 ManifestError, 133 }; 134 135 /// Result of the uninstall 136 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)] 137 runtimeclass UninstallResult 138 { 139 /// Used by a caller to correlate the install with a caller's data. 140 String CorrelationData { get; }; 141 /// Whether a restart is required to complete the install. 142 Boolean RebootRequired { get; }; 143 144 /// Batched error code, example APPINSTALLER_CLI_ERROR_SHELLEXEC_INSTALL_FAILED 145 UninstallResultStatus Status { get; }; 146 /// The error code of the overall operation. 147 HRESULT ExtendedErrorCode { get; }; 148 149 /// The error code from the uninstall attempt. Only valid if the Status is UninstallError. 150 /// This value's meaning will require knowledge of the specific uninstaller or install technology. 151 UInt32 UninstallerErrorCode { get; }; 152 } 153 154 /// State of the repair 155 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)] 156 enum PackageRepairProgressState 157 { 158 /// The repair is queued but not yet active. Cancellation of the IAsyncOperationWithProgress in this 159 /// state will prevent the package from repairing. 160 Queued, 161 /// The repair is in progress. Cancellation of the IAsyncOperationWithProgress in this state will not 162 /// stop the repair or the post repair steps. 163 Repairing, 164 /// The repair has completed and cleanup actions are in progress. Cancellation of the 165 /// IAsyncOperationWithProgress in this state will not stop cleanup or roll back the repair. 166 PostRepair, 167 /// The operation has completed. 168 Finished, 169 }; 170 171 /// Progress object for the repair 172 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)] 173 struct RepairProgress 174 { 175 /// State of the repair 176 PackageRepairProgressState State; 177 178 /// Repair percentage if known. 179 Double RepairCompletionProgress; 180 }; 181 182 /// Status of the repair call 183 /// Implementation Note: Errors mapped from AppInstallerErrors.h 184 /// DESIGN NOTE: RepairResultStatus from AppInstallerErrors.h is not implemented in V1. 185 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)] 186 enum RepairResultStatus 187 { 188 Ok, 189 BlockedByPolicy, 190 CatalogError, 191 DownloadError, 192 InternalError, 193 InvalidOptions, 194 RepairError, 195 ManifestError, 196 NoApplicableRepairer, 197 PackageAgreementsNotAccepted, 198 }; 199 200 /// Result of the repair 201 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)] 202 runtimeclass RepairResult 203 { 204 /// Used by a caller to correlate the repair with a caller's data. 205 String CorrelationData { get; }; 206 207 /// Whether a restart is required to complete the repair. 208 Boolean RebootRequired { get; }; 209 210 /// Batched error code, example APPINSTALLER_CLI_ERROR_SHELLEXEC_INSTALL_FAILED 211 RepairResultStatus Status { get; }; 212 213 /// The error code of the overall operation. 214 HRESULT ExtendedErrorCode { get; }; 215 216 /// The error code from the repair attempt. Only valid if the Status is RepairError. 217 /// This value's meaning will require knowledge of the specific repairer or repair technology. 218 UInt32 RepairerErrorCode { get; }; 219 } 220 221 /// State of the download 222 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 7)] 223 enum PackageDownloadProgressState 224 { 225 /// The download is queued but not yet active. Cancellation of the IAsyncOperationWithProgress in this 226 /// state will prevent the package from downloading. 227 Queued, 228 /// The installer is downloading. Cancellation of the IAsyncOperationWithProgress in this state will 229 /// end the download. 230 Downloading, 231 /// The operation has completed. 232 Finished, 233 }; 234 235 /// Status of the download call 236 /// Implementation Note: Errors mapped from AppInstallerErrors.h 237 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 7)] 238 enum DownloadResultStatus 239 { 240 Ok, 241 BlockedByPolicy, 242 CatalogError, 243 InternalError, 244 InvalidOptions, 245 DownloadError, 246 ManifestError, 247 NoApplicableInstallers, 248 PackageAgreementsNotAccepted, 249 }; 250 251 /// Result of the download 252 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 7)] 253 runtimeclass DownloadResult 254 { 255 /// Used by a caller to correlate the download with a caller's data. 256 String CorrelationData { get; }; 257 258 /// Batched error code. 259 DownloadResultStatus Status { get; }; 260 261 /// The error code of the overall operation. 262 HRESULT ExtendedErrorCode { get; }; 263 }; 264 265 /// Progress object for the uninstall 266 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 7)] 267 struct PackageDownloadProgress 268 { 269 /// State of the download 270 PackageDownloadProgressState State; 271 272 /// DESIGN NOTE: BytesDownloaded may only be available for downloads done by Windows Package Manager itself. 273 /// Number of bytes downloaded if known 274 UInt64 BytesDownloaded; 275 276 /// DESIGN NOTE: BytesRequired may only be available for downloads done by Windows Package Manager itself. 277 /// Number of bytes required if known 278 UInt64 BytesRequired; 279 280 /// Download percentage completed 281 Double DownloadProgress; 282 }; 283 284 /// IMPLEMENTATION NOTE: SourceOrigin from winget/RepositorySource.h 285 /// Defines the origin of the package catalog details. 286 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 287 enum PackageCatalogOrigin 288 { 289 /// Predefined means it came as part of the Windows Package Manager package and cannot be removed. 290 Predefined, 291 /// User means it was added by the user and could be removed. 292 User, 293 }; 294 295 /// IMPLEMENTATION NOTE: SourceTrustLevel from winget/RepositorySource.h 296 /// Defines the trust level of the package catalog. 297 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 298 enum PackageCatalogTrustLevel 299 { 300 None, 301 Trusted, 302 }; 303 304 /// IMPLEMENTATION NOTE: SourceDetails from winget/RepositorySource.h 305 /// Interface for retrieving information about an package catalog without acting on it. 306 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 307 runtimeclass PackageCatalogInfo 308 { 309 /// The package catalog's unique identifier. 310 /// SAMPLE VALUES: For OpenWindowsCatalog "Microsoft.Winget.Source_8wekyb3d8bbwe" 311 /// For contoso sample on msdn "contoso" 312 String Id { get; }; 313 /// The name of the package catalog. 314 /// SAMPLE VALUES: For OpenWindowsCatalog "winget". 315 /// For contoso sample on msdn "contoso" 316 String Name { get; }; 317 /// The type of the package catalog. 318 /// ALLOWED VALUES: "Microsoft.Rest", "Microsoft.PreIndexed.Package" 319 /// SAMPLE VALUES: For OpenWindowsCatalog "Microsoft.PreIndexed.Package". 320 /// For contoso sample on msdn "Microsoft.PreIndexed.Package" 321 String Type { get; }; 322 /// The argument used when adding the package catalog. 323 /// SAMPLE VALUES: For OpenWindowsCatalog "https://winget.azureedge.net/cache" 324 /// For contoso sample on msdn "https://pkgmgr-int.azureedge.net/cache" 325 String Argument { get; }; 326 /// The last time that this package catalog was updated. 327 Windows.Foundation.DateTime LastUpdateTime { get; }; 328 /// The origin of the package catalog. 329 PackageCatalogOrigin Origin { get; }; 330 /// The trust level of the package catalog 331 PackageCatalogTrustLevel TrustLevel { get; }; 332 333 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)] 334 { 335 /// Excludes a source from discovery unless specified. 336 Boolean Explicit{ get; }; 337 } 338 } 339 340 /// A metadata item of a package version. 341 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 342 enum PackageVersionMetadataField 343 { 344 /// The InstallerType of an installed package 345 InstallerType, 346 /// The Scope of an installed package 347 InstalledScope, 348 /// The system path where the package is installed 349 InstalledLocation, 350 /// The standard uninstall command; which may be interactive 351 StandardUninstallCommand, 352 /// An uninstall command that should be non-interactive 353 SilentUninstallCommand, 354 /// The publisher of the package 355 PublisherDisplayName, 356 }; 357 358 /// The result of a comparison. 359 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 2)] 360 enum CompareResult 361 { 362 /// The comparison did not result in a succesful ordering. 363 Unknown, 364 /// The object value is lesser than the given value. 365 Lesser, 366 /// The object value is equal to the given value. 367 Equal, 368 /// The object value is greater than the given value. 369 Greater, 370 }; 371 372 /// IMPLEMENTATION NOTE: IPackageVersion from winget/RepositorySearch.h 373 /// A single package version. 374 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 375 runtimeclass PackageVersionInfo 376 { 377 /// IMPLEMENTATION NOTE: PackageVersionMetadata fields from winget/RepositorySearch.h 378 /// Gets any metadata associated with this package version. 379 /// Primarily stores data on installed packages. 380 /// Metadata fields may have no value (e.g. packages that aren't installed will not have an InstalledLocation). 381 String GetMetadata(PackageVersionMetadataField metadataField); 382 /// IMPLEMENTATION NOTE: PackageVersionProperty fields from winget/RepositorySearch.h 383 String Id { get; }; 384 String DisplayName { get; }; 385 String Version { get; }; 386 String Channel { get; }; 387 /// DESIGN NOTE: RelativePath from winget/RepositorySearch.h is excluded as not needed. 388 /// String RelativePath; 389 390 /// IMPLEMENTATION NOTE: PackageVersionMultiProperty fields from winget/RepositorySearch.h 391 /// PackageFamilyName and ProductCode can have multiple values. 392 Windows.Foundation.Collections.IVectorView<String> PackageFamilyNames { get; }; 393 Windows.Foundation.Collections.IVectorView<String> ProductCodes { get; }; 394 395 /// Gets the package catalog where this package version is from. 396 PackageCatalog PackageCatalog { get; }; 397 398 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 2)] 399 { 400 /// Compares the given value against the package version of this object, with the result being 401 /// the enum value that represents where PackageVersionInfo::Version is ordered relative to the 402 /// versionString. "if (this.CompareToVersion(that) == Greater)" can be thought of as reading 403 /// the sentence "If this is compared to version that and is found to be greater". 404 /// IE if PackageVersionInfo::Version returns "2", then CompareToVersion("1") will return Greater. 405 /// Passing in an empty string will result in Unknown. 406 CompareResult CompareToVersion(String versionString); 407 } 408 409 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)] 410 { 411 /// Checks if this package version has at least one applicable installer. 412 Boolean HasApplicableInstaller(InstallOptions options); 413 414 /// Gets the publisher string for this package version, if one is available. 415 String Publisher { get; }; 416 } 417 418 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 419 { 420 /// Gets the package catalog metadata of this package version with the default localization based on user settings. 421 CatalogPackageMetadata GetCatalogPackageMetadata(); 422 423 /// Gets the package catalog metadata of this package version with the preferred locale. 424 CatalogPackageMetadata GetCatalogPackageMetadata(String preferredLocale); 425 426 /// Gets the applicable installer for this package version. 427 PackageInstallerInfo GetApplicableInstaller(InstallOptions options); 428 } 429 } 430 431 /// IMPLEMENTATION NOTE: PackageVersionKey from winget/RepositorySearch.h 432 /// A key to identify a package version within a package. 433 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 434 runtimeclass PackageVersionId 435 { 436 /// The package catalog id that this version came from. 437 String PackageCatalogId { get; }; 438 /// The version. 439 String Version { get; }; 440 /// The channel. 441 String Channel { get; }; 442 }; 443 444 /// The package installer type. 445 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 446 enum PackageInstallerType 447 { 448 /// Unknown type. 449 Unknown, 450 /// Inno type. 451 Inno, 452 /// Wix type. 453 Wix, 454 /// Msi type. 455 Msi, 456 /// Nullsoft type. 457 Nullsoft, 458 /// Zip type. 459 Zip, 460 /// Msix or Appx type. 461 Msix, 462 /// Exe type. 463 Exe, 464 /// Burn type. 465 Burn, 466 /// MSStore type. 467 MSStore, 468 /// Portable type. 469 Portable, 470 }; 471 472 /// The package installer scope. 473 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 474 enum PackageInstallerScope 475 { 476 /// Scope not declared. 477 Unknown, 478 /// User scope. 479 User, 480 /// System scope. 481 System, 482 }; 483 484 /// The package installer elevation requirement. 485 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 486 enum ElevationRequirement 487 { 488 /// Elevation requirement not declared. 489 Unknown, 490 /// Package installer requires elevation. 491 ElevationRequired, 492 /// Package installer prohibits elevation. 493 ElevationProhibited, 494 /// Package installer elevates self. 495 ElevatesSelf, 496 }; 497 498 /// Interface for retrieving information about a package installer. 499 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 500 runtimeclass PackageInstallerInfo 501 { 502 /// The package installer type. 503 PackageInstallerType InstallerType { get; }; 504 /// The nested package installer type for archives. 505 PackageInstallerType NestedInstallerType { get; }; 506 /// The package installer architecture. 507 Windows.System.ProcessorArchitecture Architecture { get; }; 508 /// The package installer scope. 509 PackageInstallerScope Scope { get; }; 510 /// The package installer locale. 511 String Locale { get; }; 512 513 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 514 { 515 /// The package installer elevation requirement. 516 ElevationRequirement ElevationRequirement { get; }; 517 } 518 519 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 520 { 521 /// Authentication info from the package installer. 522 AuthenticationInfo AuthenticationInfo { get; }; 523 } 524 }; 525 526 /// The installed status type. The values need to match InstalledStatusType from winget/RepositorySearch.h. 527 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 528 [flags] 529 enum InstalledStatusType 530 { 531 /// None is checked. 532 None = 0x0, 533 /// Check Apps and Features entry. 534 AppsAndFeaturesEntry = 0x0001, 535 /// Check Apps and Features entry install location if applicable. 536 AppsAndFeaturesEntryInstallLocation = 0x0002, 537 /// Check Apps and Features entry install location with installed files if applicable. 538 AppsAndFeaturesEntryInstallLocationFile = 0x0004, 539 /// Check default install location if applicable. 540 DefaultInstallLocation = 0x0008, 541 /// Check default install location with installed files if applicable. 542 DefaultInstallLocationFile = 0x0010, 543 544 /// Below are helper values for calling CheckInstalledStatus as input. 545 /// AppsAndFeaturesEntry related checks 546 AllAppsAndFeaturesEntryChecks = AppsAndFeaturesEntry | AppsAndFeaturesEntryInstallLocation | AppsAndFeaturesEntryInstallLocationFile, 547 /// DefaultInstallLocation related checks 548 AllDefaultInstallLocationChecks = DefaultInstallLocation | DefaultInstallLocationFile, 549 /// All checks 550 AllChecks = AllAppsAndFeaturesEntryChecks | AllDefaultInstallLocationChecks, 551 }; 552 553 /// Interface representing an individual installed status. 554 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 555 runtimeclass InstalledStatus 556 { 557 /// The installed status type. 558 InstalledStatusType Type { get; }; 559 /// The installed status path. 560 String Path { get; }; 561 /// The installed status result. 562 HRESULT Status { get; }; 563 }; 564 565 /// Interface for retrieving information about a package installer installed status. 566 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 567 runtimeclass PackageInstallerInstalledStatus 568 { 569 /// The package installer info. 570 PackageInstallerInfo InstallerInfo { get; }; 571 /// A list of various types of installed status of the package installer. 572 Windows.Foundation.Collections.IVectorView<InstalledStatus> InstallerInstalledStatus { get; }; 573 }; 574 575 /// Status of the check installed status call. 576 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 577 enum CheckInstalledStatusResultStatus 578 { 579 Ok, 580 InternalError, 581 }; 582 583 /// Interface for retrieving information about a package installer installed status. 584 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 585 runtimeclass CheckInstalledStatusResult 586 { 587 /// Status of the check installed status call. 588 CheckInstalledStatusResultStatus Status { get; }; 589 590 /// A list of package installer installed status. 591 Windows.Foundation.Collections.IVectorView<PackageInstallerInstalledStatus> PackageInstalledStatus { get; }; 592 }; 593 594 /// IMPLEMENTATION NOTE: IPackage from winget/RepositorySearch.h 595 /// A package, potentially containing information about it's local state and the available versions. 596 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 597 runtimeclass CatalogPackage 598 { 599 /// IMPLEMENTATION NOTE: PackageProperty fields from winget/RepositorySearch.h 600 /// Gets a property of this package. 601 String Id { get; }; 602 String Name { get; }; 603 604 /// Gets the installed package information if the package is installed. 605 PackageVersionInfo InstalledVersion { get; }; 606 607 /// Gets all available versions of this package. Ordering is not guaranteed. 608 Windows.Foundation.Collections.IVectorView<PackageVersionId> AvailableVersions { get; }; 609 610 /// Gets the version of this package that will be installed if version is not set in InstallOptions. 611 PackageVersionInfo DefaultInstallVersion { get; }; 612 613 /// Gets a specific version of this package. 614 PackageVersionInfo GetPackageVersionInfo(PackageVersionId versionKey); 615 616 /// Gets a value indicating whether an available version is newer than the installed version. 617 Boolean IsUpdateAvailable { get; }; 618 619 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 620 { 621 /// Check the installed status of the package. For more accurate and complete installed status, it's required to 622 /// call this method from a composite package from a newly created package catalog with installed info. 623 /// This may require downloading information from a server. 624 Windows.Foundation.IAsyncOperation<CheckInstalledStatusResult> CheckInstalledStatusAsync(InstalledStatusType checkTypes); 625 CheckInstalledStatusResult CheckInstalledStatus(InstalledStatusType checkTypes); 626 Windows.Foundation.IAsyncOperation<CheckInstalledStatusResult> CheckInstalledStatusAsync(); 627 CheckInstalledStatusResult CheckInstalledStatus(); 628 } 629 630 /// DESIGN NOTE: 631 /// IsSame from IPackage in winget/RepositorySearch is not implemented in V1. 632 /// Determines if the given IPackage refers to the same package as this one. 633 /// virtual bool IsSame(const IPackage*) const = 0; 634 } 635 636 /// IMPLEMENTATION NOTE: CompositeSearchBehavior from winget/RepositorySource.h 637 /// Search behavior for composite catalogs. 638 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 639 enum CompositeSearchBehavior 640 { 641 /// Search local catalogs only 642 LocalCatalogs, 643 /// Search remote catalogs only, don't check local catalogs for InstalledVersion 644 RemotePackagesFromRemoteCatalogs, 645 /// Search remote catalogs, and check local catalogs for InstalledVersion 646 RemotePackagesFromAllCatalogs, 647 /// Search both local and remote catalogs. 648 AllCatalogs, 649 }; 650 651 /// IMPLEMENTATION NOTE: PackageFieldMatchOption from winget/RepositorySearch.h 652 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 653 enum PackageFieldMatchOption 654 { 655 Equals, 656 EqualsCaseInsensitive, 657 StartsWithCaseInsensitive, 658 ContainsCaseInsensitive, 659 }; 660 661 /// IMPLEMENTATION NOTE: PackageFieldMatchOption from winget/RepositorySearch.h 662 /// The field to match on. 663 /// The values must be declared in order of preference in search results. 664 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 665 enum PackageMatchField 666 { 667 CatalogDefault, 668 Id, 669 Name, 670 Moniker, 671 Command, 672 Tag, 673 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 3)] 674 { 675 PackageFamilyName, 676 ProductCode, 677 } 678 /// DESIGN NOTE: The following PackageFieldMatchOption from winget/RepositorySearch.h are not implemented in V1. 679 /// NormalizedNameAndPublisher, 680 }; 681 682 /// IMPLEMENTATION NOTE: PackageMatchFilter from winget/RepositorySearch.h 683 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 684 runtimeclass PackageMatchFilter 685 { 686 PackageMatchFilter(); 687 /// The type of string comparison for matching 688 PackageFieldMatchOption Option; 689 /// The field to search 690 PackageMatchField Field; 691 /// The value to match 692 String Value; 693 /// DESIGN NOTE: "Additional" from RequestMatch winget/RepositorySearch.h is not implemented here. 694 } 695 696 /// IMPLEMENTATION NOTE: MatchResult from winget/RepositorySearch.h 697 /// A single result from the search. 698 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 699 runtimeclass MatchResult 700 { 701 /// The package found by the search request. 702 CatalogPackage CatalogPackage { get; }; 703 704 /// The highest order field on which the package matched the search. 705 PackageMatchFilter MatchCriteria { get; }; 706 } 707 708 /// Status of the FindPackages call 709 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 710 enum FindPackagesResultStatus 711 { 712 Ok, 713 BlockedByPolicy, 714 CatalogError, 715 InternalError, 716 InvalidOptions, 717 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)] 718 { 719 AuthenticationError, 720 AccessDenied, 721 } 722 }; 723 724 /// IMPLEMENTATION NOTE: SearchResult from winget/RepositorySearch.h 725 /// Search result data returned from FindPackages 726 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 727 runtimeclass FindPackagesResult 728 { 729 /// Error codes 730 FindPackagesResultStatus Status{ get; }; 731 732 /// The full set of results from the search. 733 Windows.Foundation.Collections.IVectorView<MatchResult> Matches { get; }; 734 735 /// If true, the results were truncated by the given ResultLimit 736 /// USAGE NOTE: Windows Package Manager does not support result pagination, there is no way to continue 737 /// getting more results. 738 Boolean WasLimitExceeded { get; }; 739 740 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)] 741 { 742 /// The error code of the operation. 743 HRESULT ExtendedErrorCode{ get; }; 744 } 745 } 746 747 /// Options for FindPackages 748 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 749 runtimeclass FindPackagesOptions 750 { 751 FindPackagesOptions(); 752 753 /// DESIGN NOTE: 754 /// This class maps to SearchRequest from winget/RepositorySearch.h 755 /// That class is a container for data used to filter the available manifests in an package catalog. 756 /// Its properties can be thought of as: 757 /// (Query || Inclusions...) && Filters... 758 /// If Query and Inclusions are both empty, the starting data set will be the entire database. 759 /// Everything && Filters... 760 /// That has been translated in this api so that 761 /// Inclusions are Selectors below 762 /// Filters are Filters below 763 /// Query is PackageFieldMatchOption::PackageCatalogDefined and in the Selector list. 764 /// USAGE NOTE: Only one selector with PackageFieldMatchOption::PackageCatalogDefined is allowed. 765 766 /// Selectors = you have to match at least one selector (if there are no selectors, then nothing is selected) 767 Windows.Foundation.Collections.IVector<PackageMatchFilter> Selectors { get; }; 768 /// Filters = you have to match all filters(if there are no filters, then there is no filtering of selected items) 769 Windows.Foundation.Collections.IVector<PackageMatchFilter> Filters{ get; }; 770 771 /// Restricts the length of the returned results to the specified count. 772 UInt32 ResultLimit; 773 } 774 775 /// IMPLEMENTATION NOTE: Source from winget/RepositorySource.h 776 /// A catalog for searching for packages 777 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 778 runtimeclass PackageCatalog 779 { 780 /// Gets a value indicating whether this package catalog is a composite of other package catalogs, 781 /// and thus the packages may come from disparate package catalogs as well. 782 Boolean IsComposite { get; }; 783 /// The details of the package catalog if it is not a composite. 784 PackageCatalogInfo Info { get; }; 785 786 /// Searches for Packages in the catalog. 787 Windows.Foundation.IAsyncOperation<FindPackagesResult> FindPackagesAsync(FindPackagesOptions options); 788 FindPackagesResult FindPackages(FindPackagesOptions options); 789 } 790 791 /// Authentication mode 792 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)] 793 enum AuthenticationMode 794 { 795 /// Always use interactive authentication flow on first authentication request, following requests may use cached result. 796 Interactive, 797 /// Try silent authentication flow first. If failed, use interactive authentication flow. 798 SilentPreferred, 799 /// Only use silent authentication flow. If failed, fail the authentication. 800 Silent, 801 }; 802 803 /// Authentication related arguments 804 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)] 805 runtimeclass AuthenticationArguments 806 { 807 AuthenticationArguments(); 808 809 /// Choice of authentication flow behavior. 810 AuthenticationMode AuthenticationMode; 811 /// Optional. The authentication account to be used for authentication. 812 String AuthenticationAccount; 813 } 814 815 /// Authentication method 816 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)] 817 enum AuthenticationType 818 { 819 Unknown, 820 None, 821 MicrosoftEntraId, 822 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 823 { 824 MicrosoftEntraIdForAzureBlobStorage, 825 } 826 }; 827 828 /// Microsoft Entra Id related authentication info. 829 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)] 830 runtimeclass MicrosoftEntraIdAuthenticationInfo 831 { 832 /// The resource identifier or resource uri. 833 String Resource { get; }; 834 /// Requested scope. May be empty. 835 String Scope { get; }; 836 } 837 838 /// Authentication info. 839 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)] 840 runtimeclass AuthenticationInfo 841 { 842 /// The authentication type. 843 AuthenticationType AuthenticationType { get; }; 844 /// Microsoft Entra Id related authentication info. 845 MicrosoftEntraIdAuthenticationInfo MicrosoftEntraIdAuthenticationInfo { get; }; 846 } 847 848 /// Status of the Connect call 849 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 850 enum ConnectResultStatus 851 { 852 Ok, 853 CatalogError, 854 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 855 { 856 SourceAgreementsNotAccepted, 857 } 858 }; 859 860 /// Result of the Connect call 861 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 862 runtimeclass ConnectResult 863 { 864 /// Error codes 865 ConnectResultStatus Status { get; }; 866 867 PackageCatalog PackageCatalog { get; }; 868 869 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)] 870 { 871 /// The error code of the operation. 872 HRESULT ExtendedErrorCode{ get; }; 873 } 874 } 875 876 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 877 enum RefreshPackageCatalogStatus 878 { 879 Ok, 880 GroupPolicyError, 881 CatalogError, 882 InternalError, 883 }; 884 885 /// IMPLEMENTATION NOTE: RefreshPackageCatalogResult 886 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 887 runtimeclass RefreshPackageCatalogResult 888 { 889 RefreshPackageCatalogStatus Status { get; }; 890 891 /// Error codes 892 HRESULT ExtendedErrorCode { get; }; 893 }; 894 895 /// A reference to a catalog that callers can try to Connect. 896 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 897 runtimeclass PackageCatalogReference 898 { 899 /// Gets a value indicating whether this package catalog is a composite of other package catalogs, 900 /// and thus the packages may come from disparate package catalogs as well. 901 Boolean IsComposite { get; }; 902 903 /// The details of the package catalog if it is not a composite. 904 PackageCatalogInfo Info { get; }; 905 906 /// Opens a catalog. Required before searching. For remote catalogs (i.e. not Installed and Installing) this 907 /// may require downloading information from a server. 908 Windows.Foundation.IAsyncOperation<ConnectResult> ConnectAsync(); 909 ConnectResult Connect(); 910 911 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 2)] 912 { 913 /// A string that will be passed to the source server if using a REST source 914 String AdditionalPackageCatalogArguments; 915 } 916 917 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 918 { 919 /// Gets the required agreements for connecting to the package catalog (source). 920 Windows.Foundation.Collections.IVectorView<SourceAgreement> SourceAgreements { get; }; 921 922 Boolean AcceptSourceAgreements; 923 } 924 925 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 8)] 926 { 927 /// Time interval for package catalog to check for an update. Setting to zero will disable the check for update. 928 Windows.Foundation.TimeSpan PackageCatalogBackgroundUpdateInterval; 929 } 930 931 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 9)] 932 { 933 /// When set to true, the opened catalog will only provide the information regarding packages installed from this catalog. 934 /// In this mode, no external resources should be required. 935 Boolean InstalledPackageInformationOnly; 936 } 937 938 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)] 939 { 940 /// Authentication arguments used in authentication flow during package catalog operations if applicable. 941 /// This is user or caller input. 942 AuthenticationArguments AuthenticationArguments; 943 944 /// Authentication info from the package catalog. 945 /// This is defined by individual package catalog. 946 AuthenticationInfo AuthenticationInfo { get; }; 947 } 948 949 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 950 { 951 /// Updates the package catalog. 952 /// The progress value, represented as a double, indicates the percentage of update package catalog operation completion. 953 /// The progress range is from 0 to 100. 954 Windows.Foundation.IAsyncOperationWithProgress<RefreshPackageCatalogResult, Double> RefreshPackageCatalogAsync(); 955 } 956 } 957 958 /// Catalogs with PackageCatalogOrigin Predefined 959 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 960 enum PredefinedPackageCatalog 961 { 962 OpenWindowsCatalog, 963 MicrosoftStore, 964 DesktopFrameworks, 965 }; 966 967 /// Local Catalogs with PackageCatalogOrigin Predefined 968 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 969 enum LocalPackageCatalog 970 { 971 InstalledPackages, 972 InstallingPackages 973 }; 974 975 /// Options for creating a composite catalog. 976 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 977 runtimeclass CreateCompositePackageCatalogOptions 978 { 979 CreateCompositePackageCatalogOptions(); 980 981 /// Create a composite catalog to allow searching a user defined or pre defined source 982 /// and a local source (Installed packages) together 983 IVector<PackageCatalogReference> Catalogs { get; }; 984 /// Sets the default search behavior if the catalog is a composite catalog. 985 CompositeSearchBehavior CompositeSearchBehavior; 986 987 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 988 { 989 /// Create installed package catalog with required installed scope. 990 PackageInstallScope InstalledScope; 991 } 992 } 993 994 /// Required install scope for the package. If the package does not have an installer that 995 /// supports the specified scope the Install call will fail with InstallResultStatus.NoApplicableInstallers 996 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 997 enum PackageInstallScope 998 { 999 /// An installer with any install scope is valid. 1000 Any, 1001 /// Only User install scope installers are valid 1002 User, 1003 /// Only System installers will be valid 1004 System, 1005 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 1006 { 1007 /// Both User and Unknown install scope installers are valid 1008 UserOrUnknown, 1009 /// Both System and Unknown install scope installers are valid 1010 SystemOrUnknown, 1011 } 1012 }; 1013 1014 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 1015 enum PackageInstallMode 1016 { 1017 /// The default experience for the installer. Installer may show some UI. 1018 Default, 1019 /// Runs the installer in silent mode. This suppresses the installer's UI to the extent 1020 /// possible (installer may still show some required UI). 1021 Silent, 1022 /// Runs the installer in interactive mode. 1023 Interactive, 1024 }; 1025 1026 /// Options when installing a package. 1027 /// Intended to allow full compatibility with the "winget install" command line interface. 1028 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 1029 runtimeclass InstallOptions 1030 { 1031 InstallOptions(); 1032 1033 /// Optionally specifies the version from the package to install. If unspecified, the CatalogPackage.DefaultInstallVersion 1034 /// version is used. DefaultInstallVersion is the latest applicable version of the package. DefaultInstallVersion may be 1035 /// empty if there's no applicable version. In that case, install attempts without setting this PackageVersionId 1036 /// will return No Applicable Installer error code. 1037 PackageVersionId PackageVersionId; 1038 1039 /// Specifies alternate location to install package (if supported). 1040 String PreferredInstallLocation; 1041 /// User or Machine. 1042 PackageInstallScope PackageInstallScope; 1043 /// Silent, Interactive, or Default 1044 PackageInstallMode PackageInstallMode; 1045 /// Directs the logging to a log file. If provided, the installer must have write access to the file 1046 String LogOutputPath; 1047 /// Continues the install even if the hash in the catalog does not match the linked installer. 1048 Boolean AllowHashMismatch; 1049 /// A string that will be passed to the installer. 1050 /// IMPLEMENTATION NOTE: maps to "--override" in the winget cmd line 1051 String ReplacementInstallerArguments; 1052 1053 /// Used by a caller to correlate the install with a caller's data. 1054 /// The string must be JSON encoded. 1055 String CorrelationData; 1056 /// A string that will be passed to the source server if using a REST source 1057 String AdditionalPackageCatalogArguments; 1058 1059 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 2)] 1060 { 1061 /// The set of allowed Architectures, in preference order, that will be considered for 1062 /// the install operation. Initially the vector contains the default allowed architectures 1063 /// in the default preference order for the current system. It is allowed to have repeated 1064 /// values in the list, to make prepending a preference override easier. Instances of an 1065 /// architecture after the first will simply be ignored. 1066 Windows.Foundation.Collections.IVector<Windows.System.ProcessorArchitecture> AllowedArchitectures { get; }; 1067 } 1068 1069 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)] 1070 { 1071 /// Allow the upgrade to continue for upgrade packages with manifest versions Unknown. 1072 Boolean AllowUpgradeToUnknownVersion; 1073 } 1074 1075 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 1076 { 1077 /// Force the operation to continue upon non security related failures. 1078 Boolean Force; 1079 } 1080 1081 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 1082 { 1083 /// A string that will be passed to the installer 1084 /// IMPLEMENTATION NOTE: maps to "--custom" in the winget cmd line 1085 String AdditionalInstallerArguments; 1086 1087 /// Accept the package agreements required for installation. 1088 Boolean AcceptPackageAgreements; 1089 1090 /// Bypasses the Disabled Store Policy 1091 Boolean BypassIsStoreClientBlockedPolicyCheck; 1092 } 1093 1094 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 7)] 1095 { 1096 /// Skip installing the dependencies for the package. 1097 Boolean SkipDependencies; 1098 1099 /// The package installer type. 1100 PackageInstallerType InstallerType; 1101 } 1102 1103 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 1104 { 1105 /// Authentication arguments used when downloading the package installer if authentication is required. 1106 AuthenticationArguments AuthenticationArguments; 1107 } 1108 } 1109 1110 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)] 1111 enum PackageUninstallMode 1112 { 1113 /// The default experience for the installer. Installer may show some UI. 1114 Default, 1115 /// Runs the installer in silent mode. This suppresses the installer's UI to the extent 1116 /// possible (installer may still show some required UI). 1117 Silent, 1118 /// Runs the installer in interactive mode. 1119 Interactive, 1120 }; 1121 1122 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 1123 enum PackageUninstallScope 1124 { 1125 /// Use default uninstall behavior. 1126 Any, 1127 /// Uninstall for current user. Currently only applicable to msix. 1128 User, 1129 /// Uninstall for all users. Currently only applicable to msix. 1130 System, 1131 }; 1132 1133 /// Options when uninstalling a package. 1134 /// Intended to allow full compatibility with the "winget uninstall" command line interface. 1135 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)] 1136 runtimeclass UninstallOptions 1137 { 1138 UninstallOptions(); 1139 1140 /// This property is not currently used. The version of CatalogPackage.InstalledVersion is used for uninstall. 1141 PackageVersionId PackageVersionId; 1142 1143 /// Silent, Interactive, or Default 1144 PackageUninstallMode PackageUninstallMode; 1145 1146 /// Directs the logging to a log file. If provided, the installer must have write access to the file 1147 String LogOutputPath; 1148 1149 /// Used by a caller to correlate the install with a caller's data. 1150 /// The string must be JSON encoded. 1151 String CorrelationData; 1152 1153 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)] 1154 { 1155 /// Force the operation to continue upon non security related failures. 1156 Boolean Force; 1157 // The scope the uninstall will perform. Currently only applicable to msix. 1158 PackageUninstallScope PackageUninstallScope; 1159 } 1160 } 1161 1162 /// The Windows platform type. 1163 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 13)] 1164 enum WindowsPlatform 1165 { 1166 /// An unknown platform 1167 Unknown, 1168 /// Windows.Universal 1169 Universal, 1170 /// Windows.Desktop 1171 Desktop, 1172 /// Windows.IoT 1173 IoT, 1174 /// Windows.Team 1175 Team, 1176 /// Windows.Holographic 1177 Holographic, 1178 }; 1179 1180 /// Options when downloading a package. 1181 /// Intended to allow full compatibility with the "winget download" command line interface. 1182 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 7)] 1183 runtimeclass DownloadOptions 1184 { 1185 DownloadOptions(); 1186 1187 /// Optionally specifies the version from the package to download. If unspecified the version matching 1188 /// CatalogPackage.GetLatestVersion() is used. 1189 PackageVersionId PackageVersionId; 1190 1191 /// The package installer type. 1192 PackageInstallerType InstallerType; 1193 1194 /// The package installer scope. 1195 PackageInstallScope Scope; 1196 1197 /// The package installer architecture. 1198 Windows.System.ProcessorArchitecture Architecture; 1199 1200 /// The package installer locale. 1201 String Locale; 1202 1203 /// The directory where the installers are downloaded to. 1204 String DownloadDirectory; 1205 1206 /// Continues the download even if the hash in the catalog does not match the linked installer. 1207 Boolean AllowHashMismatch; 1208 1209 /// Skip downloading the dependencies for the package. 1210 Boolean SkipDependencies; 1211 1212 /// Accept the package agreements required for download. 1213 Boolean AcceptPackageAgreements; 1214 1215 /// Used by a caller to correlate the download with a caller's data. 1216 /// The string must be JSON encoded. 1217 String CorrelationData; 1218 1219 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 1220 { 1221 /// Authentication arguments used when downloading the package installer if authentication is required. 1222 AuthenticationArguments AuthenticationArguments; 1223 } 1224 1225 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 13)] 1226 { 1227 /// If the package is licensed from the Microsoft Store, setting this value to true will not attempt to download the license file. 1228 Boolean SkipMicrosoftStoreLicense; 1229 1230 /// The platform to download the package for. 1231 WindowsPlatform Platform; 1232 1233 /// When applicable, uses the provided value as the target OS version for the download. 1234 String TargetOSVersion; 1235 } 1236 } 1237 1238 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)] 1239 enum PackageRepairMode 1240 { 1241 /// The default experience for the installer. Installer may show some UI. 1242 Default, 1243 /// Runs the installer in silent mode. This suppresses the installer's UI to the extent 1244 /// possible (installer may still show some required UI). 1245 Silent, 1246 /// Runs the installer in interactive mode. 1247 Interactive, 1248 }; 1249 1250 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)] 1251 enum PackageRepairScope 1252 { 1253 /// Use default repair behavior. 1254 Any, 1255 /// Repair for current user. Currently only applicable to msix. 1256 User, 1257 /// Repair for all users. 1258 System, 1259 }; 1260 1261 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)] 1262 runtimeclass RepairOptions 1263 { 1264 RepairOptions(); 1265 1266 /// This property is not currently used. The version of CatalogPackage.InstalledVersion is used for repair. 1267 PackageVersionId PackageVersionId; 1268 1269 /// The package Repair scope. 1270 PackageRepairScope PackageRepairScope; 1271 1272 /// The package repair mode. 1273 PackageRepairMode PackageRepairMode; 1274 1275 /// Optional parameter specifying Accept the package agreements required for download. 1276 Boolean AcceptPackageAgreements; 1277 1278 /// Used by a caller to correlate the repair with a caller's data. 1279 /// The string must be JSON encoded. 1280 String CorrelationData; 1281 1282 /// Continues the download even if the hash in the catalog does not match the linked installer used for repair. 1283 Boolean AllowHashMismatch; 1284 1285 /// Directs the logging to a log file. If provided, the installer must have write access to the file 1286 String LogOutputPath; 1287 1288 /// Force the operation to continue upon non security related failures. 1289 Boolean Force; 1290 1291 /// Bypasses the Disabled Store Policy 1292 Boolean BypassIsStoreClientBlockedPolicyCheck; 1293 1294 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 1295 { 1296 /// Authentication arguments used when downloading the package installer if authentication is required. 1297 AuthenticationArguments AuthenticationArguments; 1298 } 1299 } 1300 1301 /// IMPLEMENTATION NOTE: Documentation from AppInstaller::Manifest::Documentation 1302 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 1303 runtimeclass Documentation 1304 { 1305 String DocumentLabel { get; }; 1306 1307 String DocumentUrl { get; }; 1308 } 1309 1310 /// Icon resolution 1311 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 1312 enum IconResolution 1313 { 1314 Custom, 1315 Square16, 1316 Square20, 1317 Square24, 1318 Square30, 1319 Square32, 1320 Square36, 1321 Square40, 1322 Square48, 1323 Square60, 1324 Square64, 1325 Square72, 1326 Square80, 1327 Square96, 1328 Square256, 1329 }; 1330 1331 /// Icon file type 1332 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 1333 enum IconFileType 1334 { 1335 Unknown, 1336 Jpeg, 1337 Png, 1338 Ico, 1339 }; 1340 1341 /// Icon theme 1342 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 1343 enum IconTheme 1344 { 1345 Unknown, 1346 Default, 1347 Light, 1348 Dark, 1349 HighContrast, 1350 }; 1351 1352 /// IMPLEMENTATION NOTE: Icon from AppInstaller::Manifest::Icon 1353 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 1354 runtimeclass Icon 1355 { 1356 String Url { get; }; 1357 1358 IconFileType FileType{ get; }; 1359 1360 IconResolution Resolution{ get; }; 1361 1362 IconTheme Theme{ get; }; 1363 1364 UInt8[] Sha256 { get; }; 1365 } 1366 1367 /// IMPLEMENTATION NOTE: SourceAgreement from AppInstaller::Manifest::SourceAgreement 1368 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 1369 runtimeclass SourceAgreement 1370 { 1371 String Label { get; }; 1372 1373 String Text { get; }; 1374 1375 String Url { get; }; 1376 } 1377 1378 /// IMPLEMENTATION NOTE: PackageAgreement from AppInstaller::Manifest::Agreement 1379 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 1380 runtimeclass PackageAgreement 1381 { 1382 String Label { get; }; 1383 1384 String Text { get; }; 1385 1386 String Url { get; }; 1387 } 1388 1389 /// IMPLEMENTATION NOTE: CatalogPackageMetadata from AppInstaller::Manifest::Localization 1390 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)] 1391 runtimeclass CatalogPackageMetadata 1392 { 1393 String Locale { get; }; 1394 1395 String Publisher { get; }; 1396 1397 String PublisherUrl { get; }; 1398 1399 String PublisherSupportUrl { get; }; 1400 1401 String PrivacyUrl { get; }; 1402 1403 String Author { get; }; 1404 1405 String PackageName { get; }; 1406 1407 String PackageUrl { get; }; 1408 1409 String License { get; }; 1410 1411 String LicenseUrl { get; }; 1412 1413 String Copyright { get; }; 1414 1415 String CopyrightUrl { get; }; 1416 1417 String ShortDescription { get; }; 1418 1419 String Description { get; }; 1420 1421 Windows.Foundation.Collections.IVectorView<String> Tags { get; }; 1422 1423 Windows.Foundation.Collections.IVectorView<PackageAgreement> Agreements { get; }; 1424 1425 Windows.Foundation.Collections.IVectorView<Documentation> Documentations { get; }; 1426 1427 Windows.Foundation.Collections.IVectorView<Icon> Icons { get; }; 1428 1429 String ReleaseNotes { get; }; 1430 1431 String ReleaseNotesUrl { get; }; 1432 1433 String PurchaseUrl { get; }; 1434 1435 String InstallationNotes { get; }; 1436 } 1437 1438 /// IMPLEMENTATION NOTE: AddPackageCatalogOptions 1439 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 1440 runtimeclass AddPackageCatalogOptions 1441 { 1442 AddPackageCatalogOptions(); 1443 1444 /// The name of the package catalog. 1445 /// SAMPLE VALUES: For OpenWindowsCatalog "winget". 1446 /// For contoso sample on msdn "contoso" 1447 String Name; 1448 1449 /// The SourceUri used when adding the package catalog. 1450 /// SAMPLE VALUES: For OpenWindowsCatalog "https://winget.azureedge.net/cache" 1451 /// For contoso sample on msdn "https://pkgmgr-int.azureedge.net/cache" 1452 String SourceUri; 1453 1454 /// ALLOWED VALUES: "Microsoft.Rest", "Microsoft.PreIndexed.Package" 1455 /// SAMPLE VALUES: For OpenWindowsCatalog "Microsoft.PreIndexed.Package". 1456 /// For contoso sample on msdn "Microsoft.PreIndexed.Package" 1457 String Type; 1458 1459 /// The trust level of the catalog to add. 1460 PackageCatalogTrustLevel TrustLevel; 1461 1462 /// Custom header to pass to the catalog. 1463 String CustomHeader; 1464 1465 /// Excludes a source from discovery unless specified. 1466 Boolean Explicit; 1467 }; 1468 1469 /// IMPLEMENTATION NOTE: AddPackageCatalogStatus 1470 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 1471 enum AddPackageCatalogStatus 1472 { 1473 Ok, 1474 GroupPolicyError, 1475 CatalogError, 1476 InternalError, 1477 InvalidOptions, 1478 AccessDenied, 1479 AuthenticationError, 1480 }; 1481 1482 /// IMPLEMENTATION NOTE: AddPackageCatalogResult 1483 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 1484 runtimeclass AddPackageCatalogResult 1485 { 1486 AddPackageCatalogStatus Status { get; }; 1487 1488 /// Error codes 1489 HRESULT ExtendedErrorCode { get; }; 1490 }; 1491 1492 /// IMPLEMENTATION NOTE: RemovePackageCatalogOptions 1493 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 1494 runtimeclass RemovePackageCatalogOptions 1495 { 1496 RemovePackageCatalogOptions(); 1497 1498 /// The name of the package catalog. 1499 /// SAMPLE VALUES: For OpenWindowsCatalog "winget". 1500 /// For contoso sample on msdn "contoso" 1501 String Name; 1502 1503 /// By default, the value is 'false', resulting in the removal of the package catalog registration 1504 /// from the winget Package catalogs list and the deletion of all associated system artifacts. This 1505 /// mirrors the WinGet Source remove operation on a specific Package Catalog. 1506 /// If set to 'true', it removes the package catalog registration from the Windows Package Catalogs 1507 /// list without any cleanup, similar to the WinGet source reset operation on a specific Package 1508 /// Catalog. 1509 Boolean PreserveData; 1510 }; 1511 1512 /// IMPLEMENTATION NOTE: RemovePackageCatalogStatus 1513 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 1514 enum RemovePackageCatalogStatus 1515 { 1516 Ok, 1517 GroupPolicyError, 1518 CatalogError, 1519 InternalError, 1520 AccessDenied, 1521 InvalidOptions, 1522 }; 1523 1524 /// IMPLEMENTATION NOTE: RemovePackageCatalogResult 1525 /// Result of removing a package catalog. 1526 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 1527 runtimeclass RemovePackageCatalogResult 1528 { 1529 RemovePackageCatalogStatus Status { get; }; 1530 1531 /// Error codes 1532 HRESULT ExtendedErrorCode { get; }; 1533 }; 1534 1535 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)] 1536 runtimeclass PackageManager 1537 { 1538 PackageManager(); 1539 1540 /// Get the available catalogs. Each source will have a separate catalog. 1541 /// This does not open the catalog. These catalogs can be used individually or merged with CreateCompositePackageCatalogAsync. 1542 /// IMPLEMENTATION NOTE: This is a list of sources returned by Windows Package Manager source list 1543 Windows.Foundation.Collections.IVectorView<PackageCatalogReference> GetPackageCatalogs(); 1544 /// Get a built in catalog 1545 PackageCatalogReference GetPredefinedPackageCatalog(PredefinedPackageCatalog predefinedPackageCatalog); 1546 /// Get a built in catalog 1547 PackageCatalogReference GetLocalPackageCatalog(LocalPackageCatalog localPackageCatalog); 1548 /// Get a catalog by a known name 1549 PackageCatalogReference GetPackageCatalogByName(String catalogName); 1550 /// Get a composite catalog to allow searching a user defined or pre defined source and a local source 1551 /// (Installing, Installed) together at the same time. 1552 PackageCatalogReference CreateCompositePackageCatalog(CreateCompositePackageCatalogOptions options); 1553 1554 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)] 1555 { 1556 /// Add a catalog to the Windows Package Catalogs. 1557 /// The progress value, represented as a double, indicates the percentage of add package catalog operation completion. 1558 /// The progress range is from 0 to 100. 1559 Windows.Foundation.IAsyncOperationWithProgress<AddPackageCatalogResult, Double> AddPackageCatalogAsync(AddPackageCatalogOptions options); 1560 1561 /// Unregisters a Package Catalog from the Windows Package Catalogs and eliminates the system artifacts based on the provided options. 1562 /// The progress value, represented as a double, indicates the percentage of remove package catalog operation completion. 1563 /// The progress range is from 0 to 100. 1564 Windows.Foundation.IAsyncOperationWithProgress<RemovePackageCatalogResult, Double> RemovePackageCatalogAsync(RemovePackageCatalogOptions options); 1565 } 1566 1567 /// Install the specified package 1568 Windows.Foundation.IAsyncOperationWithProgress<InstallResult, InstallProgress> InstallPackageAsync(CatalogPackage package, InstallOptions options); 1569 1570 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 2)] 1571 { 1572 /// Get install progress 1573 Windows.Foundation.IAsyncOperationWithProgress<InstallResult, InstallProgress> GetInstallProgress(CatalogPackage package, PackageCatalogInfo catalogInfo); 1574 } 1575 1576 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)] 1577 { 1578 /// Upgrade the specified package 1579 Windows.Foundation.IAsyncOperationWithProgress<InstallResult, InstallProgress> UpgradePackageAsync(CatalogPackage package, InstallOptions options); 1580 1581 /// Uninstall the specified package 1582 Windows.Foundation.IAsyncOperationWithProgress<UninstallResult, UninstallProgress> UninstallPackageAsync(CatalogPackage package, UninstallOptions options); 1583 1584 /// Get uninstall progress 1585 Windows.Foundation.IAsyncOperationWithProgress<UninstallResult, UninstallProgress> GetUninstallProgress(CatalogPackage package, PackageCatalogInfo catalogInfo); 1586 } 1587 1588 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 7)] 1589 { 1590 // Download the specified package 1591 Windows.Foundation.IAsyncOperationWithProgress<DownloadResult, PackageDownloadProgress> DownloadPackageAsync(CatalogPackage package, DownloadOptions options); 1592 1593 // Get download progress 1594 Windows.Foundation.IAsyncOperationWithProgress<DownloadResult, PackageDownloadProgress> GetDownloadProgress(CatalogPackage package, PackageCatalogInfo catalogInfo); 1595 } 1596 1597 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)] 1598 { 1599 // Repair the specified package 1600 Windows.Foundation.IAsyncOperationWithProgress<RepairResult, RepairProgress> RepairPackageAsync(CatalogPackage package, RepairOptions options); 1601 } 1602 1603 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 13)] 1604 { 1605 // The version of the Windows Package Manager that is running. 1606 String Version{ get; }; 1607 } 1608 } 1609 1610 /// Global settings for PackageManager operations. 1611 /// This settings should be invoked prior to invocation of PackageManager class. 1612 /// This settings is only exposed in in-proc Com invocation. 1613 [contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)] 1614 runtimeclass PackageManagerSettings 1615 { 1616 PackageManagerSettings(); 1617 1618 /// Sets caller name to be used in telemetry logging. Default value is the calling process name. 1619 /// Call this before any PackageManager operations. 1620 /// Returns true if successful, false if caller name is already set. 1621 /// This is a one time setup, multiple calls will not override existing caller name. 1622 Boolean SetCallerIdentifier(String callerIdentifier); 1623 1624 /// Sets state name for state separation. If not set, state will be written in a default location and states may be affected by other callers. 1625 /// Call this before any PackageManager operations. 1626 /// Returns true if successful, false if state name is already set. 1627 /// This is a one time setup, multiple calls will not override existing state name. 1628 Boolean SetStateIdentifier(String stateIdentifier); 1629 1630 /// Sets custom UserSettings. 1631 /// Returns true if successful, false if settingsContent cannot be parsed or UserSettings is already created. 1632 /// This is a one time setup, multiple calls will not override existing UserSettings. 1633 Boolean SetUserSettings(String settingsContent); 1634 } 1635 1636 /// Force midl3 to generate vector marshalling info. 1637 declare 1638 { 1639 interface Windows.Foundation.Collections.IVector<PackageCatalog>; 1640 interface Windows.Foundation.Collections.IVectorView<PackageCatalog>; 1641 interface Windows.Foundation.Collections.IVector<PackageCatalogInfo>; 1642 interface Windows.Foundation.Collections.IVectorView<PackageCatalogInfo>; 1643 interface Windows.Foundation.Collections.IVector<PackageCatalogReference>; 1644 interface Windows.Foundation.Collections.IVectorView<PackageCatalogReference>; 1645 interface Windows.Foundation.Collections.IVector<CatalogPackage>; 1646 interface Windows.Foundation.Collections.IVectorView<CatalogPackage>; 1647 interface Windows.Foundation.Collections.IVector<FindPackagesOptions>; 1648 interface Windows.Foundation.Collections.IVectorView<FindPackagesOptions>; 1649 interface Windows.Foundation.Collections.IVector<FindPackagesResult>; 1650 interface Windows.Foundation.Collections.IVectorView<FindPackagesResult>; 1651 interface Windows.Foundation.Collections.IVector<CreateCompositePackageCatalogOptions>; 1652 interface Windows.Foundation.Collections.IVectorView<CreateCompositePackageCatalogOptions>; 1653 interface Windows.Foundation.Collections.IVector<InstallOptions>; 1654 interface Windows.Foundation.Collections.IVectorView<InstallOptions>; 1655 interface Windows.Foundation.Collections.IVector<InstallResult>; 1656 interface Windows.Foundation.Collections.IVectorView<InstallResult>; 1657 interface Windows.Foundation.Collections.IVector<UninstallOptions>; 1658 interface Windows.Foundation.Collections.IVectorView<UninstallOptions>; 1659 interface Windows.Foundation.Collections.IVector<UninstallResult>; 1660 interface Windows.Foundation.Collections.IVectorView<UninstallResult>; 1661 interface Windows.Foundation.Collections.IVector<DownloadOptions>; 1662 interface Windows.Foundation.Collections.IVectorView<DownloadOptions>; 1663 interface Windows.Foundation.Collections.IVector<DownloadResult>; 1664 interface Windows.Foundation.Collections.IVectorView<DownloadResult>; 1665 interface Windows.Foundation.Collections.IVector<MatchResult>; 1666 interface Windows.Foundation.Collections.IVectorView<MatchResult>; 1667 interface Windows.Foundation.Collections.IVector<PackageMatchFilter>; 1668 interface Windows.Foundation.Collections.IVectorView<PackageMatchFilter>; 1669 interface Windows.Foundation.Collections.IVector<PackageVersionId>; 1670 interface Windows.Foundation.Collections.IVectorView<PackageVersionId>; 1671 interface Windows.Foundation.Collections.IVector<PackageVersionInfo>; 1672 interface Windows.Foundation.Collections.IVectorView<PackageVersionInfo>; 1673 interface Windows.Foundation.Collections.IVector<PackageInstallerInfo>; 1674 interface Windows.Foundation.Collections.IVectorView<PackageInstallerInfo>; 1675 interface Windows.Foundation.Collections.IVector<InstalledStatus>; 1676 interface Windows.Foundation.Collections.IVectorView<InstalledStatus>; 1677 interface Windows.Foundation.Collections.IVector<PackageInstallerInstalledStatus>; 1678 interface Windows.Foundation.Collections.IVectorView<PackageInstallerInstalledStatus>; 1679 interface Windows.Foundation.Collections.IVector<CheckInstalledStatusResult>; 1680 interface Windows.Foundation.Collections.IVectorView<CheckInstalledStatusResult>; 1681 interface Windows.Foundation.Collections.IVector<SourceAgreement>; 1682 interface Windows.Foundation.Collections.IVectorView<SourceAgreement>; 1683 interface Windows.Foundation.Collections.IVector<PackageAgreement>; 1684 interface Windows.Foundation.Collections.IVectorView<PackageAgreement>; 1685 interface Windows.Foundation.Collections.IVector<Documentation>; 1686 interface Windows.Foundation.Collections.IVectorView<Documentation>; 1687 interface Windows.Foundation.Collections.IVector<Icon>; 1688 interface Windows.Foundation.Collections.IVectorView<Icon>; 1689 interface Windows.Foundation.Collections.IVector<CatalogPackageMetadata>; 1690 interface Windows.Foundation.Collections.IVectorView<CatalogPackageMetadata>; 1691 interface Windows.Foundation.Collections.IVector<AuthenticationArguments>; 1692 interface Windows.Foundation.Collections.IVectorView<AuthenticationArguments>; 1693 interface Windows.Foundation.Collections.IVector<MicrosoftEntraIdAuthenticationInfo>; 1694 interface Windows.Foundation.Collections.IVectorView<MicrosoftEntraIdAuthenticationInfo>; 1695 interface Windows.Foundation.Collections.IVector<AuthenticationInfo>; 1696 interface Windows.Foundation.Collections.IVectorView<AuthenticationInfo>; 1697 interface Windows.Foundation.Collections.IVector<RepairOptions>; 1698 interface Windows.Foundation.Collections.IVectorView<RepairOptions>; 1699 interface Windows.Foundation.Collections.IVector<RepairResult>; 1700 interface Windows.Foundation.Collections.IVectorView<RepairResult>; 1701 } 1702 }