From 0054c6287ef360d734493e841b7516ca37ca2aec Mon Sep 17 00:00:00 2001 From: Ryan <69221034+ryfu-msft@users.noreply.github.com> Date: Mon, 13 Nov 2023 16:41:18 -0800 Subject: [PATCH] Add support for 1.6 schema (#477) --- .../Properties/Resources.Designer.cs | 9 +++++++++ src/WingetCreateCLI/Properties/Resources.resx | 3 +++ .../Models/DefaultLocaleManifestModels.cs | 4 ++-- .../Models/InstallerManifestModels.cs | 13 +++++++++++-- src/WingetCreateCore/Models/LocaleManifestModels.cs | 4 ++-- .../Models/SingletonManifestModels.cs | 13 +++++++++++-- .../Models/VersionManifestModels.cs | 4 ++-- src/WingetCreateCore/WingetCreateCore.csproj | 12 ++++++------ 8 files changed, 46 insertions(+), 16 deletions(-) diff --git a/src/WingetCreateCLI/Properties/Resources.Designer.cs b/src/WingetCreateCLI/Properties/Resources.Designer.cs index 4fed488c..68831f97 100644 --- a/src/WingetCreateCLI/Properties/Resources.Designer.cs +++ b/src/WingetCreateCLI/Properties/Resources.Designer.cs @@ -609,6 +609,15 @@ public static string DoneSymbol_String { } } + /// + /// Looks up a localized string similar to Indicates whether the installer is prohibited from being downloaded for offline installation. + /// + public static string DownloadCommandProhibited_KeywordDescription { + get { + return ResourceManager.GetString("DownloadCommandProhibited_KeywordDescription", resourceCulture); + } + } + /// /// Looks up a localized string similar to Unable to complete the download request as the connection has timed out. Please verify your installer URL and try again.. /// diff --git a/src/WingetCreateCLI/Properties/Resources.resx b/src/WingetCreateCLI/Properties/Resources.resx index 5548ba0e..68c9e23d 100644 --- a/src/WingetCreateCLI/Properties/Resources.resx +++ b/src/WingetCreateCLI/Properties/Resources.resx @@ -1234,4 +1234,7 @@ The following commands are available: + + Indicates whether the installer is prohibited from being downloaded for offline installation + \ No newline at end of file diff --git a/src/WingetCreateCore/Models/DefaultLocaleManifestModels.cs b/src/WingetCreateCore/Models/DefaultLocaleManifestModels.cs index affe0cd2..9d462683 100644 --- a/src/WingetCreateCore/Models/DefaultLocaleManifestModels.cs +++ b/src/WingetCreateCore/Models/DefaultLocaleManifestModels.cs @@ -107,7 +107,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - /// A representation of a multiple-file manifest representing a default app metadata in the OWC. v1.5.0 + /// A representation of a multiple-file manifest representing a default app metadata in the OWC. v1.6.0 [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.4.3.0 (Newtonsoft.Json v11.0.0.0)")] public partial class DefaultLocaleManifest { @@ -260,7 +260,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.5.0"; + public string ManifestVersion { get; set; } = "1.6.0"; private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); diff --git a/src/WingetCreateCore/Models/InstallerManifestModels.cs b/src/WingetCreateCore/Models/InstallerManifestModels.cs index 1efacb8c..a3346190 100644 --- a/src/WingetCreateCore/Models/InstallerManifestModels.cs +++ b/src/WingetCreateCore/Models/InstallerManifestModels.cs @@ -173,6 +173,9 @@ public enum UpgradeBehavior [System.Runtime.Serialization.EnumMember(Value = @"uninstallPrevious")] UninstallPrevious = 1, + [System.Runtime.Serialization.EnumMember(Value = @"deny")] + Deny = 2, + } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.4.3.0 (Newtonsoft.Json v11.0.0.0)")] @@ -452,6 +455,9 @@ public partial class Installer [Newtonsoft.Json.JsonProperty("InstallationMetadata", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public InstallationMetadata InstallationMetadata { get; set; } + [Newtonsoft.Json.JsonProperty("DownloadCommandProhibited", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? DownloadCommandProhibited { get; set; } + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); [Newtonsoft.Json.JsonExtensionData] @@ -464,7 +470,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - /// A representation of a single-file manifest representing an app installers in the OWC. v1.5.0 + /// A representation of a single-file manifest representing an app installers in the OWC. v1.6.0 [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.4.3.0 (Newtonsoft.Json v11.0.0.0)")] public partial class InstallerManifest { @@ -600,6 +606,9 @@ public partial class InstallerManifest [Newtonsoft.Json.JsonProperty("InstallationMetadata", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public InstallationMetadata InstallationMetadata { get; set; } + [Newtonsoft.Json.JsonProperty("DownloadCommandProhibited", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? DownloadCommandProhibited { get; set; } + [Newtonsoft.Json.JsonProperty("Installers", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [System.ComponentModel.DataAnnotations.Required] [System.ComponentModel.DataAnnotations.MinLength(1)] @@ -615,7 +624,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.5.0"; + public string ManifestVersion { get; set; } = "1.6.0"; private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); diff --git a/src/WingetCreateCore/Models/LocaleManifestModels.cs b/src/WingetCreateCore/Models/LocaleManifestModels.cs index 3bf09996..4da3631e 100644 --- a/src/WingetCreateCore/Models/LocaleManifestModels.cs +++ b/src/WingetCreateCore/Models/LocaleManifestModels.cs @@ -107,7 +107,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - /// A representation of a multiple-file manifest representing app metadata in other locale in the OWC. v1.5.0 + /// A representation of a multiple-file manifest representing app metadata in other locale in the OWC. v1.6.0 [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.4.3.0 (Newtonsoft.Json v11.0.0.0)")] public partial class LocaleManifest { @@ -251,7 +251,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.5.0"; + public string ManifestVersion { get; set; } = "1.6.0"; private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); diff --git a/src/WingetCreateCore/Models/SingletonManifestModels.cs b/src/WingetCreateCore/Models/SingletonManifestModels.cs index fadf9034..14419407 100644 --- a/src/WingetCreateCore/Models/SingletonManifestModels.cs +++ b/src/WingetCreateCore/Models/SingletonManifestModels.cs @@ -272,6 +272,9 @@ public enum UpgradeBehavior [System.Runtime.Serialization.EnumMember(Value = @"uninstallPrevious")] UninstallPrevious = 1, + [System.Runtime.Serialization.EnumMember(Value = @"deny")] + Deny = 2, + } [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.4.3.0 (Newtonsoft.Json v11.0.0.0)")] @@ -551,6 +554,9 @@ public partial class Installer [Newtonsoft.Json.JsonProperty("InstallationMetadata", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public InstallationMetadata InstallationMetadata { get; set; } + [Newtonsoft.Json.JsonProperty("DownloadCommandProhibited", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? DownloadCommandProhibited { get; set; } + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); [Newtonsoft.Json.JsonExtensionData] @@ -563,7 +569,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - /// A representation of a single-file manifest representing an app in the OWC. v1.5.0 + /// A representation of a single-file manifest representing an app in the OWC. v1.6.0 [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.4.3.0 (Newtonsoft.Json v11.0.0.0)")] public partial class SingletonManifest { @@ -823,6 +829,9 @@ public partial class SingletonManifest [Newtonsoft.Json.JsonProperty("InstallationMetadata", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] public InstallationMetadata InstallationMetadata { get; set; } + [Newtonsoft.Json.JsonProperty("DownloadCommandProhibited", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] + public bool? DownloadCommandProhibited { get; set; } + [Newtonsoft.Json.JsonProperty("Installers", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)] [System.ComponentModel.DataAnnotations.Required] [System.ComponentModel.DataAnnotations.MinLength(1)] @@ -838,7 +847,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.5.0"; + public string ManifestVersion { get; set; } = "1.6.0"; private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); diff --git a/src/WingetCreateCore/Models/VersionManifestModels.cs b/src/WingetCreateCore/Models/VersionManifestModels.cs index f8c12db7..a0eecb76 100644 --- a/src/WingetCreateCore/Models/VersionManifestModels.cs +++ b/src/WingetCreateCore/Models/VersionManifestModels.cs @@ -8,7 +8,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.5.0 + /// A representation of a multi-file manifest representing an app version in the OWC. v1.6.0 [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "10.4.3.0 (Newtonsoft.Json v11.0.0.0)")] public partial class VersionManifest { @@ -42,7 +42,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.5.0"; + public string ManifestVersion { get; set; } = "1.6.0"; private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); diff --git a/src/WingetCreateCore/WingetCreateCore.csproj b/src/WingetCreateCore/WingetCreateCore.csproj index a8314343..a6ade179 100644 --- a/src/WingetCreateCore/WingetCreateCore.csproj +++ b/src/WingetCreateCore/WingetCreateCore.csproj @@ -19,7 +19,7 @@ - + @@ -48,11 +48,11 @@ - - - - - + + + + +