-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathPackageManager.idl
1666 lines (1434 loc) · 69.8 KB
/
PackageManager.idl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Microsoft.Management.Deployment
{
[contractversion(12)] // For version 1.10
apicontract WindowsPackageManagerContract{};
/// State of the install
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum PackageInstallProgressState
{
/// The install is queued but not yet active. Cancellation of the IAsyncOperationWithProgress in this
/// state will prevent the package from downloading or installing.
Queued,
/// The installer is downloading. Cancellation of the IAsyncOperationWithProgress in this state will
/// end the download and prevent the package from installing.
Downloading,
/// The install is in progress. Cancellation of the IAsyncOperationWithProgress in this state will not
/// stop the installation or the post install cleanup.
Installing,
/// The installer has completed and cleanup actions are in progress. Cancellation of the
/// IAsyncOperationWithProgress in this state will not stop cleanup or roll back the install.
PostInstall,
/// The operation has completed.
Finished,
};
/// Progress object for the install
/// DESIGN NOTE: percentage for the install as a whole is purposefully not included as there is no way to
/// estimate progress when the installer is running.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
struct InstallProgress
{
/// State of the install
PackageInstallProgressState State;
/// DESIGN NOTE: BytesDownloaded may only be available for downloads done by Windows Package Manager itself.
/// Number of bytes downloaded if known
UInt64 BytesDownloaded;
/// DESIGN NOTE: BytesRequired may only be available for downloads done by Windows Package Manager itself.
/// Number of bytes required if known
UInt64 BytesRequired;
/// Download percentage completed
Double DownloadProgress;
/// Install percentage if known.
Double InstallationProgress;
};
/// Status of the Install call
/// Implementation Note: Errors mapped from AppInstallerErrors.h
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum InstallResultStatus
{
Ok,
BlockedByPolicy,
CatalogError,
InternalError,
InvalidOptions,
DownloadError,
InstallError,
ManifestError,
NoApplicableInstallers,
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)]
{
NoApplicableUpgrade,
},
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)]
{
PackageAgreementsNotAccepted,
}
};
/// Result of the install
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass InstallResult
{
/// Used by a caller to correlate the install with a caller's data.
String CorrelationData { get; };
/// Whether a restart is required to complete the install.
Boolean RebootRequired { get; };
/// Batched error code, example APPINSTALLER_CLI_ERROR_SHELLEXEC_INSTALL_FAILED
InstallResultStatus Status { get; };
/// The error code of the overall operation.
HRESULT ExtendedErrorCode { get; };
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)]
{
/// The error code from the install attempt. Only valid if the Status is InstallError.
/// This value's meaning will require knowledge of the specific installer or install technology.
UInt32 InstallerErrorCode { get; };
}
}
/// State of the uninstall
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)]
enum PackageUninstallProgressState
{
/// The uninstall is queued but not yet active. Cancellation of the IAsyncOperationWithProgress in this
/// state will prevent the package from uninstalling.
Queued,
/// The uninstall is in progress. Cancellation of the IAsyncOperationWithProgress in this state will not
/// stop the installation or the post uninstall steps.
Uninstalling,
/// The uninstaller has completed and cleanup actions are in progress. Cancellation of the
/// IAsyncOperationWithProgress in this state will not stop cleanup or roll back the uninstall.
PostUninstall,
/// The operation has completed.
Finished,
};
/// Progress object for the uninstall
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)]
struct UninstallProgress
{
/// State of the uninstall
PackageUninstallProgressState State;
/// Uninstall percentage if known.
Double UninstallationProgress;
};
/// Status of the uninstall call
/// Implementation Note: Errors mapped from AppInstallerErrors.h
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)]
enum UninstallResultStatus
{
Ok,
BlockedByPolicy,
CatalogError,
InternalError,
InvalidOptions,
UninstallError,
ManifestError,
};
/// Result of the uninstall
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)]
runtimeclass UninstallResult
{
/// Used by a caller to correlate the install with a caller's data.
String CorrelationData { get; };
/// Whether a restart is required to complete the install.
Boolean RebootRequired { get; };
/// Batched error code, example APPINSTALLER_CLI_ERROR_SHELLEXEC_INSTALL_FAILED
UninstallResultStatus Status { get; };
/// The error code of the overall operation.
HRESULT ExtendedErrorCode { get; };
/// The error code from the uninstall attempt. Only valid if the Status is UninstallError.
/// This value's meaning will require knowledge of the specific uninstaller or install technology.
UInt32 UninstallerErrorCode { get; };
}
/// State of the repair
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)]
enum PackageRepairProgressState
{
/// The repair is queued but not yet active. Cancellation of the IAsyncOperationWithProgress in this
/// state will prevent the package from repairing.
Queued,
/// The repair is in progress. Cancellation of the IAsyncOperationWithProgress in this state will not
/// stop the repair or the post repair steps.
Repairing,
/// The repair has completed and cleanup actions are in progress. Cancellation of the
/// IAsyncOperationWithProgress in this state will not stop cleanup or roll back the repair.
PostRepair,
/// The operation has completed.
Finished,
};
/// Progress object for the repair
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)]
struct RepairProgress
{
/// State of the repair
PackageRepairProgressState State;
/// Repair percentage if known.
Double RepairCompletionProgress;
};
/// Status of the repair call
/// Implementation Note: Errors mapped from AppInstallerErrors.h
/// DESIGN NOTE: RepairResultStatus from AppInstallerErrors.h is not implemented in V1.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)]
enum RepairResultStatus
{
Ok,
BlockedByPolicy,
CatalogError,
DownloadError,
InternalError,
InvalidOptions,
RepairError,
ManifestError,
NoApplicableRepairer,
PackageAgreementsNotAccepted,
};
/// Result of the repair
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)]
runtimeclass RepairResult
{
/// Used by a caller to correlate the repair with a caller's data.
String CorrelationData { get; };
/// Whether a restart is required to complete the repair.
Boolean RebootRequired { get; };
/// Batched error code, example APPINSTALLER_CLI_ERROR_SHELLEXEC_INSTALL_FAILED
RepairResultStatus Status { get; };
/// The error code of the overall operation.
HRESULT ExtendedErrorCode { get; };
/// The error code from the repair attempt. Only valid if the Status is RepairError.
/// This value's meaning will require knowledge of the specific repairer or repair technology.
UInt32 RepairerErrorCode { get; };
}
/// State of the download
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 7)]
enum PackageDownloadProgressState
{
/// The download is queued but not yet active. Cancellation of the IAsyncOperationWithProgress in this
/// state will prevent the package from downloading.
Queued,
/// The installer is downloading. Cancellation of the IAsyncOperationWithProgress in this state will
/// end the download.
Downloading,
/// The operation has completed.
Finished,
};
/// Status of the download call
/// Implementation Note: Errors mapped from AppInstallerErrors.h
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 7)]
enum DownloadResultStatus
{
Ok,
BlockedByPolicy,
CatalogError,
InternalError,
InvalidOptions,
DownloadError,
ManifestError,
NoApplicableInstallers,
PackageAgreementsNotAccepted,
};
/// Result of the download
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 7)]
runtimeclass DownloadResult
{
/// Used by a caller to correlate the download with a caller's data.
String CorrelationData { get; };
/// Batched error code.
DownloadResultStatus Status { get; };
/// The error code of the overall operation.
HRESULT ExtendedErrorCode { get; };
};
/// Progress object for the uninstall
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 7)]
struct PackageDownloadProgress
{
/// State of the download
PackageDownloadProgressState State;
/// DESIGN NOTE: BytesDownloaded may only be available for downloads done by Windows Package Manager itself.
/// Number of bytes downloaded if known
UInt64 BytesDownloaded;
/// DESIGN NOTE: BytesRequired may only be available for downloads done by Windows Package Manager itself.
/// Number of bytes required if known
UInt64 BytesRequired;
/// Download percentage completed
Double DownloadProgress;
};
/// IMPLEMENTATION NOTE: SourceOrigin from winget/RepositorySource.h
/// Defines the origin of the package catalog details.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum PackageCatalogOrigin
{
/// Predefined means it came as part of the Windows Package Manager package and cannot be removed.
Predefined,
/// User means it was added by the user and could be removed.
User,
};
/// IMPLEMENTATION NOTE: SourceTrustLevel from winget/RepositorySource.h
/// Defines the trust level of the package catalog.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum PackageCatalogTrustLevel
{
None,
Trusted,
};
/// IMPLEMENTATION NOTE: SourceDetails from winget/RepositorySource.h
/// Interface for retrieving information about an package catalog without acting on it.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass PackageCatalogInfo
{
/// The package catalog's unique identifier.
/// SAMPLE VALUES: For OpenWindowsCatalog "Microsoft.Winget.Source_8wekyb3d8bbwe"
/// For contoso sample on msdn "contoso"
String Id { get; };
/// The name of the package catalog.
/// SAMPLE VALUES: For OpenWindowsCatalog "winget".
/// For contoso sample on msdn "contoso"
String Name { get; };
/// The type of the package catalog.
/// ALLOWED VALUES: "Microsoft.Rest", "Microsoft.PreIndexed.Package"
/// SAMPLE VALUES: For OpenWindowsCatalog "Microsoft.PreIndexed.Package".
/// For contoso sample on msdn "Microsoft.PreIndexed.Package"
String Type { get; };
/// The argument used when adding the package catalog.
/// SAMPLE VALUES: For OpenWindowsCatalog "https://winget.azureedge.net/cache"
/// For contoso sample on msdn "https://pkgmgr-int.azureedge.net/cache"
String Argument { get; };
/// The last time that this package catalog was updated.
Windows.Foundation.DateTime LastUpdateTime { get; };
/// The origin of the package catalog.
PackageCatalogOrigin Origin { get; };
/// The trust level of the package catalog
PackageCatalogTrustLevel TrustLevel { get; };
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)]
{
/// Excludes a source from discovery unless specified.
Boolean Explicit{ get; };
}
}
/// A metadata item of a package version.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum PackageVersionMetadataField
{
/// The InstallerType of an installed package
InstallerType,
/// The Scope of an installed package
InstalledScope,
/// The system path where the package is installed
InstalledLocation,
/// The standard uninstall command; which may be interactive
StandardUninstallCommand,
/// An uninstall command that should be non-interactive
SilentUninstallCommand,
/// The publisher of the package
PublisherDisplayName,
};
/// The result of a comparison.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 2)]
enum CompareResult
{
/// The comparison did not result in a succesful ordering.
Unknown,
/// The object value is lesser than the given value.
Lesser,
/// The object value is equal to the given value.
Equal,
/// The object value is greater than the given value.
Greater,
};
/// IMPLEMENTATION NOTE: IPackageVersion from winget/RepositorySearch.h
/// A single package version.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass PackageVersionInfo
{
/// IMPLEMENTATION NOTE: PackageVersionMetadata fields from winget/RepositorySearch.h
/// Gets any metadata associated with this package version.
/// Primarily stores data on installed packages.
/// Metadata fields may have no value (e.g. packages that aren't installed will not have an InstalledLocation).
String GetMetadata(PackageVersionMetadataField metadataField);
/// IMPLEMENTATION NOTE: PackageVersionProperty fields from winget/RepositorySearch.h
String Id { get; };
String DisplayName { get; };
String Version { get; };
String Channel { get; };
/// DESIGN NOTE: RelativePath from winget/RepositorySearch.h is excluded as not needed.
/// String RelativePath;
/// IMPLEMENTATION NOTE: PackageVersionMultiProperty fields from winget/RepositorySearch.h
/// PackageFamilyName and ProductCode can have multiple values.
Windows.Foundation.Collections.IVectorView<String> PackageFamilyNames { get; };
Windows.Foundation.Collections.IVectorView<String> ProductCodes { get; };
/// Gets the package catalog where this package version is from.
PackageCatalog PackageCatalog { get; };
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 2)]
{
/// Compares the given value against the package version of this object, with the result being
/// the enum value that represents where PackageVersionInfo::Version is ordered relative to the
/// versionString. "if (this.CompareToVersion(that) == Greater)" can be thought of as reading
/// the sentence "If this is compared to version that and is found to be greater".
/// IE if PackageVersionInfo::Version returns "2", then CompareToVersion("1") will return Greater.
/// Passing in an empty string will result in Unknown.
CompareResult CompareToVersion(String versionString);
}
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 4)]
{
/// Checks if this package version has at least one applicable installer.
Boolean HasApplicableInstaller(InstallOptions options);
/// Gets the publisher string for this package version, if one is available.
String Publisher { get; };
}
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)]
{
/// Gets the package catalog metadata of this package version with the default localization based on user settings.
CatalogPackageMetadata GetCatalogPackageMetadata();
/// Gets the package catalog metadata of this package version with the preferred locale.
CatalogPackageMetadata GetCatalogPackageMetadata(String preferredLocale);
/// Gets the applicable installer for this package version.
PackageInstallerInfo GetApplicableInstaller(InstallOptions options);
}
}
/// IMPLEMENTATION NOTE: PackageVersionKey from winget/RepositorySearch.h
/// A key to identify a package version within a package.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass PackageVersionId
{
/// The package catalog id that this version came from.
String PackageCatalogId { get; };
/// The version.
String Version { get; };
/// The channel.
String Channel { get; };
};
/// The package installer type.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)]
enum PackageInstallerType
{
/// Unknown type.
Unknown,
/// Inno type.
Inno,
/// Wix type.
Wix,
/// Msi type.
Msi,
/// Nullsoft type.
Nullsoft,
/// Zip type.
Zip,
/// Msix or Appx type.
Msix,
/// Exe type.
Exe,
/// Burn type.
Burn,
/// MSStore type.
MSStore,
/// Portable type.
Portable,
};
/// The package installer scope.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)]
enum PackageInstallerScope
{
/// Scope not declared.
Unknown,
/// User scope.
User,
/// System scope.
System,
};
/// The package installer elevation requirement.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)]
enum ElevationRequirement
{
/// Elevation requirement not declared.
Unknown,
/// Package installer requires elevation.
ElevationRequired,
/// Package installer prohibits elevation.
ElevationProhibited,
/// Package installer elevates self.
ElevatesSelf,
};
/// Interface for retrieving information about a package installer.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)]
runtimeclass PackageInstallerInfo
{
/// The package installer type.
PackageInstallerType InstallerType { get; };
/// The nested package installer type for archives.
PackageInstallerType NestedInstallerType { get; };
/// The package installer architecture.
Windows.System.ProcessorArchitecture Architecture { get; };
/// The package installer scope.
PackageInstallerScope Scope { get; };
/// The package installer locale.
String Locale { get; };
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)]
{
/// The package installer elevation requirement.
ElevationRequirement ElevationRequirement { get; };
}
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)]
{
/// Authentication info from the package installer.
AuthenticationInfo AuthenticationInfo { get; };
}
};
/// The installed status type. The values need to match InstalledStatusType from winget/RepositorySearch.h.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)]
[flags]
enum InstalledStatusType
{
/// None is checked.
None = 0x0,
/// Check Apps and Features entry.
AppsAndFeaturesEntry = 0x0001,
/// Check Apps and Features entry install location if applicable.
AppsAndFeaturesEntryInstallLocation = 0x0002,
/// Check Apps and Features entry install location with installed files if applicable.
AppsAndFeaturesEntryInstallLocationFile = 0x0004,
/// Check default install location if applicable.
DefaultInstallLocation = 0x0008,
/// Check default install location with installed files if applicable.
DefaultInstallLocationFile = 0x0010,
/// Below are helper values for calling CheckInstalledStatus as input.
/// AppsAndFeaturesEntry related checks
AllAppsAndFeaturesEntryChecks = AppsAndFeaturesEntry | AppsAndFeaturesEntryInstallLocation | AppsAndFeaturesEntryInstallLocationFile,
/// DefaultInstallLocation related checks
AllDefaultInstallLocationChecks = DefaultInstallLocation | DefaultInstallLocationFile,
/// All checks
AllChecks = AllAppsAndFeaturesEntryChecks | AllDefaultInstallLocationChecks,
};
/// Interface representing an individual installed status.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)]
runtimeclass InstalledStatus
{
/// The installed status type.
InstalledStatusType Type { get; };
/// The installed status path.
String Path { get; };
/// The installed status result.
HRESULT Status { get; };
};
/// Interface for retrieving information about a package installer installed status.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)]
runtimeclass PackageInstallerInstalledStatus
{
/// The package installer info.
PackageInstallerInfo InstallerInfo { get; };
/// A list of various types of installed status of the package installer.
Windows.Foundation.Collections.IVectorView<InstalledStatus> InstallerInstalledStatus { get; };
};
/// Status of the check installed status call.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)]
enum CheckInstalledStatusResultStatus
{
Ok,
InternalError,
};
/// Interface for retrieving information about a package installer installed status.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)]
runtimeclass CheckInstalledStatusResult
{
/// Status of the check installed status call.
CheckInstalledStatusResultStatus Status { get; };
/// A list of package installer installed status.
Windows.Foundation.Collections.IVectorView<PackageInstallerInstalledStatus> PackageInstalledStatus { get; };
};
/// IMPLEMENTATION NOTE: IPackage from winget/RepositorySearch.h
/// A package, potentially containing information about it's local state and the available versions.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass CatalogPackage
{
/// IMPLEMENTATION NOTE: PackageProperty fields from winget/RepositorySearch.h
/// Gets a property of this package.
String Id { get; };
String Name { get; };
/// Gets the installed package information if the package is installed.
PackageVersionInfo InstalledVersion { get; };
/// Gets all available versions of this package. Ordering is not guaranteed.
Windows.Foundation.Collections.IVectorView<PackageVersionId> AvailableVersions { get; };
/// Gets the version of this package that will be installed if version is not set in InstallOptions.
PackageVersionInfo DefaultInstallVersion { get; };
/// Gets a specific version of this package.
PackageVersionInfo GetPackageVersionInfo(PackageVersionId versionKey);
/// Gets a value indicating whether an available version is newer than the installed version.
Boolean IsUpdateAvailable { get; };
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)]
{
/// Check the installed status of the package. For more accurate and complete installed status, it's required to
/// call this method from a composite package from a newly created package catalog with installed info.
/// This may require downloading information from a server.
Windows.Foundation.IAsyncOperation<CheckInstalledStatusResult> CheckInstalledStatusAsync(InstalledStatusType checkTypes);
CheckInstalledStatusResult CheckInstalledStatus(InstalledStatusType checkTypes);
Windows.Foundation.IAsyncOperation<CheckInstalledStatusResult> CheckInstalledStatusAsync();
CheckInstalledStatusResult CheckInstalledStatus();
}
/// DESIGN NOTE:
/// IsSame from IPackage in winget/RepositorySearch is not implemented in V1.
/// Determines if the given IPackage refers to the same package as this one.
/// virtual bool IsSame(const IPackage*) const = 0;
}
/// IMPLEMENTATION NOTE: CompositeSearchBehavior from winget/RepositorySource.h
/// Search behavior for composite catalogs.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum CompositeSearchBehavior
{
/// Search local catalogs only
LocalCatalogs,
/// Search remote catalogs only, don't check local catalogs for InstalledVersion
RemotePackagesFromRemoteCatalogs,
/// Search remote catalogs, and check local catalogs for InstalledVersion
RemotePackagesFromAllCatalogs,
/// Search both local and remote catalogs.
AllCatalogs,
};
/// IMPLEMENTATION NOTE: PackageFieldMatchOption from winget/RepositorySearch.h
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum PackageFieldMatchOption
{
Equals,
EqualsCaseInsensitive,
StartsWithCaseInsensitive,
ContainsCaseInsensitive,
};
/// IMPLEMENTATION NOTE: PackageFieldMatchOption from winget/RepositorySearch.h
/// The field to match on.
/// The values must be declared in order of preference in search results.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum PackageMatchField
{
CatalogDefault,
Id,
Name,
Moniker,
Command,
Tag,
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 3)]
{
PackageFamilyName,
ProductCode,
}
/// DESIGN NOTE: The following PackageFieldMatchOption from winget/RepositorySearch.h are not implemented in V1.
/// NormalizedNameAndPublisher,
};
/// IMPLEMENTATION NOTE: PackageMatchFilter from winget/RepositorySearch.h
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass PackageMatchFilter
{
PackageMatchFilter();
/// The type of string comparison for matching
PackageFieldMatchOption Option;
/// The field to search
PackageMatchField Field;
/// The value to match
String Value;
/// DESIGN NOTE: "Additional" from RequestMatch winget/RepositorySearch.h is not implemented here.
}
/// IMPLEMENTATION NOTE: MatchResult from winget/RepositorySearch.h
/// A single result from the search.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass MatchResult
{
/// The package found by the search request.
CatalogPackage CatalogPackage { get; };
/// The highest order field on which the package matched the search.
PackageMatchFilter MatchCriteria { get; };
}
/// Status of the FindPackages call
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum FindPackagesResultStatus
{
Ok,
BlockedByPolicy,
CatalogError,
InternalError,
InvalidOptions,
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)]
{
AuthenticationError,
AccessDenied,
}
};
/// IMPLEMENTATION NOTE: SearchResult from winget/RepositorySearch.h
/// Search result data returned from FindPackages
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass FindPackagesResult
{
/// Error codes
FindPackagesResultStatus Status{ get; };
/// The full set of results from the search.
Windows.Foundation.Collections.IVectorView<MatchResult> Matches { get; };
/// If true, the results were truncated by the given ResultLimit
/// USAGE NOTE: Windows Package Manager does not support result pagination, there is no way to continue
/// getting more results.
Boolean WasLimitExceeded { get; };
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)]
{
/// The error code of the operation.
HRESULT ExtendedErrorCode{ get; };
}
}
/// Options for FindPackages
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass FindPackagesOptions
{
FindPackagesOptions();
/// DESIGN NOTE:
/// This class maps to SearchRequest from winget/RepositorySearch.h
/// That class is a container for data used to filter the available manifests in an package catalog.
/// Its properties can be thought of as:
/// (Query || Inclusions...) && Filters...
/// If Query and Inclusions are both empty, the starting data set will be the entire database.
/// Everything && Filters...
/// That has been translated in this api so that
/// Inclusions are Selectors below
/// Filters are Filters below
/// Query is PackageFieldMatchOption::PackageCatalogDefined and in the Selector list.
/// USAGE NOTE: Only one selector with PackageFieldMatchOption::PackageCatalogDefined is allowed.
/// Selectors = you have to match at least one selector (if there are no selectors, then nothing is selected)
Windows.Foundation.Collections.IVector<PackageMatchFilter> Selectors { get; };
/// Filters = you have to match all filters(if there are no filters, then there is no filtering of selected items)
Windows.Foundation.Collections.IVector<PackageMatchFilter> Filters{ get; };
/// Restricts the length of the returned results to the specified count.
UInt32 ResultLimit;
}
/// IMPLEMENTATION NOTE: Source from winget/RepositorySource.h
/// A catalog for searching for packages
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass PackageCatalog
{
/// Gets a value indicating whether this package catalog is a composite of other package catalogs,
/// and thus the packages may come from disparate package catalogs as well.
Boolean IsComposite { get; };
/// The details of the package catalog if it is not a composite.
PackageCatalogInfo Info { get; };
/// Searches for Packages in the catalog.
Windows.Foundation.IAsyncOperation<FindPackagesResult> FindPackagesAsync(FindPackagesOptions options);
FindPackagesResult FindPackages(FindPackagesOptions options);
}
/// Authentication mode
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)]
enum AuthenticationMode
{
/// Always use interactive authentication flow on first authentication request, following requests may use cached result.
Interactive,
/// Try silent authentication flow first. If failed, use interactive authentication flow.
SilentPreferred,
/// Only use silent authentication flow. If failed, fail the authentication.
Silent,
};
/// Authentication related arguments
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)]
runtimeclass AuthenticationArguments
{
AuthenticationArguments();
/// Choice of authentication flow behavior.
AuthenticationMode AuthenticationMode;
/// Optional. The authentication account to be used for authentication.
String AuthenticationAccount;
}
/// Authentication method
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)]
enum AuthenticationType
{
Unknown,
None,
MicrosoftEntraId,
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)]
{
MicrosoftEntraIdForAzureBlobStorage,
}
};
/// Microsoft Entra Id related authentication info.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)]
runtimeclass MicrosoftEntraIdAuthenticationInfo
{
/// The resource identifier or resource uri.
String Resource { get; };
/// Requested scope. May be empty.
String Scope { get; };
}
/// Authentication info.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)]
runtimeclass AuthenticationInfo
{
/// The authentication type.
AuthenticationType AuthenticationType { get; };
/// Microsoft Entra Id related authentication info.
MicrosoftEntraIdAuthenticationInfo MicrosoftEntraIdAuthenticationInfo { get; };
}
/// Status of the Connect call
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum ConnectResultStatus
{
Ok,
CatalogError,
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)]
{
SourceAgreementsNotAccepted,
}
};
/// Result of the Connect call
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass ConnectResult
{
/// Error codes
ConnectResultStatus Status { get; };
PackageCatalog PackageCatalog { get; };
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 11)]
{
/// The error code of the operation.
HRESULT ExtendedErrorCode{ get; };
}
}
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)]
enum RefreshPackageCatalogStatus
{
Ok,
GroupPolicyError,
CatalogError,
InternalError,
};
/// IMPLEMENTATION NOTE: RefreshPackageCatalogResult
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)]
runtimeclass RefreshPackageCatalogResult
{
RefreshPackageCatalogStatus Status { get; };
/// Error codes
HRESULT ExtendedErrorCode { get; };
};
/// A reference to a catalog that callers can try to Connect.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass PackageCatalogReference
{
/// Gets a value indicating whether this package catalog is a composite of other package catalogs,
/// and thus the packages may come from disparate package catalogs as well.
Boolean IsComposite { get; };
/// The details of the package catalog if it is not a composite.
PackageCatalogInfo Info { get; };
/// Opens a catalog. Required before searching. For remote catalogs (i.e. not Installed and Installing) this
/// may require downloading information from a server.
Windows.Foundation.IAsyncOperation<ConnectResult> ConnectAsync();
ConnectResult Connect();
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 2)]
{
/// A string that will be passed to the source server if using a REST source
String AdditionalPackageCatalogArguments;
}
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 6)]
{
/// Gets the required agreements for connecting to the package catalog (source).
Windows.Foundation.Collections.IVectorView<SourceAgreement> SourceAgreements { get; };
Boolean AcceptSourceAgreements;
}
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 8)]
{
/// Time interval for package catalog to check for an update. Setting to zero will disable the check for update.
Windows.Foundation.TimeSpan PackageCatalogBackgroundUpdateInterval;
}
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 9)]
{
/// When set to true, the opened catalog will only provide the information regarding packages installed from this catalog.
/// In this mode, no external resources should be required.
Boolean InstalledPackageInformationOnly;
}
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 10)]
{
/// Authentication arguments used in authentication flow during package catalog operations if applicable.
/// This is user or caller input.
AuthenticationArguments AuthenticationArguments;
/// Authentication info from the package catalog.
/// This is defined by individual package catalog.
AuthenticationInfo AuthenticationInfo { get; };
}
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 12)]
{
/// Updates the package catalog.
/// The progress value, represented as a double, indicates the percentage of update package catalog operation completion.
/// The progress range is from 0 to 100.
Windows.Foundation.IAsyncOperationWithProgress<RefreshPackageCatalogResult, Double> RefreshPackageCatalogAsync();
}
}
/// Catalogs with PackageCatalogOrigin Predefined
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum PredefinedPackageCatalog
{
OpenWindowsCatalog,
MicrosoftStore,
DesktopFrameworks,
};
/// Local Catalogs with PackageCatalogOrigin Predefined
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum LocalPackageCatalog
{
InstalledPackages,
InstallingPackages
};
/// Options for creating a composite catalog.
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
runtimeclass CreateCompositePackageCatalogOptions
{
CreateCompositePackageCatalogOptions();
/// Create a composite catalog to allow searching a user defined or pre defined source
/// and a local source (Installed packages) together
IVector<PackageCatalogReference> Catalogs { get; };
/// Sets the default search behavior if the catalog is a composite catalog.
CompositeSearchBehavior CompositeSearchBehavior;
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 5)]
{
/// Create installed package catalog with required installed scope.
PackageInstallScope InstalledScope;
}
}
/// Required install scope for the package. If the package does not have an installer that
/// supports the specified scope the Install call will fail with InstallResultStatus.NoApplicableInstallers
[contract(Microsoft.Management.Deployment.WindowsPackageManagerContract, 1)]
enum PackageInstallScope
{
/// An installer with any install scope is valid.
Any,