Skip to content

Commit 3f6f7a3

Browse files
authored
Add DSC resource list to manifest (microsoft#5997)
Implements microsoft#3523 ## Change Creates manifest version 1.28.0, adding the DSC resource list to the installer, similar to described in the issue. Is a little deeper and more extensible than the suggested version. As an example, winget's own full list would look like: ```YAML DesiredStateConfiguration: PowerShell: - RepositoryUrl: https://www.powershellgallery.com/api/v2 ModuleName: Microsoft.WinGet.DSC Resources: - Name: WinGetUserSettings - Name: WinGetAdminSettings - Name: WinGetSource - Name: WinGetPackageManager - Name: WinGetPackage - RepositoryUrl: https://mcr.microsoft.com/ ModuleName: Microsoft.WinGet.DSC Resources: - Name: WinGetUserSettings - Name: WinGetAdminSettings - Name: WinGetSource - Name: WinGetPackageManager - Name: WinGetPackage DSCv3: Resources: - Type: Microsoft.WinGet/AdminSettings - Type: Microsoft.WinGet/Package - Type: Microsoft.WinGet/Source - Type: Microsoft.WinGet/UserSettingsFile ``` But `PowerShell` will be blocked from winget-pkgs due to the inherently independent nature of the modules and packages. With a future ownership model we could likely allow them to be listed.
1 parent 8224320 commit 3f6f7a3

29 files changed

Lines changed: 1567 additions & 539 deletions

.github/actions/spelling/allow.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ UNICODESTRING
378378
uninstalling
379379
Unmarshal
380380
unskipped
381+
unstash
381382
untimes
382383
updatefile
383384
updatemanifest

.github/actions/spelling/expect.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ maxvalue
325325
maybenull
326326
MBH
327327
MBs
328+
mcr
328329
mday
329330
mdmp
330331
mdmpto

schemas/JSON/manifests/latest/manifest.defaultLocale.latest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$id": "https://aka.ms/winget-manifest.defaultlocale.1.12.0.schema.json",
2+
"$id": "https://aka.ms/winget-manifest.defaultlocale.1.28.0.schema.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
4-
"description": "A representation of a multiple-file manifest representing a default app metadata in the OWC. v1.12.0",
4+
"description": "A representation of a multiple-file manifest representing a default app metadata in the OWC. v1.28.0",
55
"definitions": {
66
"Url": {
77
"type": [ "string", "null" ],
@@ -261,7 +261,7 @@
261261
},
262262
"ManifestVersion": {
263263
"type": "string",
264-
"default": "1.12.0",
264+
"default": "1.28.0",
265265
"pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){2}$",
266266
"description": "The manifest syntax version"
267267
}

schemas/JSON/manifests/latest/manifest.installer.latest.json

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$id": "https://aka.ms/winget-manifest.installer.1.12.0.schema.json",
2+
"$id": "https://aka.ms/winget-manifest.installer.1.28.0.schema.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
4-
"description": "A representation of a single-file manifest representing an app installers in the OWC. v1.12.0",
4+
"description": "A representation of a single-file manifest representing an app installers in the OWC. v1.28.0",
55
"definitions": {
66
"PackageIdentifier": {
77
"type": "string",
@@ -639,6 +639,78 @@
639639
],
640640
"description": "The authentication requirement for downloading the installer."
641641
},
642+
"DesiredStateConfiguration": {
643+
"type": [ "object", "null" ],
644+
"description": "References to desired state configuration (DSC) resources that are related to the package.",
645+
"properties": {
646+
"PowerShell": {
647+
"type": [ "array", "null" ],
648+
"description": "Contains data about DSC resources that are contained in PowerShell modules.",
649+
"uniqueItems": true,
650+
"maxItems": 16,
651+
"items": {
652+
"type": "object",
653+
"title": "PowerShell DSC Module Item",
654+
"properties": {
655+
"RepositoryUrl": {
656+
"$ref": "#/definitions/Url"
657+
},
658+
"ModuleName": {
659+
"type": "string",
660+
"description": "The name of the module containing resources.",
661+
"$comment": "From nuget package id, although PowerShell convention is slightly more strict: https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1017",
662+
"pattern": "^\\w+([.-]\\w+)*$",
663+
"maxLength": 100
664+
},
665+
"Resources": {
666+
"type": "array",
667+
"description": "The resources contained within the module.",
668+
"maxItems": 64,
669+
"items": {
670+
"type": "object",
671+
"title": "PowerShell DSC Resource Item",
672+
"properties": {
673+
"Name": {
674+
"type": "string",
675+
"description": "The name of the resource.",
676+
"$comment": "Needs to be an identifier in the various languages (MOF, PS class name), could not find any direct description.",
677+
"pattern": "^[A-Za-z][-_A-Za-z0-9]*$",
678+
"maxLength": 100
679+
}
680+
}
681+
}
682+
}
683+
},
684+
"required": [ "RepositoryUrl", "ModuleName", "Resources" ]
685+
}
686+
},
687+
"DSCv3": {
688+
"type": [ "object", "null" ],
689+
"description": "Contains data about DSC resources that are contained in the package using the DSC v3 specification.",
690+
"properties": {
691+
"Resources": {
692+
"type": "array",
693+
"description": "The resources contained within the package.",
694+
"maxItems": 128,
695+
"items": {
696+
"type": "object",
697+
"title": "DSCv3 Resource Item",
698+
"properties": {
699+
"Type": {
700+
"type": "string",
701+
"description": "The name of the resource.",
702+
"$comment": "Pulled from DSCv3 definition; matches `Publisher.Product.Component/ResourceName` where the Product and Component are optional.",
703+
"pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$",
704+
"maxLength": 256
705+
}
706+
}
707+
}
708+
}
709+
},
710+
"required": [ "Resources" ]
711+
}
712+
}
713+
},
642714
"Installer": {
643715
"type": "object",
644716
"properties": {
@@ -765,6 +837,9 @@
765837
},
766838
"Authentication": {
767839
"$ref": "#/definitions/Authentication"
840+
},
841+
"DesiredStateConfiguration": {
842+
"$ref": "#/definitions/DesiredStateConfiguration"
768843
}
769844
},
770845
"required": [
@@ -890,6 +965,9 @@
890965
"Authentication": {
891966
"$ref": "#/definitions/Authentication"
892967
},
968+
"DesiredStateConfiguration": {
969+
"$ref": "#/definitions/DesiredStateConfiguration"
970+
},
893971
"Installers": {
894972
"type": "array",
895973
"items": {
@@ -906,7 +984,7 @@
906984
},
907985
"ManifestVersion": {
908986
"type": "string",
909-
"default": "1.12.0",
987+
"default": "1.28.0",
910988
"pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){2}$",
911989
"description": "The manifest syntax version"
912990
}

schemas/JSON/manifests/latest/manifest.locale.latest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$id": "https://aka.ms/winget-manifest.locale.1.12.0.schema.json",
2+
"$id": "https://aka.ms/winget-manifest.locale.1.28.0.schema.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
4-
"description": "A representation of a multiple-file manifest representing app metadata in other locale in the OWC. v1.12.0",
4+
"description": "A representation of a multiple-file manifest representing app metadata in other locale in the OWC. v1.28.0",
55
"definitions": {
66
"Url": {
77
"type": [ "string", "null" ],
@@ -256,7 +256,7 @@
256256
},
257257
"ManifestVersion": {
258258
"type": "string",
259-
"default": "1.12.0",
259+
"default": "1.28.0",
260260
"pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){2}$",
261261
"description": "The manifest syntax version"
262262
}

schemas/JSON/manifests/latest/manifest.singleton.latest.json

Lines changed: 81 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$id": "https://aka.ms/winget-manifest.singleton.1.12.0.schema.json",
2+
"$id": "https://aka.ms/winget-manifest.singleton.1.28.0.schema.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
4-
"description": "A representation of a single-file manifest representing an app in the OWC. v1.12.0",
4+
"description": "A representation of a single-file manifest representing an app in the OWC. v1.28.0",
55
"definitions": {
66
"PackageIdentifier": {
77
"type": "string",
@@ -740,6 +740,78 @@
740740
],
741741
"description": "The authentication requirement for downloading the installer."
742742
},
743+
"DesiredStateConfiguration": {
744+
"type": [ "object", "null" ],
745+
"description": "References to desired state configuration (DSC) resources that are related to the package.",
746+
"properties": {
747+
"PowerShell": {
748+
"type": [ "array", "null" ],
749+
"description": "Contains data about DSC resources that are contained in PowerShell modules.",
750+
"uniqueItems": true,
751+
"maxItems": 16,
752+
"items": {
753+
"type": "object",
754+
"title": "PowerShell DSC Module Item",
755+
"properties": {
756+
"RepositoryUrl": {
757+
"$ref": "#/definitions/Url"
758+
},
759+
"ModuleName": {
760+
"type": "string",
761+
"description": "The name of the module containing resources.",
762+
"$comment": "From nuget package id, although PowerShell convention is slightly more strict: https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1017",
763+
"pattern": "^\\w+([.-]\\w+)*$",
764+
"maxLength": 100
765+
},
766+
"Resources": {
767+
"type": "array",
768+
"description": "The resources contained within the module.",
769+
"maxItems": 64,
770+
"items": {
771+
"type": "object",
772+
"title": "PowerShell DSC Resource Item",
773+
"properties": {
774+
"Name": {
775+
"type": "string",
776+
"description": "The name of the resource.",
777+
"$comment": "Needs to be an identifier in the various languages (MOF, PS class name), could not find any direct description.",
778+
"pattern": "^[A-Za-z][-_A-Za-z0-9]*$",
779+
"maxLength": 100
780+
}
781+
}
782+
}
783+
}
784+
},
785+
"required": [ "RepositoryUrl", "ModuleName", "Resources" ]
786+
}
787+
},
788+
"DSCv3": {
789+
"type": [ "object", "null" ],
790+
"description": "Contains data about DSC resources that are contained in the package using the DSC v3 specification.",
791+
"properties": {
792+
"Resources": {
793+
"type": "array",
794+
"description": "The resources contained within the package.",
795+
"maxItems": 128,
796+
"items": {
797+
"type": "object",
798+
"title": "DSCv3 Resource Item",
799+
"properties": {
800+
"Type": {
801+
"type": "string",
802+
"description": "The name of the resource.",
803+
"$comment": "Pulled from DSCv3 definition; matches `Publisher.Product.Component/ResourceName` where the Product and Component are optional.",
804+
"pattern": "^\\w+(\\.\\w+){0,2}\\/\\w+$",
805+
"maxLength": 256
806+
}
807+
}
808+
}
809+
}
810+
},
811+
"required": [ "Resources" ]
812+
}
813+
}
814+
},
743815
"Installer": {
744816
"type": "object",
745817
"properties": {
@@ -866,6 +938,9 @@
866938
},
867939
"Authentication": {
868940
"$ref": "#/definitions/Authentication"
941+
},
942+
"DesiredStateConfiguration": {
943+
"$ref": "#/definitions/DesiredStateConfiguration"
869944
}
870945
},
871946
"required": [
@@ -1114,6 +1189,9 @@
11141189
"Authentication": {
11151190
"$ref": "#/definitions/Authentication"
11161191
},
1192+
"DesiredStateConfiguration": {
1193+
"$ref": "#/definitions/DesiredStateConfiguration"
1194+
},
11171195
"Installers": {
11181196
"type": "array",
11191197
"items": {
@@ -1130,7 +1208,7 @@
11301208
},
11311209
"ManifestVersion": {
11321210
"type": "string",
1133-
"default": "1.12.0",
1211+
"default": "1.28.0",
11341212
"pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){2}$",
11351213
"description": "The manifest syntax version"
11361214
}

schemas/JSON/manifests/latest/manifest.version.latest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"$id": "https://aka.ms/winget-manifest.version.1.12.0.schema.json",
2+
"$id": "https://aka.ms/winget-manifest.version.1.28.0.schema.json",
33
"$schema": "http://json-schema.org/draft-07/schema#",
4-
"description": "A representation of a multi-file manifest representing an app version in the OWC. v1.12.0",
4+
"description": "A representation of a multi-file manifest representing an app version in the OWC. v1.28.0",
55
"type": "object",
66
"properties": {
77
"PackageIdentifier": {
@@ -31,7 +31,7 @@
3131
},
3232
"ManifestVersion": {
3333
"type": "string",
34-
"default": "1.12.0",
34+
"default": "1.28.0",
3535
"pattern": "^(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])(\\.(0|[1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])){2}$",
3636
"description": "The manifest syntax version"
3737
}

src/AppInstallerCLITests/AppInstallerCLITests.vcxproj

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,24 @@
10551055
<CopyFileToFolders Include="TestData\Manifest-MSIX-in-Archive.yaml">
10561056
<DeploymentContent>true</DeploymentContent>
10571057
</CopyFileToFolders>
1058+
<CopyFileToFolders Include="TestData\ManifestV1_28-Singleton.yaml">
1059+
<DeploymentContent>true</DeploymentContent>
1060+
</CopyFileToFolders>
1061+
<CopyFileToFolders Include="TestData\MultiFileManifestV1_28\ManifestV1_28-MultiFile-DefaultLocale.yaml">
1062+
<DeploymentContent>true</DeploymentContent>
1063+
</CopyFileToFolders>
1064+
<CopyFileToFolders Include="TestData\MultiFileManifestV1_28\ManifestV1_28-MultiFile-Installer.yaml">
1065+
<DeploymentContent>true</DeploymentContent>
1066+
</CopyFileToFolders>
1067+
<CopyFileToFolders Include="TestData\MultiFileManifestV1_28\ManifestV1_28-MultiFile-Locale.yaml">
1068+
<DeploymentContent>true</DeploymentContent>
1069+
</CopyFileToFolders>
1070+
<CopyFileToFolders Include="TestData\MultiFileManifestV1_28\ManifestV1_28-MultiFile-Version.yaml">
1071+
<DeploymentContent>true</DeploymentContent>
1072+
</CopyFileToFolders>
1073+
<CopyFileToFolders Include="TestData\ManifestV1_28-PowerShellDSC.yaml">
1074+
<DeploymentContent>true</DeploymentContent>
1075+
</CopyFileToFolders>
10581076
</ItemGroup>
10591077
<ItemGroup>
10601078
<ProjectReference Include="..\AppInstallerCLICore\AppInstallerCLICore.vcxproj">

src/AppInstallerCLITests/AppInstallerCLITests.vcxproj.filters

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@
6161
<Filter Include="TestData\Shadow\V1_5">
6262
<UniqueIdentifier>{6bd68492-3f96-4023-af35-63249cd18158}</UniqueIdentifier>
6363
</Filter>
64+
<Filter Include="TestData\MultiFileManifestV1_28">
65+
<UniqueIdentifier>{0e5f9ff4-6f22-46eb-8538-1c560a008f06}</UniqueIdentifier>
66+
</Filter>
6467
</ItemGroup>
6568
<ItemGroup>
6669
<ClInclude Include="pch.h">
@@ -1113,5 +1116,29 @@
11131116
<CopyFileToFolders Include="TestData\TestFont.ttf">
11141117
<Filter>TestData</Filter>
11151118
</CopyFileToFolders>
1119+
<CopyFileToFolders Include="TestData\MultiFileManifestV1_28\ManifestV1_28-MultiFile-DefaultLocale.yaml">
1120+
<Filter>TestData\MultiFileManifestV1_28</Filter>
1121+
</CopyFileToFolders>
1122+
<CopyFileToFolders Include="TestData\MultiFileManifestV1_28\ManifestV1_28-MultiFile-Installer.yaml">
1123+
<Filter>TestData\MultiFileManifestV1_28</Filter>
1124+
</CopyFileToFolders>
1125+
<CopyFileToFolders Include="TestData\MultiFileManifestV1_28\ManifestV1_28-MultiFile-Locale.yaml">
1126+
<Filter>TestData\MultiFileManifestV1_28</Filter>
1127+
</CopyFileToFolders>
1128+
<CopyFileToFolders Include="TestData\MultiFileManifestV1_28\ManifestV1_28-MultiFile-Version.yaml">
1129+
<Filter>TestData\MultiFileManifestV1_28</Filter>
1130+
</CopyFileToFolders>
1131+
<CopyFileToFolders Include="TestData\Manifest-MSIX-in-AppsAndFeatures.yaml">
1132+
<Filter>TestData</Filter>
1133+
</CopyFileToFolders>
1134+
<CopyFileToFolders Include="TestData\Manifest-MSIX-in-Archive.yaml">
1135+
<Filter>TestData</Filter>
1136+
</CopyFileToFolders>
1137+
<CopyFileToFolders Include="TestData\ManifestV1_28-PowerShellDSC.yaml">
1138+
<Filter>TestData</Filter>
1139+
</CopyFileToFolders>
1140+
<CopyFileToFolders Include="TestData\ManifestV1_28-Singleton.yaml">
1141+
<Filter>TestData</Filter>
1142+
</CopyFileToFolders>
11161143
</ItemGroup>
11171144
</Project>

0 commit comments

Comments
 (0)