diff --git a/src/WingetCreateCLI/WingetCreateCLI.csproj b/src/WingetCreateCLI/WingetCreateCLI.csproj index c43df76f..c2ab1d36 100644 --- a/src/WingetCreateCLI/WingetCreateCLI.csproj +++ b/src/WingetCreateCLI/WingetCreateCLI.csproj @@ -5,7 +5,7 @@ net8.0-windows10.0.22000.0 WingetCreateCLI Microsoft.WingetCreateCLI - 1.10 + 1.12 x64;x86 win-x64;win-x86 true diff --git a/src/WingetCreateCore/Models/DefaultLocaleManifestModels.cs b/src/WingetCreateCore/Models/DefaultLocaleManifestModels.cs index 182fa6f0..71a33484 100644 --- a/src/WingetCreateCore/Models/DefaultLocaleManifestModels.cs +++ b/src/WingetCreateCore/Models/DefaultLocaleManifestModels.cs @@ -133,7 +133,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } /// - /// A representation of a multiple-file manifest representing a default app metadata in the OWC. v1.10.0 + /// A representation of a multiple-file manifest representing a default app metadata in the OWC. v1.12.0 /// [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "11.0.0.0 (Newtonsoft.Json v13.0.0.0)")] public partial class DefaultLocaleManifest @@ -335,7 +335,7 @@ public partial class DefaultLocaleManifest [Newtonsoft.Json.JsonProperty("ManifestVersion", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [System.ComponentModel.DataAnnotations.RegularExpression(@"^(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}$")] - public string ManifestVersion { get; set; } = "1.10.0"; + public string ManifestVersion { get; set; } = "1.12.0"; diff --git a/src/WingetCreateCore/Models/InstallerManifestModels.cs b/src/WingetCreateCore/Models/InstallerManifestModels.cs index 03aaa420..c5229c24 100644 --- a/src/WingetCreateCore/Models/InstallerManifestModels.cs +++ b/src/WingetCreateCore/Models/InstallerManifestModels.cs @@ -60,6 +60,10 @@ public enum InstallerType Portable = 10, + [System.Runtime.Serialization.EnumMember(Value = @"font")] + Font = 11, + + } /// @@ -105,6 +109,10 @@ public enum NestedInstallerType Portable = 8, + [System.Runtime.Serialization.EnumMember(Value = @"font")] + Font = 9, + + } /// @@ -644,7 +652,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } /// - /// A representation of a single-file manifest representing an app installers in the OWC. v1.10.0 + /// A representation of a single-file manifest representing an app installers in the OWC. v1.12.0 /// [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "11.0.0.0 (Newtonsoft.Json v13.0.0.0)")] public partial class InstallerManifest @@ -813,7 +821,7 @@ public partial class InstallerManifest [Newtonsoft.Json.JsonProperty("ManifestVersion", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [System.ComponentModel.DataAnnotations.RegularExpression(@"^(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}$")] - public string ManifestVersion { get; set; } = "1.10.0"; + public string ManifestVersion { get; set; } = "1.12.0"; diff --git a/src/WingetCreateCore/Models/LocaleManifestModels.cs b/src/WingetCreateCore/Models/LocaleManifestModels.cs index c7fd7dde..35f9ceeb 100644 --- a/src/WingetCreateCore/Models/LocaleManifestModels.cs +++ b/src/WingetCreateCore/Models/LocaleManifestModels.cs @@ -133,7 +133,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } /// - /// A representation of a multiple-file manifest representing app metadata in other locale in the OWC. v1.10.0 + /// A representation of a multiple-file manifest representing app metadata in other locale in the OWC. v1.12.0 /// [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "11.0.0.0 (Newtonsoft.Json v13.0.0.0)")] public partial class LocaleManifest @@ -324,7 +324,7 @@ public partial class LocaleManifest [Newtonsoft.Json.JsonProperty("ManifestVersion", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [System.ComponentModel.DataAnnotations.RegularExpression(@"^(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}$")] - public string ManifestVersion { get; set; } = "1.10.0"; + public string ManifestVersion { get; set; } = "1.12.0"; diff --git a/src/WingetCreateCore/Models/SingletonManifestModels.cs b/src/WingetCreateCore/Models/SingletonManifestModels.cs index 1b6ee467..4317e924 100644 --- a/src/WingetCreateCore/Models/SingletonManifestModels.cs +++ b/src/WingetCreateCore/Models/SingletonManifestModels.cs @@ -183,6 +183,10 @@ public enum InstallerType Portable = 10, + [System.Runtime.Serialization.EnumMember(Value = @"font")] + Font = 11, + + } /// @@ -228,6 +232,10 @@ public enum NestedInstallerType Portable = 8, + [System.Runtime.Serialization.EnumMember(Value = @"font")] + Font = 9, + + } /// @@ -767,7 +775,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } /// - /// A representation of a single-file manifest representing an app in the OWC. v1.10.0 + /// A representation of a single-file manifest representing an app in the OWC. v1.12.0 /// [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "11.0.0.0 (Newtonsoft.Json v13.0.0.0)")] public partial class SingletonManifest @@ -1098,7 +1106,7 @@ public partial class SingletonManifest [Newtonsoft.Json.JsonProperty("ManifestVersion", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [System.ComponentModel.DataAnnotations.RegularExpression(@"^(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}$")] - public string ManifestVersion { get; set; } = "1.10.0"; + public string ManifestVersion { get; set; } = "1.12.0"; diff --git a/src/WingetCreateCore/Models/VersionManifestModels.cs b/src/WingetCreateCore/Models/VersionManifestModels.cs index 4a4ea057..f0b8bf64 100644 --- a/src/WingetCreateCore/Models/VersionManifestModels.cs +++ b/src/WingetCreateCore/Models/VersionManifestModels.cs @@ -10,7 +10,7 @@ namespace Microsoft.WingetCreateCore.Models.Version #pragma warning disable // Disable all warnings /// - /// A representation of a multi-file manifest representing an app version in the OWC. v1.10.0 + /// A representation of a multi-file manifest representing an app version in the OWC. v1.12.0 /// [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "11.0.0.0 (Newtonsoft.Json v13.0.0.0)")] public partial class VersionManifest @@ -55,7 +55,7 @@ public partial class VersionManifest [Newtonsoft.Json.JsonProperty("ManifestVersion", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] [System.ComponentModel.DataAnnotations.RegularExpression(@"^(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}$")] - public string ManifestVersion { get; set; } = "1.10.0"; + public string ManifestVersion { get; set; } = "1.12.0"; diff --git a/src/WingetCreateCore/WingetCreateCore.csproj b/src/WingetCreateCore/WingetCreateCore.csproj index 511ec1dc..86b3f2f3 100644 --- a/src/WingetCreateCore/WingetCreateCore.csproj +++ b/src/WingetCreateCore/WingetCreateCore.csproj @@ -19,7 +19,7 @@ - + @@ -48,11 +48,11 @@ - - - - - + + + + + diff --git a/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.FullJsonSingleton1_12.json b/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.FullJsonSingleton1_12.json new file mode 100644 index 00000000..cac5c561 --- /dev/null +++ b/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.FullJsonSingleton1_12.json @@ -0,0 +1,157 @@ +{ + "PackageIdentifier": "TestPublisher.FullYamlSingleton1_12", + "PackageVersion": "0.1.2.3", + "PackageLocale": "en-US", + "DefaultLocale": "en-US", + "Publisher": "TestPublisher", + "PublisherUrl": "https://fakeTestUrl.com", + "PublisherSupportUrl": "https://fakeTestUrl.com", + "PrivacyUrl": "https://fakeTestUrl.com", + "Author": "fakeAuthor", + "PackageName": "Full Singleton 1.12 Test", + "PackageUrl": "https://fakeTestUrl.com", + "License": "MIT", + "LicenseUrl": "https://fakeTestUrl.com", + "Copyright": "fakeCopyright", + "CopyrightUrl": "https://fakeTestUrl.com", + "ShortDescription": "A manifest used to verify that all fields from a full 1.12 singleton manifest can be deserialized and updated.", + "Description": "A manifest used to verify that all fields from a full 1.12 singleton manifest can be deserialized and updated.", + "Moniker": "testMoniker", + "Tags": [ + "testSingleton" + ], + "Agreements": [ + { + "AgreementLabel": "fakeAgreementLabel", + "AgreementUrl": "https://fakeTestUrl.com", + "Agreement": "fakeAgreementContent" + } + ], + "ReleaseNotes": "fakeReleaseNotes", + "ReleaseNotesUrl": "https://fakeTestUrl.com", + "PurchaseUrl": "https://fakeTestUrl.com", + "InstallationNotes": "fakeInstallationNotes", + "Documentations": [ + { + "DocumentLabel": "fakeDocumentLabel" + }, + { + "DocumentUrl": "fakeDocumentUrl" + } + ], + "Icons": [ + { + "IconUrl": "https://fakeTestIcon", + "IconFileType": "png", + "IconResolution": "32x32", + "IconTheme": "light", + "IconSha256": "69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8321" + } + ], + "Installers": [ + { + "MinimumOSVersion": "10.0.0.0", + "Architecture": "x64", + "InstallerUrl": "https://fakedomain.com/WingetCreateTestExeInstaller.exe", + "InstallerType": "exe", + "InstallerSha256": "A7803233EEDB6A4B59B3024CCF9292A6FFFB94507DC998AA67C5B745D197A5DC", + "ProductCode": "FakeProductCode", + "PackageFamilyName": "FakePackageFamilyName", + "InstallModes": [ + "silent" + ], + "InstallerSwitches": { + "Silent": "/s", + "Upgrade": "/u", + "Repair": "/r" + }, + "InstallerSuccessCodes": [ + 1 + ], + "ExpectedReturnCodes": [ + { + "InstallerReturnCode": 123, + "ReturnResponse": "alreadyInstalled", + "ReturnResponseUrl": "https://fakeTestUrl.com" + } + ], + "UpgradeBehavior": "install", + "Commands": [ + "fakeCommand" + ], + "Protocols": [ + "fakeProtocol" + ], + "FileExtensions": [ + ".exe" + ], + "Dependencies": { + "WindowsFeatures": [ + "fakeValue" + ], + "WindowsLibraries": [ + "fakeValue" + ], + "PackageDependencies": [ + { + "MinimumVersion": "10.0.0.0" + } + ], + "ExternalDependencies": [ + "fakeValue" + ] + }, + "Markets": { + "AllowedMarkets": [ + "fakeAllowedMarket" + ], + "ExcludedMarkets": [ + "fakeExcludedMarket" + ] + }, + "InstallerAbortsTerminal": true, + "InstallLocationRequired": true, + "RequireExplicitUpgrade": true, + "UnsupportedOSArchitectures": [ + "arm64" + ], + "AppsAndFeaturesEntries": [ + { + "DisplayName": "testName", + "Publisher": "testPublisher", + "DisplayVersion": "testVersion", + "UpgradeCode": "fakeProductCode" + } + ], + "ElevationRequirement": "elevationRequired", + "ReleaseDate": "2022-01-01", + "DisplayInstallWarnings": true, + "UnsupportedArguments": [ + "log", + "location" + ], + "NestedInstallerFiles": [ + { + "RelativeFilePath": "RelativeFilePath", + "PortableCommandAlias": "PortableCommandAlias" + } + ], + "InstallationMetadata": { + "DefaultInstallLocation": "%ProgramFiles%\\TestApp", + "Files": [ + { + "RelativeFilePath": "main.exe", + "FileSha256": "69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82", + "FileType": "launch", + "InvocationParameter": "/arg" + } + ] + }, + "DownloadCommandProhibited": true, + "RepairBehavior": "modify", + "ArchiveBinariesDependOnPath": true + } + ], + "ManifestType": "singleton", + "ManifestVersion": "1.12.0" +} \ No newline at end of file diff --git a/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.FullYamlSingleton1_12.yaml b/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.FullYamlSingleton1_12.yaml new file mode 100644 index 00000000..0140f803 --- /dev/null +++ b/src/WingetCreateTests/WingetCreateTests/Resources/TestPublisher.FullYamlSingleton1_12.yaml @@ -0,0 +1,116 @@ +PackageIdentifier: TestPublisher.FullYamlSingleton1_12 +PackageVersion: 0.1.2.3 +PackageLocale: en-US +DefaultLocale: en-US +Publisher: TestPublisher +PublisherUrl: https://fakeTestUrl.com +PublisherSupportUrl: https://fakeTestUrl.com +PrivacyUrl: https://fakeTestUrl.com +Author: fakeAuthor +PackageName: Full Singleton 1.12 Test +PackageUrl: https://fakeTestUrl.com +License: MIT +LicenseUrl: https://fakeTestUrl.com +Copyright: fakeCopyright +CopyrightUrl: https://fakeTestUrl.com +ShortDescription: A manifest used to verify that all fields from a full 1.12 singleton manifest can be deserialized and updated. +Description: A manifest used to verify that all fields from a full 1.12 singleton manifest can be deserialized and updated. +Moniker: testMoniker +Tags: +- testSingleton +Agreements: +- AgreementLabel: fakeAgreementLabel + AgreementUrl: https://fakeTestUrl.com + Agreement: fakeAgreementContent +ReleaseNotes: fakeReleaseNotes +ReleaseNotesUrl: https://fakeTestUrl.com +PurchaseUrl: https://fakeTestUrl.com +InstallationNotes: fakeInstallationNotes +Documentations: +- DocumentLabel: fakeDocumentLabel +- DocumentUrl: fakeDocumentUrl +Icons: + - IconUrl: https://fakeTestIcon + IconFileType: png + IconResolution: 32x32 + IconTheme: light + IconSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8321 +Installers: +- MinimumOSVersion: 10.0.0.0 + Architecture: x64 + InstallerUrl: https://fakedomain.com/WingetCreateTestExeInstaller.exe + InstallerType: exe + InstallerSha256: A7803233EEDB6A4B59B3024CCF9292A6FFFB94507DC998AA67C5B745D197A5DC + ProductCode: FakeProductCode + PackageFamilyName: FakePackageFamilyName + InstallModes: + - silent + InstallerSwitches: + Silent: /s + Upgrade: /u + Repair: /r + InstallerSuccessCodes: + - 1 + ExpectedReturnCodes: + - InstallerReturnCode: 123 + ReturnResponse: alreadyInstalled + ReturnResponseUrl: https://fakeTestUrl.com + UpgradeBehavior: install + Commands: + - fakeCommand + Protocols: + - fakeProtocol + FileExtensions: + - .exe + Dependencies: + WindowsFeatures: + - fakeValue + WindowsLibraries: + - fakeValue + PackageDependencies: + - MinimumVersion: 10.0.0.0 + ExternalDependencies: + - fakeValue + Markets: + AllowedMarkets: + - fakeAllowedMarket + ExcludedMarkets: + - fakeExcludedMarket + InstallerAbortsTerminal: true + InstallLocationRequired: true + RequireExplicitUpgrade: true + UnsupportedOSArchitectures: + - arm64 + AppsAndFeaturesEntries: + - DisplayName: testName + Publisher: testPublisher + DisplayVersion: testVersion + UpgradeCode: fakeProductCode + ElevationRequirement: elevationRequired + ReleaseDate: 1-1-2022 + DisplayInstallWarnings: true + UnsupportedArguments: + - log + - location + NestedInstallerFiles: + - RelativeFilePath: RelativeFilePath + PortableCommandAlias: PortableCommandAlias + InstallationMetadata: + DefaultInstallLocation: "%ProgramFiles%\\TestApp" + Files: + - RelativeFilePath: "main.exe" + FileSha256: 69D84CA8899800A5575CE31798293CD4FEBAB1D734A07C2E51E56A28E0DF8C82 + FileType: launch + InvocationParameter: "/arg" + DownloadCommandProhibited: true + RepairBehavior: modify + ArchiveBinariesDependOnPath: true +# `winget validate` fails if this field is used as it requires verified publisher feature +# Uncomment when verified publisher feature is implemented +# Authentication: +# AuthenticationType: microsoftEntraId +# MicrosoftEntraIdAuthenticationInfo: +# Scope: DefaultScope +# Resource: DefaultResource +ManifestType: singleton +ManifestVersion: 1.12.0 \ No newline at end of file diff --git a/src/WingetCreateTests/WingetCreateTests/UnitTests/UpdateCommandTests.cs b/src/WingetCreateTests/WingetCreateTests/UnitTests/UpdateCommandTests.cs index d7857d8e..528d69ec 100644 --- a/src/WingetCreateTests/WingetCreateTests/UnitTests/UpdateCommandTests.cs +++ b/src/WingetCreateTests/WingetCreateTests/UnitTests/UpdateCommandTests.cs @@ -992,6 +992,19 @@ public async Task UpdateFullYamlSingletonVersion1_10() ClassicAssert.IsNotNull(updatedManifests, "Command should have succeeded"); } + /// + /// Ensures that all fields from the YAML Singleton v1.12 manifest can be deserialized and updated correctly. + /// + /// A representing the result of the asynchronous operation. + [Test] + public async Task UpdateFullYamlSingletonVersion1_12() + { + TestUtils.InitializeMockDownloads(TestConstants.TestZipInstaller, TestConstants.TestExeInstaller); + (UpdateCommand command, var initialManifestContent) = GetUpdateCommandAndManifestData("TestPublisher.FullYamlSingleton1_12", null, this.tempPath, null); + var updatedManifests = await RunUpdateCommand(command, initialManifestContent); + ClassicAssert.IsNotNull(updatedManifests, "Command should have succeeded"); + } + /// /// Ensures that all fields from the JSON Singleton v1.1 manifest can be deserialized and updated correctly. /// @@ -1096,6 +1109,19 @@ public async Task UpdateFullJsonSingletonVersion1_10() ClassicAssert.IsNotNull(updatedManifests, "Command should have succeeded"); } + /// + /// Ensures that all fields from the Singleton JSON v1.12 manifest can be deserialized and updated correctly. + /// + /// A representing the result of the asynchronous operation. + [Test] + public async Task UpdateFullJsonSingletonVersion1_12() + { + TestUtils.InitializeMockDownloads(TestConstants.TestZipInstaller, TestConstants.TestExeInstaller); + (UpdateCommand command, var initialManifestContent) = GetUpdateCommandAndManifestData("TestPublisher.FullJsonSingleton1_12", null, this.tempPath, null, manifestFormat: ManifestFormat.Json); + var updatedManifests = await RunUpdateCommand(command, initialManifestContent); + ClassicAssert.IsNotNull(updatedManifests, "Command should have succeeded"); + } + /// /// Ensures that version specific fields are reset after an update when using YAML manifests. /// @@ -1103,7 +1129,7 @@ public async Task UpdateFullJsonSingletonVersion1_10() [Test] public async Task UpdateResetsVersionSpecificFields_Yaml() { - TestUtils.InitializeMockDownloads(TestConstants.TestExeInstaller); + TestUtils.InitializeMockDownloads(TestConstants.TestZipInstaller, TestConstants.TestExeInstaller); (UpdateCommand command, var initialManifestContent) = GetUpdateCommandAndManifestData("TestPublisher.FullYamlSingleton1_1", null, this.tempPath, null); var updatedManifests = await RunUpdateCommand(command, initialManifestContent); ClassicAssert.IsNotNull(updatedManifests, "Command should have succeeded"); diff --git a/src/WingetCreateTests/WingetCreateTests/WingetCreateTests.csproj b/src/WingetCreateTests/WingetCreateTests/WingetCreateTests.csproj index 107fff59..a075e7b9 100644 --- a/src/WingetCreateTests/WingetCreateTests/WingetCreateTests.csproj +++ b/src/WingetCreateTests/WingetCreateTests/WingetCreateTests.csproj @@ -63,6 +63,12 @@ PreserveNewest + + PreserveNewest + + + PreserveNewest + PreserveNewest