From cece10e037c6daacc8d2def1a9057882aec47fe4 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Mon, 7 Oct 2019 07:32:59 -0700 Subject: Add support for long fields and fix up Bundle and many other tuples --- .../BundleApprovedExeForElevationAttributes.cs | 16 - src/WixToolset.Data/Burn/BurnConstants.cs | 19 ++ src/WixToolset.Data/IntermediateField.cs | 4 + src/WixToolset.Data/IntermediateFieldExtensions.cs | 370 ++++++++++++--------- .../IntermediateFieldValueExtensions.cs | 39 +++ src/WixToolset.Data/Tuples/IconTuple.cs | 4 +- src/WixToolset.Data/Tuples/MsiFileHashTuple.cs | 8 - .../Tuples/ProvidesDependencyTuple.cs | 84 +++++ src/WixToolset.Data/Tuples/TupleDefinitions.cs | 21 +- .../Tuples/WixApprovedExeForElevationTuple.cs | 27 +- .../Tuples/WixBundleCatalogTuple.cs | 10 +- .../Tuples/WixBundleExePackageTuple.cs | 14 +- .../Tuples/WixBundleMsiFeatureTuple.cs | 18 +- .../Tuples/WixBundleMsiPackageTuple.cs | 15 +- .../Tuples/WixBundleMsiPropertyTuple.cs | 10 +- .../Tuples/WixBundleMspPackageTuple.cs | 14 +- .../Tuples/WixBundleMsuPackageTuple.cs | 8 - .../Tuples/WixBundlePackageExitCodeTuple.cs | 6 +- .../Tuples/WixBundlePackageTuple.cs | 24 +- .../Tuples/WixBundlePatchTargetCodeTuple.cs | 40 ++- .../Tuples/WixBundlePayloadTuple.cs | 42 +-- .../Tuples/WixBundlePropertiesTuple.cs | 84 ----- .../Tuples/WixBundleRelatedPackageTuple.cs | 58 ++-- .../Tuples/WixBundleRollbackBoundaryTuple.cs | 8 - .../Tuples/WixBundleSlipstreamMspTuple.cs | 22 +- src/WixToolset.Data/Tuples/WixBundleTuple.cs | 128 +++---- src/WixToolset.Data/Tuples/WixChainTuple.cs | 8 +- .../Tuples/WixComponentSearchTuple.cs | 26 +- .../Tuples/WixDependencyProviderTuple.cs | 87 +++++ src/WixToolset.Data/Tuples/WixFileSearchTuple.cs | 33 +- .../Tuples/WixPackageFeatureInfoTuple.cs | 116 ------- .../Tuples/WixPackagePropertiesTuple.cs | 180 ---------- .../Tuples/WixPayloadPropertiesTuple.cs | 92 ----- .../Tuples/WixProductSearchTuple.cs | 28 +- .../Tuples/WixRegistrySearchTuple.cs | 35 +- .../Rows/WixApprovedExeForElevationRow.cs | 8 +- .../Rows/WixBundleExePackageRow.cs | 3 +- .../Rows/WixBundleMsiPackageRow.cs | 8 - .../Rows/WixBundlePatchTargetCodeRow.cs | 20 +- 39 files changed, 761 insertions(+), 976 deletions(-) delete mode 100644 src/WixToolset.Data/BundleApprovedExeForElevationAttributes.cs create mode 100644 src/WixToolset.Data/Burn/BurnConstants.cs create mode 100644 src/WixToolset.Data/Tuples/ProvidesDependencyTuple.cs delete mode 100644 src/WixToolset.Data/Tuples/WixBundlePropertiesTuple.cs create mode 100644 src/WixToolset.Data/Tuples/WixDependencyProviderTuple.cs delete mode 100644 src/WixToolset.Data/Tuples/WixPackageFeatureInfoTuple.cs delete mode 100644 src/WixToolset.Data/Tuples/WixPackagePropertiesTuple.cs delete mode 100644 src/WixToolset.Data/Tuples/WixPayloadPropertiesTuple.cs (limited to 'src') diff --git a/src/WixToolset.Data/BundleApprovedExeForElevationAttributes.cs b/src/WixToolset.Data/BundleApprovedExeForElevationAttributes.cs deleted file mode 100644 index 240c2160..00000000 --- a/src/WixToolset.Data/BundleApprovedExeForElevationAttributes.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Data -{ - using System; - - /// - /// Attributes available for an ApprovedExeForElevation. - /// - [Flags] - public enum BundleApprovedExeForElevationAttributes : int - { - None = 0x0, - Win64 = 0x1, - } -} diff --git a/src/WixToolset.Data/Burn/BurnConstants.cs b/src/WixToolset.Data/Burn/BurnConstants.cs new file mode 100644 index 00000000..9803a73a --- /dev/null +++ b/src/WixToolset.Data/Burn/BurnConstants.cs @@ -0,0 +1,19 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Data.Burn +{ + public static class BurnConstants + { + public const string BurnUXContainerName = "WixUXContainer"; + public const string BurnDefaultAttachedContainerName = "WixAttachedContainer"; + public const string BundleLayoutOnlyPayloadsName = "BundleLayoutOnlyPayloads"; + + public const string BootstrapperApplicationDataTupleDefinitionTag = "WixBootstrapperApplicationData"; + + // The following constants must stay in sync with src\burn\engine\core.h + public const string BURN_BUNDLE_NAME = "WixBundleName"; + public const string BURN_BUNDLE_ORIGINAL_SOURCE = "WixBundleOriginalSource"; + public const string BURN_BUNDLE_ORIGINAL_SOURCE_FOLDER = "WixBundleOriginalSourceFolder"; + public const string BURN_BUNDLE_LAST_USED_SOURCE = "WixBundleLastUsedSource"; + } +} diff --git a/src/WixToolset.Data/IntermediateField.cs b/src/WixToolset.Data/IntermediateField.cs index 5b511d02..2310f447 100644 --- a/src/WixToolset.Data/IntermediateField.cs +++ b/src/WixToolset.Data/IntermediateField.cs @@ -27,6 +27,10 @@ namespace WixToolset.Data public static explicit operator bool? (IntermediateField field) => field.AsNullableBool(); + public static explicit operator long(IntermediateField field) => field.AsLargeNumber(); + + public static explicit operator long?(IntermediateField field) => field.AsNullableLargeNumber(); + public static explicit operator int(IntermediateField field) => field.AsNumber(); public static explicit operator int? (IntermediateField field) => field.AsNullableNumber(); diff --git a/src/WixToolset.Data/IntermediateFieldExtensions.cs b/src/WixToolset.Data/IntermediateFieldExtensions.cs index a73a6552..5d2ddf06 100644 --- a/src/WixToolset.Data/IntermediateFieldExtensions.cs +++ b/src/WixToolset.Data/IntermediateFieldExtensions.cs @@ -20,20 +20,21 @@ namespace WixToolset.Data switch (field.Definition.Type) { - case IntermediateFieldType.Bool: - return field.Value.AsBool(); + case IntermediateFieldType.Bool: + return field.Value.AsBool(); - case IntermediateFieldType.Number: - return field.Value.AsNumber() != 0; + case IntermediateFieldType.LargeNumber: + case IntermediateFieldType.Number: + return field.Value.AsLargeNumber() != 0; - case IntermediateFieldType.String: - return !String.IsNullOrEmpty(field.Value.AsString()); + case IntermediateFieldType.String: + return !String.IsNullOrEmpty(field.Value.AsString()); - case IntermediateFieldType.Path: - return !String.IsNullOrEmpty(field.Value.AsPath()?.Path); + case IntermediateFieldType.Path: + return !String.IsNullOrEmpty(field.Value.AsPath()?.Path); - default: - throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to boolean"); + default: + throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to boolean"); } } @@ -46,20 +47,68 @@ namespace WixToolset.Data switch (field.Definition.Type) { - case IntermediateFieldType.Bool: - return field.Value.AsBool(); + case IntermediateFieldType.Bool: + return field.Value.AsBool(); - case IntermediateFieldType.Number: - return field.Value.AsNumber() != 0; + case IntermediateFieldType.LargeNumber: + case IntermediateFieldType.Number: + return field.Value.AsLargeNumber() != 0; - case IntermediateFieldType.String: - return !String.IsNullOrEmpty(field.Value.AsString()); + case IntermediateFieldType.String: + return !String.IsNullOrEmpty(field.Value.AsString()); - default: - throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to boolean"); + default: + throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to boolean"); } } + public static long AsLargeNumber(this IntermediateField field) + { + if (field == null || field.Value == null || field.Value.Data == null) + { + return 0; + } + + switch (field.Definition.Type) + { + case IntermediateFieldType.Bool: + return field.Value.AsBool() ? 1 : 0; + + case IntermediateFieldType.LargeNumber: + case IntermediateFieldType.Number: + return field.Value.AsLargeNumber(); + + case IntermediateFieldType.String: + return Convert.ToInt64(field.Value.AsString()); + + default: + throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to large number"); + } + } + + public static long? AsNullableLargeNumber(this IntermediateField field) + { + if (field == null || field.Value == null || field.Value.Data == null) + { + return null; + } + + switch (field.Definition.Type) + { + case IntermediateFieldType.Bool: + return field.Value.AsBool() ? 1 : 0; + + case IntermediateFieldType.LargeNumber: + case IntermediateFieldType.Number: + return field.Value.AsLargeNumber(); + + case IntermediateFieldType.String: + return Convert.ToInt64(field.Value.AsString()); + + default: + throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to large number"); + } + } public static int AsNumber(this IntermediateField field) { @@ -70,17 +119,18 @@ namespace WixToolset.Data switch (field.Definition.Type) { - case IntermediateFieldType.Bool: - return field.Value.AsBool() ? 1 : 0; + case IntermediateFieldType.Bool: + return field.Value.AsBool() ? 1 : 0; - case IntermediateFieldType.Number: - return field.Value.AsNumber(); + case IntermediateFieldType.LargeNumber: + case IntermediateFieldType.Number: + return field.Value.AsNumber(); - case IntermediateFieldType.String: - return Convert.ToInt32(field.Value.AsString()); + case IntermediateFieldType.String: + return Convert.ToInt32(field.Value.AsString()); - default: - throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to number"); + default: + throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to number"); } } @@ -93,17 +143,18 @@ namespace WixToolset.Data switch (field.Definition.Type) { - case IntermediateFieldType.Bool: - return field.Value.AsBool() ? 1 : 0; + case IntermediateFieldType.Bool: + return field.Value.AsBool() ? 1 : 0; - case IntermediateFieldType.Number: - return field.Value.AsNumber(); + case IntermediateFieldType.LargeNumber: + case IntermediateFieldType.Number: + return field.Value.AsNumber(); - case IntermediateFieldType.String: - return Convert.ToInt32(field.Value.AsString()); + case IntermediateFieldType.String: + return Convert.ToInt32(field.Value.AsString()); - default: - throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to number"); + default: + throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to number"); } } @@ -116,14 +167,14 @@ namespace WixToolset.Data switch (field.Definition.Type) { - case IntermediateFieldType.String: - return new IntermediateFieldPathValue { Path = field.Value.AsString() }; + case IntermediateFieldType.String: + return new IntermediateFieldPathValue { Path = field.Value.AsString() }; - case IntermediateFieldType.Path: - return field.Value.AsPath(); + case IntermediateFieldType.Path: + return field.Value.AsPath(); - default: - throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to string"); + default: + throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to string"); } } @@ -136,20 +187,21 @@ namespace WixToolset.Data switch (field.Definition.Type) { - case IntermediateFieldType.Bool: - return field.Value.AsBool() ? "true" : "false"; + case IntermediateFieldType.Bool: + return field.Value.AsBool() ? "true" : "false"; - case IntermediateFieldType.Number: - return field.Value.AsNumber().ToString(); + case IntermediateFieldType.LargeNumber: + case IntermediateFieldType.Number: + return field.Value.AsLargeNumber().ToString(); - case IntermediateFieldType.String: - return field.Value.AsString(); + case IntermediateFieldType.String: + return field.Value.AsString(); - case IntermediateFieldType.Path: - return field.Value.AsPath()?.Path; + case IntermediateFieldType.Path: + return field.Value.AsPath()?.Path; - default: - throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to string"); + default: + throw new InvalidCastException($"Cannot convert field {field.Name} with type {field.Type} to string"); } } @@ -169,27 +221,27 @@ namespace WixToolset.Data switch (field.Type) { - case IntermediateFieldType.Bool: - data = value; - break; + case IntermediateFieldType.Bool: + data = value; + break; - case IntermediateFieldType.LargeNumber: - data = value ? (long)1 : (long)0; - break; + case IntermediateFieldType.LargeNumber: + data = value ? (long)1 : (long)0; + break; - case IntermediateFieldType.Number: - data = value ? 1 : 0; - break; + case IntermediateFieldType.Number: + data = value ? 1 : 0; + break; - case IntermediateFieldType.Path: - throw new ArgumentException($"Cannot convert bool '{value}' to a 'Path' field type.", nameof(value)); + case IntermediateFieldType.Path: + throw new ArgumentException($"Cannot convert bool '{value}' to a 'Path' field type.", nameof(value)); - case IntermediateFieldType.String: - data = value ? "true" : "false"; - break; + case IntermediateFieldType.String: + data = value ? "true" : "false"; + break; - default: - throw new ArgumentOutOfRangeException(nameof(value), $"Unknown intermediate field type: {value.GetType()}"); + default: + throw new ArgumentOutOfRangeException(nameof(value), $"Unknown intermediate field type: {value.GetType()}"); }; return AssignFieldValue(field, data); @@ -216,27 +268,27 @@ namespace WixToolset.Data switch (field.Type) { - case IntermediateFieldType.Bool: - data = (value != 0); - break; + case IntermediateFieldType.Bool: + data = (value != 0); + break; - case IntermediateFieldType.LargeNumber: - data = value; - break; + case IntermediateFieldType.LargeNumber: + data = value; + break; - case IntermediateFieldType.Number: - data = (int)value; - break; + case IntermediateFieldType.Number: + data = (int)value; + break; - case IntermediateFieldType.Path: - throw new ArgumentException($"Cannot convert large number '{value}' to a 'Path' field type.", nameof(value)); + case IntermediateFieldType.Path: + throw new ArgumentException($"Cannot convert large number '{value}' to a 'Path' field type.", nameof(value)); - case IntermediateFieldType.String: - data = value.ToString(); - break; + case IntermediateFieldType.String: + data = value.ToString(); + break; - default: - throw new ArgumentOutOfRangeException(nameof(value), $"Unknown intermediate field type: {value.GetType()}"); + default: + throw new ArgumentOutOfRangeException(nameof(value), $"Unknown intermediate field type: {value.GetType()}"); }; return AssignFieldValue(field, data); @@ -263,27 +315,27 @@ namespace WixToolset.Data switch (field.Type) { - case IntermediateFieldType.Bool: - data = (value != 0); - break; + case IntermediateFieldType.Bool: + data = (value != 0); + break; - case IntermediateFieldType.LargeNumber: - data = (long)value; - break; + case IntermediateFieldType.LargeNumber: + data = (long)value; + break; - case IntermediateFieldType.Number: - data = value; - break; + case IntermediateFieldType.Number: + data = value; + break; - case IntermediateFieldType.Path: - throw new ArgumentException($"Cannot convert number '{value}' to a 'Path' field type.", nameof(value)); + case IntermediateFieldType.Path: + throw new ArgumentException($"Cannot convert number '{value}' to a 'Path' field type.", nameof(value)); - case IntermediateFieldType.String: - data = value.ToString(); - break; + case IntermediateFieldType.String: + data = value.ToString(); + break; - default: - throw new ArgumentOutOfRangeException(nameof(value), $"Unknown intermediate field type: {value.GetType()}"); + default: + throw new ArgumentOutOfRangeException(nameof(value), $"Unknown intermediate field type: {value.GetType()}"); }; return AssignFieldValue(field, data); @@ -315,25 +367,25 @@ namespace WixToolset.Data { switch (field.Type) { - case IntermediateFieldType.Bool: - throw new ArgumentException($"Cannot convert path '{value.Path}' to a 'bool' field type.", nameof(value)); + case IntermediateFieldType.Bool: + throw new ArgumentException($"Cannot convert path '{value.Path}' to a 'bool' field type.", nameof(value)); - case IntermediateFieldType.LargeNumber: - throw new ArgumentException($"Cannot convert path '{value.Path}' to a 'large number' field type.", nameof(value)); + case IntermediateFieldType.LargeNumber: + throw new ArgumentException($"Cannot convert path '{value.Path}' to a 'large number' field type.", nameof(value)); - case IntermediateFieldType.Number: - throw new ArgumentException($"Cannot convert path '{value.Path}' to a 'number' field type.", nameof(value)); + case IntermediateFieldType.Number: + throw new ArgumentException($"Cannot convert path '{value.Path}' to a 'number' field type.", nameof(value)); - case IntermediateFieldType.Path: - data = value; - break; + case IntermediateFieldType.Path: + data = value; + break; - case IntermediateFieldType.String: - data = value.Path; - break; + case IntermediateFieldType.String: + data = value.Path; + break; - default: - throw new ArgumentOutOfRangeException(nameof(value), $"Unknown intermediate field type: {value.GetType()}"); + default: + throw new ArgumentOutOfRangeException(nameof(value), $"Unknown intermediate field type: {value.GetType()}"); }; } @@ -356,53 +408,53 @@ namespace WixToolset.Data { switch (field.Type) { - case IntermediateFieldType.Bool: - if (value.Equals("yes", StringComparison.OrdinalIgnoreCase) || value.Equals("true", StringComparison.OrdinalIgnoreCase)) - { - data = true; - } - else if (value.Equals("no", StringComparison.OrdinalIgnoreCase) || value.Equals("false", StringComparison.OrdinalIgnoreCase)) - { - data = false; - } - else - { - throw new ArgumentException($"Cannot convert string '{value}' to a 'bool' field type.", nameof(value)); - } - break; - - case IntermediateFieldType.LargeNumber: - if (Int64.TryParse(value, out var largeNumber)) - { - data = largeNumber; - } - else - { - throw new ArgumentException($"Cannot convert string '{value}' to a 'large number' field type.", nameof(value)); - } - break; - - case IntermediateFieldType.Number: - if (Int32.TryParse(value, out var number)) - { - data = number; - } - else - { - throw new ArgumentException($"Cannot convert string '{value}' to a 'number' field type.", nameof(value)); - } - break; - - case IntermediateFieldType.Path: - data = new IntermediateFieldPathValue { Path = value }; - break; - - case IntermediateFieldType.String: - data = value; - break; - - default: - throw new ArgumentOutOfRangeException(nameof(value), $"Unknown intermediate field type: {value.GetType()}"); + case IntermediateFieldType.Bool: + if (value.Equals("yes", StringComparison.OrdinalIgnoreCase) || value.Equals("true", StringComparison.OrdinalIgnoreCase)) + { + data = true; + } + else if (value.Equals("no", StringComparison.OrdinalIgnoreCase) || value.Equals("false", StringComparison.OrdinalIgnoreCase)) + { + data = false; + } + else + { + throw new ArgumentException($"Cannot convert string '{value}' to a 'bool' field type.", nameof(value)); + } + break; + + case IntermediateFieldType.LargeNumber: + if (Int64.TryParse(value, out var largeNumber)) + { + data = largeNumber; + } + else + { + throw new ArgumentException($"Cannot convert string '{value}' to a 'large number' field type.", nameof(value)); + } + break; + + case IntermediateFieldType.Number: + if (Int32.TryParse(value, out var number)) + { + data = number; + } + else + { + throw new ArgumentException($"Cannot convert string '{value}' to a 'number' field type.", nameof(value)); + } + break; + + case IntermediateFieldType.Path: + data = new IntermediateFieldPathValue { Path = value }; + break; + + case IntermediateFieldType.String: + data = value; + break; + + default: + throw new ArgumentOutOfRangeException(nameof(value), $"Unknown intermediate field type: {value.GetType()}"); }; } diff --git a/src/WixToolset.Data/IntermediateFieldValueExtensions.cs b/src/WixToolset.Data/IntermediateFieldValueExtensions.cs index f9322e09..317dfc7f 100644 --- a/src/WixToolset.Data/IntermediateFieldValueExtensions.cs +++ b/src/WixToolset.Data/IntermediateFieldValueExtensions.cs @@ -45,6 +45,45 @@ namespace WixToolset.Data return (bool)value.Data; } + public static long AsLargeNumber(this IntermediateFieldValue value) + { + var result = value.AsNullableLargeNumber(); + return result ?? 0; + } + + public static long? AsNullableLargeNumber(this IntermediateFieldValue value) + { + if (value?.Data == null) + { + return null; + } + else if (value.Data is int n) + { + return n; + } + else if (value.Data is long l) + { + return l; + } + else if (value.Data is bool b) + { + return b ? 1 : 0; + } + else if (value.Data is string s) + { + try + { + return Convert.ToInt32(s); + } + catch (FormatException) + { + throw new WixException(ErrorMessages.UnableToConvertFieldToNumber(s)); + } + } + + return (long)value.Data; + } + public static int AsNumber(this IntermediateFieldValue value) { var result = value.AsNullableNumber(); diff --git a/src/WixToolset.Data/Tuples/IconTuple.cs b/src/WixToolset.Data/Tuples/IconTuple.cs index 0e8c9fd7..e9ed93b2 100644 --- a/src/WixToolset.Data/Tuples/IconTuple.cs +++ b/src/WixToolset.Data/Tuples/IconTuple.cs @@ -35,9 +35,9 @@ namespace WixToolset.Data.Tuples public IntermediateField this[IconTupleFields index] => this.Fields[(int)index]; - public string Data + public IntermediateFieldPathValue Data { - get => (string)this.Fields[(int)IconTupleFields.Data]; + get => this.Fields[(int)IconTupleFields.Data].AsPath(); set => this.Set((int)IconTupleFields.Data, value); } } diff --git a/src/WixToolset.Data/Tuples/MsiFileHashTuple.cs b/src/WixToolset.Data/Tuples/MsiFileHashTuple.cs index a83093e9..10aa801d 100644 --- a/src/WixToolset.Data/Tuples/MsiFileHashTuple.cs +++ b/src/WixToolset.Data/Tuples/MsiFileHashTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.MsiFileHash, new[] { - new IntermediateFieldDefinition(nameof(MsiFileHashTupleFields.FileRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(MsiFileHashTupleFields.Options), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(MsiFileHashTupleFields.HashPart1), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(MsiFileHashTupleFields.HashPart2), IntermediateFieldType.Number), @@ -25,7 +24,6 @@ namespace WixToolset.Data.Tuples { public enum MsiFileHashTupleFields { - FileRef, Options, HashPart1, HashPart2, @@ -45,12 +43,6 @@ namespace WixToolset.Data.Tuples public IntermediateField this[MsiFileHashTupleFields index] => this.Fields[(int)index]; - public string FileRef - { - get => (string)this.Fields[(int)MsiFileHashTupleFields.FileRef]; - set => this.Set((int)MsiFileHashTupleFields.FileRef, value); - } - public int Options { get => (int)this.Fields[(int)MsiFileHashTupleFields.Options]; diff --git a/src/WixToolset.Data/Tuples/ProvidesDependencyTuple.cs b/src/WixToolset.Data/Tuples/ProvidesDependencyTuple.cs new file mode 100644 index 00000000..a6337bdf --- /dev/null +++ b/src/WixToolset.Data/Tuples/ProvidesDependencyTuple.cs @@ -0,0 +1,84 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Data +{ + using WixToolset.Data.Tuples; + + public static partial class TupleDefinitions + { + public static readonly IntermediateTupleDefinition ProvidesDependency = new IntermediateTupleDefinition( + TupleDefinitionType.ProvidesDependency, + new[] + { + new IntermediateFieldDefinition(nameof(ProvidesDependencyTupleFields.PackageRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(ProvidesDependencyTupleFields.Key), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(ProvidesDependencyTupleFields.Version), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(ProvidesDependencyTupleFields.DisplayName), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(ProvidesDependencyTupleFields.Attributes), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(ProvidesDependencyTupleFields.Imported), IntermediateFieldType.Bool), + }, + typeof(ProvidesDependencyTuple)); + } +} + +namespace WixToolset.Data.Tuples +{ + public enum ProvidesDependencyTupleFields + { + PackageRef, + Key, + Version, + DisplayName, + Attributes, + Imported, + } + + public class ProvidesDependencyTuple : IntermediateTuple + { + public ProvidesDependencyTuple() : base(TupleDefinitions.ProvidesDependency, null, null) + { + } + + public ProvidesDependencyTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.ProvidesDependency, sourceLineNumber, id) + { + } + + public IntermediateField this[ProvidesDependencyTupleFields index] => this.Fields[(int)index]; + + public string PackageRef + { + get => (string)this.Fields[(int)ProvidesDependencyTupleFields.PackageRef]; + set => this.Set((int)ProvidesDependencyTupleFields.PackageRef, value); + } + + public string Key + { + get => (string)this.Fields[(int)ProvidesDependencyTupleFields.Key]; + set => this.Set((int)ProvidesDependencyTupleFields.Key, value); + } + + public string Version + { + get => (string)this.Fields[(int)ProvidesDependencyTupleFields.Version]; + set => this.Set((int)ProvidesDependencyTupleFields.Version, value); + } + + public string DisplayName + { + get => (string)this.Fields[(int)ProvidesDependencyTupleFields.DisplayName]; + set => this.Set((int)ProvidesDependencyTupleFields.DisplayName, value); + } + + public int? Attributes + { + get => (int?)this.Fields[(int)ProvidesDependencyTupleFields.Attributes]; + set => this.Set((int)ProvidesDependencyTupleFields.Attributes, value); + } + + public bool Imported + { + get => (bool)this.Fields[(int)ProvidesDependencyTupleFields.Imported]; + set => this.Set((int)ProvidesDependencyTupleFields.Imported, value); + } + } +} diff --git a/src/WixToolset.Data/Tuples/TupleDefinitions.cs b/src/WixToolset.Data/Tuples/TupleDefinitions.cs index bc1cb2eb..bad8af3f 100644 --- a/src/WixToolset.Data/Tuples/TupleDefinitions.cs +++ b/src/WixToolset.Data/Tuples/TupleDefinitions.cs @@ -100,6 +100,7 @@ namespace WixToolset.Data ProgId, Properties, Property, + ProvidesDependency, PublishComponent, RadioButton, Registry, @@ -144,7 +145,6 @@ namespace WixToolset.Data WixBundlePatchTargetCode, WixBundlePayload, WixBundlePayloadGroup, - WixBundleProperties, WixBundleRelatedPackage, WixBundleRollbackBoundary, WixBundleSlipstreamMsp, @@ -159,6 +159,7 @@ namespace WixToolset.Data WixCustomTable, WixDeltaPatchFile, WixDeltaPatchSymbolPaths, + WixDependencyProvider, WixEnsureTable, WixFeatureGroup, WixFeatureModules, @@ -171,15 +172,12 @@ namespace WixToolset.Data WixMediaTemplate, WixMerge, WixOrdering, - WixPackageFeatureInfo, - WixPackageProperties, WixPatchBaseline, WixPatchFamilyGroup, WixPatchId, WixPatchMetadata, WixPatchRef, WixPatchTarget, - WixPayloadProperties, WixProductSearch, WixProperty, WixRegistrySearch, @@ -495,6 +493,9 @@ namespace WixToolset.Data case TupleDefinitionType.PublishComponent: return TupleDefinitions.PublishComponent; + case TupleDefinitionType.ProvidesDependency: + return TupleDefinitions.ProvidesDependency; + case TupleDefinitionType.RadioButton: return TupleDefinitions.RadioButton; @@ -624,9 +625,6 @@ namespace WixToolset.Data case TupleDefinitionType.WixBundlePayloadGroup: return TupleDefinitions.WixBundlePayloadGroup; - case TupleDefinitionType.WixBundleProperties: - return TupleDefinitions.WixBundleProperties; - case TupleDefinitionType.WixBundleRelatedPackage: return TupleDefinitions.WixBundleRelatedPackage; @@ -699,12 +697,6 @@ namespace WixToolset.Data case TupleDefinitionType.WixOrdering: return TupleDefinitions.WixOrdering; - case TupleDefinitionType.WixPackageFeatureInfo: - return TupleDefinitions.WixPackageFeatureInfo; - - case TupleDefinitionType.WixPackageProperties: - return TupleDefinitions.WixPackageProperties; - case TupleDefinitionType.WixPatchBaseline: return TupleDefinitions.WixPatchBaseline; @@ -723,9 +715,6 @@ namespace WixToolset.Data case TupleDefinitionType.WixPatchTarget: return TupleDefinitions.WixPatchTarget; - case TupleDefinitionType.WixPayloadProperties: - return TupleDefinitions.WixPayloadProperties; - case TupleDefinitionType.WixProductSearch: return TupleDefinitions.WixProductSearch; diff --git a/src/WixToolset.Data/Tuples/WixApprovedExeForElevationTuple.cs b/src/WixToolset.Data/Tuples/WixApprovedExeForElevationTuple.cs index e2326697..07fe838b 100644 --- a/src/WixToolset.Data/Tuples/WixApprovedExeForElevationTuple.cs +++ b/src/WixToolset.Data/Tuples/WixApprovedExeForElevationTuple.cs @@ -11,7 +11,7 @@ namespace WixToolset.Data new[] { new IntermediateFieldDefinition(nameof(WixApprovedExeForElevationTupleFields.Key), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixApprovedExeForElevationTupleFields.Value), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixApprovedExeForElevationTupleFields.ValueName), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixApprovedExeForElevationTupleFields.Attributes), IntermediateFieldType.Number), }, typeof(WixApprovedExeForElevationTuple)); @@ -20,13 +20,22 @@ namespace WixToolset.Data namespace WixToolset.Data.Tuples { + using System; + public enum WixApprovedExeForElevationTupleFields { Key, - Value, + ValueName, Attributes, } + [Flags] + public enum WixApprovedExeForElevationAttributes + { + None = 0x0, + Win64 = 0x1, + } + public class WixApprovedExeForElevationTuple : IntermediateTuple { public WixApprovedExeForElevationTuple() : base(TupleDefinitions.WixApprovedExeForElevation, null, null) @@ -45,16 +54,18 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixApprovedExeForElevationTupleFields.Key, value); } - public string Value + public string ValueName { - get => (string)this.Fields[(int)WixApprovedExeForElevationTupleFields.Value]; - set => this.Set((int)WixApprovedExeForElevationTupleFields.Value, value); + get => (string)this.Fields[(int)WixApprovedExeForElevationTupleFields.ValueName]; + set => this.Set((int)WixApprovedExeForElevationTupleFields.ValueName, value); } - public BundleApprovedExeForElevationAttributes Attributes + public WixApprovedExeForElevationAttributes Attributes { - get => (BundleApprovedExeForElevationAttributes)this.Fields[(int)WixApprovedExeForElevationTupleFields.Attributes].AsNumber(); + get => (WixApprovedExeForElevationAttributes)this.Fields[(int)WixApprovedExeForElevationTupleFields.Attributes].AsNumber(); set => this.Set((int)WixApprovedExeForElevationTupleFields.Attributes, (int)value); } + + public bool Win64 => (this.Attributes & WixApprovedExeForElevationAttributes.Win64) == WixApprovedExeForElevationAttributes.Win64; } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixBundleCatalogTuple.cs b/src/WixToolset.Data/Tuples/WixBundleCatalogTuple.cs index ca6e6b33..51c1306e 100644 --- a/src/WixToolset.Data/Tuples/WixBundleCatalogTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundleCatalogTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixBundleCatalog, new[] { - new IntermediateFieldDefinition(nameof(WixBundleCatalogTupleFields.WixBundleCatalog), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleCatalogTupleFields.PayloadRef), IntermediateFieldType.String), }, typeof(WixBundleCatalogTuple)); @@ -21,7 +20,6 @@ namespace WixToolset.Data.Tuples { public enum WixBundleCatalogTupleFields { - WixBundleCatalog, PayloadRef, } @@ -37,16 +35,10 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundleCatalogTupleFields index] => this.Fields[(int)index]; - public string WixBundleCatalog - { - get => (string)this.Fields[(int)WixBundleCatalogTupleFields.WixBundleCatalog]; - set => this.Set((int)WixBundleCatalogTupleFields.WixBundleCatalog, value); - } - public string PayloadRef { get => (string)this.Fields[(int)WixBundleCatalogTupleFields.PayloadRef]; set => this.Set((int)WixBundleCatalogTupleFields.PayloadRef, value); } } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixBundleExePackageTuple.cs b/src/WixToolset.Data/Tuples/WixBundleExePackageTuple.cs index 798e2d0d..e87de26d 100644 --- a/src/WixToolset.Data/Tuples/WixBundleExePackageTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundleExePackageTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixBundleExePackage, new[] { - new IntermediateFieldDefinition(nameof(WixBundleExePackageTupleFields.WixBundlePackageRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleExePackageTupleFields.Attributes), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(WixBundleExePackageTupleFields.DetectCondition), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleExePackageTupleFields.InstallCommand), IntermediateFieldType.String), @@ -28,7 +27,6 @@ namespace WixToolset.Data.Tuples public enum WixBundleExePackageTupleFields { - WixBundlePackageRef, Attributes, DetectCondition, InstallCommand, @@ -40,7 +38,7 @@ namespace WixToolset.Data.Tuples [Flags] public enum WixBundleExePackageAttributes { - Repairable = 0x1, + None = 0, } public class WixBundleExePackageTuple : IntermediateTuple @@ -55,12 +53,6 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundleExePackageTupleFields index] => this.Fields[(int)index]; - public string WixBundlePackageRef - { - get => (string)this.Fields[(int)WixBundleExePackageTupleFields.WixBundlePackageRef]; - set => this.Set((int)WixBundleExePackageTupleFields.WixBundlePackageRef, value); - } - public WixBundleExePackageAttributes Attributes { get => (WixBundleExePackageAttributes)(int)this.Fields[(int)WixBundleExePackageTupleFields.Attributes]; @@ -96,5 +88,7 @@ namespace WixToolset.Data.Tuples get => (string)this.Fields[(int)WixBundleExePackageTupleFields.ExeProtocol]; set => this.Set((int)WixBundleExePackageTupleFields.ExeProtocol, value); } + + public bool Repairable => !String.IsNullOrEmpty(this.RepairCommand); } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixBundleMsiFeatureTuple.cs b/src/WixToolset.Data/Tuples/WixBundleMsiFeatureTuple.cs index 7b6c635a..dab42529 100644 --- a/src/WixToolset.Data/Tuples/WixBundleMsiFeatureTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundleMsiFeatureTuple.cs @@ -10,9 +10,9 @@ namespace WixToolset.Data TupleDefinitionType.WixBundleMsiFeature, new[] { - new IntermediateFieldDefinition(nameof(WixBundleMsiFeatureTupleFields.WixBundlePackageRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundleMsiFeatureTupleFields.PackageRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleMsiFeatureTupleFields.Name), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundleMsiFeatureTupleFields.Size), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixBundleMsiFeatureTupleFields.Size), IntermediateFieldType.LargeNumber), new IntermediateFieldDefinition(nameof(WixBundleMsiFeatureTupleFields.Parent), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleMsiFeatureTupleFields.Title), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleMsiFeatureTupleFields.Description), IntermediateFieldType.String), @@ -29,7 +29,7 @@ namespace WixToolset.Data.Tuples { public enum WixBundleMsiFeatureTupleFields { - WixBundlePackageRef, + PackageRef, Name, Size, Parent, @@ -53,10 +53,10 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundleMsiFeatureTupleFields index] => this.Fields[(int)index]; - public string WixBundlePackageRef + public string PackageRef { - get => (string)this.Fields[(int)WixBundleMsiFeatureTupleFields.WixBundlePackageRef]; - set => this.Set((int)WixBundleMsiFeatureTupleFields.WixBundlePackageRef, value); + get => (string)this.Fields[(int)WixBundleMsiFeatureTupleFields.PackageRef]; + set => this.Set((int)WixBundleMsiFeatureTupleFields.PackageRef, value); } public string Name @@ -65,9 +65,9 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundleMsiFeatureTupleFields.Name, value); } - public int Size + public long Size { - get => (int)this.Fields[(int)WixBundleMsiFeatureTupleFields.Size]; + get => (long)this.Fields[(int)WixBundleMsiFeatureTupleFields.Size]; set => this.Set((int)WixBundleMsiFeatureTupleFields.Size, value); } @@ -113,4 +113,4 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundleMsiFeatureTupleFields.Attributes, value); } } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixBundleMsiPackageTuple.cs b/src/WixToolset.Data/Tuples/WixBundleMsiPackageTuple.cs index a86c33d0..3a205376 100644 --- a/src/WixToolset.Data/Tuples/WixBundleMsiPackageTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundleMsiPackageTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixBundleMsiPackage, new[] { - new IntermediateFieldDefinition(nameof(WixBundleMsiPackageTupleFields.WixBundlePackageRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleMsiPackageTupleFields.Attributes), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(WixBundleMsiPackageTupleFields.ProductCode), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleMsiPackageTupleFields.UpgradeCode), IntermediateFieldType.String), @@ -29,7 +28,6 @@ namespace WixToolset.Data.Tuples public enum WixBundleMsiPackageTupleFields { - WixBundlePackageRef, Attributes, ProductCode, UpgradeCode, @@ -45,7 +43,6 @@ namespace WixToolset.Data.Tuples DisplayInternalUI = 0x1, EnableFeatureSelection = 0x4, ForcePerMachine = 0x2, - SuppressLooseFilePayloadGeneration = 0x8, } public class WixBundleMsiPackageTuple : IntermediateTuple @@ -60,12 +57,6 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundleMsiPackageTupleFields index] => this.Fields[(int)index]; - public string WixBundlePackageRef - { - get => (string)this.Fields[(int)WixBundleMsiPackageTupleFields.WixBundlePackageRef]; - set => this.Set((int)WixBundleMsiPackageTupleFields.WixBundlePackageRef, value); - } - public WixBundleMsiPackageAttributes Attributes { get => (WixBundleMsiPackageAttributes)(int)this.Fields[(int)WixBundleMsiPackageTupleFields.Attributes]; @@ -107,5 +98,11 @@ namespace WixToolset.Data.Tuples get => (string)this.Fields[(int)WixBundleMsiPackageTupleFields.Manufacturer]; set => this.Set((int)WixBundleMsiPackageTupleFields.Manufacturer, value); } + + public bool DisplayInternalUI => (this.Attributes & WixBundleMsiPackageAttributes.DisplayInternalUI) == WixBundleMsiPackageAttributes.DisplayInternalUI; + + public bool EnableFeatureSelection => (this.Attributes & WixBundleMsiPackageAttributes.EnableFeatureSelection) == WixBundleMsiPackageAttributes.EnableFeatureSelection; + + public bool ForcePerMachine => (this.Attributes & WixBundleMsiPackageAttributes.ForcePerMachine) == WixBundleMsiPackageAttributes.ForcePerMachine; } } \ No newline at end of file diff --git a/src/WixToolset.Data/Tuples/WixBundleMsiPropertyTuple.cs b/src/WixToolset.Data/Tuples/WixBundleMsiPropertyTuple.cs index 2b236a24..80500f17 100644 --- a/src/WixToolset.Data/Tuples/WixBundleMsiPropertyTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundleMsiPropertyTuple.cs @@ -10,7 +10,7 @@ namespace WixToolset.Data TupleDefinitionType.WixBundleMsiProperty, new[] { - new IntermediateFieldDefinition(nameof(WixBundleMsiPropertyTupleFields.WixBundlePackageRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundleMsiPropertyTupleFields.PackageRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleMsiPropertyTupleFields.Name), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleMsiPropertyTupleFields.Value), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleMsiPropertyTupleFields.Condition), IntermediateFieldType.String), @@ -23,7 +23,7 @@ namespace WixToolset.Data.Tuples { public enum WixBundleMsiPropertyTupleFields { - WixBundlePackageRef, + PackageRef, Name, Value, Condition, @@ -41,10 +41,10 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundleMsiPropertyTupleFields index] => this.Fields[(int)index]; - public string WixBundlePackageRef + public string PackageRef { - get => (string)this.Fields[(int)WixBundleMsiPropertyTupleFields.WixBundlePackageRef]; - set => this.Set((int)WixBundleMsiPropertyTupleFields.WixBundlePackageRef, value); + get => (string)this.Fields[(int)WixBundleMsiPropertyTupleFields.PackageRef]; + set => this.Set((int)WixBundleMsiPropertyTupleFields.PackageRef, value); } public string Name diff --git a/src/WixToolset.Data/Tuples/WixBundleMspPackageTuple.cs b/src/WixToolset.Data/Tuples/WixBundleMspPackageTuple.cs index 8ef38fde..6c5cb38b 100644 --- a/src/WixToolset.Data/Tuples/WixBundleMspPackageTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundleMspPackageTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixBundleMspPackage, new[] { - new IntermediateFieldDefinition(nameof(WixBundleMspPackageTupleFields.WixBundlePackageRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleMspPackageTupleFields.Attributes), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(WixBundleMspPackageTupleFields.PatchCode), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleMspPackageTupleFields.Manufacturer), IntermediateFieldType.String), @@ -26,7 +25,6 @@ namespace WixToolset.Data.Tuples public enum WixBundleMspPackageTupleFields { - WixBundlePackageRef, Attributes, PatchCode, Manufacturer, @@ -53,12 +51,6 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundleMspPackageTupleFields index] => this.Fields[(int)index]; - public string WixBundlePackageRef - { - get => (string)this.Fields[(int)WixBundleMspPackageTupleFields.WixBundlePackageRef]; - set => this.Set((int)WixBundleMspPackageTupleFields.WixBundlePackageRef, value); - } - public WixBundleMspPackageAttributes Attributes { get => (WixBundleMspPackageAttributes)(int)this.Fields[(int)WixBundleMspPackageTupleFields.Attributes]; @@ -82,5 +74,11 @@ namespace WixToolset.Data.Tuples get => (string)this.Fields[(int)WixBundleMspPackageTupleFields.PatchXml]; set => this.Set((int)WixBundleMspPackageTupleFields.PatchXml, value); } + + public bool DisplayInternalUI => (this.Attributes & WixBundleMspPackageAttributes.DisplayInternalUI) == WixBundleMspPackageAttributes.DisplayInternalUI; + + public bool Slipstream => (this.Attributes & WixBundleMspPackageAttributes.Slipstream) == WixBundleMspPackageAttributes.Slipstream; + + public bool TargetUnspecified => (this.Attributes & WixBundleMspPackageAttributes.TargetUnspecified) == WixBundleMspPackageAttributes.TargetUnspecified; } } \ No newline at end of file diff --git a/src/WixToolset.Data/Tuples/WixBundleMsuPackageTuple.cs b/src/WixToolset.Data/Tuples/WixBundleMsuPackageTuple.cs index 33add8e9..5d5a4672 100644 --- a/src/WixToolset.Data/Tuples/WixBundleMsuPackageTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundleMsuPackageTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixBundleMsuPackage, new[] { - new IntermediateFieldDefinition(nameof(WixBundleMsuPackageTupleFields.WixBundlePackageRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleMsuPackageTupleFields.DetectCondition), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleMsuPackageTupleFields.MsuKB), IntermediateFieldType.String), }, @@ -22,7 +21,6 @@ namespace WixToolset.Data.Tuples { public enum WixBundleMsuPackageTupleFields { - WixBundlePackageRef, DetectCondition, MsuKB, } @@ -39,12 +37,6 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundleMsuPackageTupleFields index] => this.Fields[(int)index]; - public string WixBundlePackageRef - { - get => (string)this.Fields[(int)WixBundleMsuPackageTupleFields.WixBundlePackageRef]; - set => this.Set((int)WixBundleMsuPackageTupleFields.WixBundlePackageRef, value); - } - public string DetectCondition { get => (string)this.Fields[(int)WixBundleMsuPackageTupleFields.DetectCondition]; diff --git a/src/WixToolset.Data/Tuples/WixBundlePackageExitCodeTuple.cs b/src/WixToolset.Data/Tuples/WixBundlePackageExitCodeTuple.cs index 880f1f73..c585011d 100644 --- a/src/WixToolset.Data/Tuples/WixBundlePackageExitCodeTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundlePackageExitCodeTuple.cs @@ -56,9 +56,9 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundlePackageExitCodeTupleFields.ChainPackageId, value); } - public int Code + public int? Code { - get => (int)this.Fields[(int)WixBundlePackageExitCodeTupleFields.Code]; + get => (int?)this.Fields[(int)WixBundlePackageExitCodeTupleFields.Code]; set => this.Set((int)WixBundlePackageExitCodeTupleFields.Code, value); } @@ -68,4 +68,4 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundlePackageExitCodeTupleFields.Behavior, value.ToString()); } } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixBundlePackageTuple.cs b/src/WixToolset.Data/Tuples/WixBundlePackageTuple.cs index 07fdc2d5..d61e12d0 100644 --- a/src/WixToolset.Data/Tuples/WixBundlePackageTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundlePackageTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixBundlePackage, new[] { - new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.WixChainItemRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.Type), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.PayloadRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.Attributes), IntermediateFieldType.Number), @@ -22,14 +21,14 @@ namespace WixToolset.Data new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.LogPathVariable), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.RollbackLogPathVariable), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.Size), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.InstallSize), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.InstallSize), IntermediateFieldType.LargeNumber), new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.Version), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.Language), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.DisplayName), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.Description), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.RollbackBoundaryRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.RollbackBoundaryBackwardRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.Win64), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixBundlePackageTupleFields.Win64), IntermediateFieldType.Bool), }, typeof(WixBundlePackageTuple)); } @@ -41,7 +40,6 @@ namespace WixToolset.Data.Tuples public enum WixBundlePackageTupleFields { - WixChainItemRef, Type, PayloadRef, Attributes, @@ -79,6 +77,8 @@ namespace WixToolset.Data.Tuples { Permanent = 0x1, Visible = 0x2, + PerMachine = 0x4, + Win64 = 0x8, } public class WixBundlePackageTuple : IntermediateTuple @@ -93,12 +93,6 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundlePackageTupleFields index] => this.Fields[(int)index]; - public string WixChainItemRef - { - get => (string)this.Fields[(int)WixBundlePackageTupleFields.WixChainItemRef]; - set => this.Set((int)WixBundlePackageTupleFields.WixChainItemRef, value); - } - public WixBundlePackageType Type { get => (WixBundlePackageType)Enum.Parse(typeof(WixBundlePackageType), (string)this.Fields[(int)WixBundlePackageTupleFields.Type], true); @@ -165,9 +159,9 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundlePackageTupleFields.Size, value); } - public int InstallSize + public long? InstallSize { - get => (int)this.Fields[(int)WixBundlePackageTupleFields.InstallSize]; + get => (long?)this.Fields[(int)WixBundlePackageTupleFields.InstallSize]; set => this.Set((int)WixBundlePackageTupleFields.InstallSize, value); } @@ -207,10 +201,12 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundlePackageTupleFields.RollbackBoundaryBackwardRef, value); } - public int Win64 + public bool Win64 { - get => (int)this.Fields[(int)WixBundlePackageTupleFields.Win64]; + get => (bool)this.Fields[(int)WixBundlePackageTupleFields.Win64]; set => this.Set((int)WixBundlePackageTupleFields.Win64, value); } + + public bool Permanent => (this.Attributes & WixBundlePackageAttributes.Permanent) == WixBundlePackageAttributes.Permanent; } } \ No newline at end of file diff --git a/src/WixToolset.Data/Tuples/WixBundlePatchTargetCodeTuple.cs b/src/WixToolset.Data/Tuples/WixBundlePatchTargetCodeTuple.cs index f8752067..56ca144f 100644 --- a/src/WixToolset.Data/Tuples/WixBundlePatchTargetCodeTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundlePatchTargetCodeTuple.cs @@ -10,7 +10,7 @@ namespace WixToolset.Data TupleDefinitionType.WixBundlePatchTargetCode, new[] { - new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeTupleFields.PackageId), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeTupleFields.PackageRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeTupleFields.TargetCode), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePatchTargetCodeTupleFields.Attributes), IntermediateFieldType.Number), }, @@ -20,13 +20,31 @@ namespace WixToolset.Data namespace WixToolset.Data.Tuples { + using System; + public enum WixBundlePatchTargetCodeTupleFields { - PackageId, + PackageRef, TargetCode, Attributes, } + [Flags] + public enum WixBundlePatchTargetCodeAttributes : int + { + None = 0, + + /// + /// The transform targets a specific ProductCode. + /// + TargetsProductCode = 1, + + /// + /// The transform targets a specific UpgradeCode. + /// + TargetsUpgradeCode = 2, + } + public class WixBundlePatchTargetCodeTuple : IntermediateTuple { public WixBundlePatchTargetCodeTuple() : base(TupleDefinitions.WixBundlePatchTargetCode, null, null) @@ -39,10 +57,10 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundlePatchTargetCodeTupleFields index] => this.Fields[(int)index]; - public string PackageId + public string PackageRef { - get => (string)this.Fields[(int)WixBundlePatchTargetCodeTupleFields.PackageId]; - set => this.Set((int)WixBundlePatchTargetCodeTupleFields.PackageId, value); + get => (string)this.Fields[(int)WixBundlePatchTargetCodeTupleFields.PackageRef]; + set => this.Set((int)WixBundlePatchTargetCodeTupleFields.PackageRef, value); } public string TargetCode @@ -51,10 +69,14 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundlePatchTargetCodeTupleFields.TargetCode, value); } - public int Attributes + public WixBundlePatchTargetCodeAttributes Attributes { - get => (int)this.Fields[(int)WixBundlePatchTargetCodeTupleFields.Attributes]; - set => this.Set((int)WixBundlePatchTargetCodeTupleFields.Attributes, value); + get => (WixBundlePatchTargetCodeAttributes)this.Fields[(int)WixBundlePatchTargetCodeTupleFields.Attributes].AsNumber(); + set => this.Set((int)WixBundlePatchTargetCodeTupleFields.Attributes, (int)value); } + + public bool TargetsProductCode => (this.Attributes & WixBundlePatchTargetCodeAttributes.TargetsProductCode) == WixBundlePatchTargetCodeAttributes.TargetsProductCode; + + public bool TargetsUpgradeCode => (this.Attributes & WixBundlePatchTargetCodeAttributes.TargetsUpgradeCode) == WixBundlePatchTargetCodeAttributes.TargetsUpgradeCode; } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixBundlePayloadTuple.cs b/src/WixToolset.Data/Tuples/WixBundlePayloadTuple.cs index 5eb4a987..049ac3b5 100644 --- a/src/WixToolset.Data/Tuples/WixBundlePayloadTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundlePayloadTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixBundlePayload, new[] { - new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.WixBundlePayload), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.Name), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.SourceFile), IntermediateFieldType.Path), new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.DownloadUrl), IntermediateFieldType.String), @@ -26,10 +25,10 @@ namespace WixToolset.Data new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.Thumbprint), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.CatalogRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.ContainerRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.Package), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.PackageRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.ContentFile), IntermediateFieldType.Bool), new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.EmbeddedId), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.LayoutOnly), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.LayoutOnly), IntermediateFieldType.Bool), new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.Packaging), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(WixBundlePayloadTupleFields.ParentPackagePayloadRef), IntermediateFieldType.String), }, @@ -43,7 +42,6 @@ namespace WixToolset.Data.Tuples public enum WixBundlePayloadTupleFields { - WixBundlePayload, Name, SourceFile, DownloadUrl, @@ -59,7 +57,7 @@ namespace WixToolset.Data.Tuples Thumbprint, CatalogRef, ContainerRef, - Package, + PackageRef, ContentFile, EmbeddedId, LayoutOnly, @@ -79,21 +77,15 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundlePayloadTupleFields index] => this.Fields[(int)index]; - public string WixBundlePayload - { - get => (string)this.Fields[(int)WixBundlePayloadTupleFields.WixBundlePayload]; - set => this.Set((int)WixBundlePayloadTupleFields.WixBundlePayload, value); - } - public string Name { get => (string)this.Fields[(int)WixBundlePayloadTupleFields.Name]; set => this.Set((int)WixBundlePayloadTupleFields.Name, value); } - public string SourceFile + public IntermediateFieldPathValue SourceFile { - get => (string)this.Fields[(int)WixBundlePayloadTupleFields.SourceFile]; + get => this.Fields[(int)WixBundlePayloadTupleFields.SourceFile].AsPath(); set => this.Set((int)WixBundlePayloadTupleFields.SourceFile, value); } @@ -103,10 +95,10 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundlePayloadTupleFields.DownloadUrl, value); } - public YesNoDefaultType Compressed + public bool? Compressed { - get => Enum.TryParse((string)this.Fields[(int)WixBundlePayloadTupleFields.Compressed], true, out YesNoDefaultType value) ? value : YesNoDefaultType.NotSet; - set => this.Set((int)WixBundlePayloadTupleFields.Compressed, value.ToString().ToLowerInvariant()); + get => (bool?)this.Fields[(int)WixBundlePayloadTupleFields.Compressed]; + set => this.Set((int)WixBundlePayloadTupleFields.Compressed, value); } public string UnresolvedSourceFile @@ -175,10 +167,10 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundlePayloadTupleFields.ContainerRef, value); } - public string Package + public string PackageRef { - get => (string)this.Fields[(int)WixBundlePayloadTupleFields.Package]; - set => this.Set((int)WixBundlePayloadTupleFields.Package, value); + get => (string)this.Fields[(int)WixBundlePayloadTupleFields.PackageRef]; + set => this.Set((int)WixBundlePayloadTupleFields.PackageRef, value); } public bool ContentFile @@ -193,16 +185,16 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundlePayloadTupleFields.EmbeddedId, value); } - public int LayoutOnly + public bool LayoutOnly { - get => (int)this.Fields[(int)WixBundlePayloadTupleFields.LayoutOnly]; + get => (bool)this.Fields[(int)WixBundlePayloadTupleFields.LayoutOnly]; set => this.Set((int)WixBundlePayloadTupleFields.LayoutOnly, value); } - public int Packaging + public PackagingType Packaging { - get => (int)this.Fields[(int)WixBundlePayloadTupleFields.Packaging]; - set => this.Set((int)WixBundlePayloadTupleFields.Packaging, value); + get => (PackagingType)this.Fields[(int)WixBundlePayloadTupleFields.Packaging].AsNumber(); + set => this.Set((int)WixBundlePayloadTupleFields.Packaging, (int)value); } public string ParentPackagePayloadRef @@ -211,4 +203,4 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundlePayloadTupleFields.ParentPackagePayloadRef, value); } } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixBundlePropertiesTuple.cs b/src/WixToolset.Data/Tuples/WixBundlePropertiesTuple.cs deleted file mode 100644 index ae610aac..00000000 --- a/src/WixToolset.Data/Tuples/WixBundlePropertiesTuple.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Data -{ - using WixToolset.Data.Tuples; - - public static partial class TupleDefinitions - { - public static readonly IntermediateTupleDefinition WixBundleProperties = new IntermediateTupleDefinition( - TupleDefinitionType.WixBundleProperties, - new[] - { - new IntermediateFieldDefinition(nameof(WixBundlePropertiesTupleFields.DisplayName), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundlePropertiesTupleFields.LogPathVariable), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundlePropertiesTupleFields.Compressed), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundlePropertiesTupleFields.BundleId), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundlePropertiesTupleFields.UpgradeCode), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundlePropertiesTupleFields.PerMachine), IntermediateFieldType.String), - }, - typeof(WixBundlePropertiesTuple)); - } -} - -namespace WixToolset.Data.Tuples -{ - public enum WixBundlePropertiesTupleFields - { - DisplayName, - LogPathVariable, - Compressed, - BundleId, - UpgradeCode, - PerMachine, - } - - public class WixBundlePropertiesTuple : IntermediateTuple - { - public WixBundlePropertiesTuple() : base(TupleDefinitions.WixBundleProperties, null, null) - { - } - - public WixBundlePropertiesTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixBundleProperties, sourceLineNumber, id) - { - } - - public IntermediateField this[WixBundlePropertiesTupleFields index] => this.Fields[(int)index]; - - public string DisplayName - { - get => (string)this.Fields[(int)WixBundlePropertiesTupleFields.DisplayName]; - set => this.Set((int)WixBundlePropertiesTupleFields.DisplayName, value); - } - - public string LogPathVariable - { - get => (string)this.Fields[(int)WixBundlePropertiesTupleFields.LogPathVariable]; - set => this.Set((int)WixBundlePropertiesTupleFields.LogPathVariable, value); - } - - public string Compressed - { - get => (string)this.Fields[(int)WixBundlePropertiesTupleFields.Compressed]; - set => this.Set((int)WixBundlePropertiesTupleFields.Compressed, value); - } - - public string BundleId - { - get => (string)this.Fields[(int)WixBundlePropertiesTupleFields.BundleId]; - set => this.Set((int)WixBundlePropertiesTupleFields.BundleId, value); - } - - public string UpgradeCode - { - get => (string)this.Fields[(int)WixBundlePropertiesTupleFields.UpgradeCode]; - set => this.Set((int)WixBundlePropertiesTupleFields.UpgradeCode, value); - } - - public string PerMachine - { - get => (string)this.Fields[(int)WixBundlePropertiesTupleFields.PerMachine]; - set => this.Set((int)WixBundlePropertiesTupleFields.PerMachine, value); - } - } -} \ No newline at end of file diff --git a/src/WixToolset.Data/Tuples/WixBundleRelatedPackageTuple.cs b/src/WixToolset.Data/Tuples/WixBundleRelatedPackageTuple.cs index ef620b26..e9a087f3 100644 --- a/src/WixToolset.Data/Tuples/WixBundleRelatedPackageTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundleRelatedPackageTuple.cs @@ -10,14 +10,12 @@ namespace WixToolset.Data TupleDefinitionType.WixBundleRelatedPackage, new[] { + new IntermediateFieldDefinition(nameof(WixBundleRelatedPackageTupleFields.PackageRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleRelatedPackageTupleFields.RelatedId), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleRelatedPackageTupleFields.MinVersion), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleRelatedPackageTupleFields.MaxVersion), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleRelatedPackageTupleFields.Languages), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundleRelatedPackageTupleFields.MinInclusive), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(WixBundleRelatedPackageTupleFields.MaxInclusive), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(WixBundleRelatedPackageTupleFields.LangInclusive), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(WixBundleRelatedPackageTupleFields.OnlyDetect), IntermediateFieldType.Number), + new IntermediateFieldDefinition(nameof(WixBundleRelatedPackageTupleFields.Attributes), IntermediateFieldType.Number), }, typeof(WixBundleRelatedPackageTuple)); } @@ -25,16 +23,26 @@ namespace WixToolset.Data namespace WixToolset.Data.Tuples { + using System; + public enum WixBundleRelatedPackageTupleFields { + PackageRef, RelatedId, MinVersion, MaxVersion, Languages, - MinInclusive, - MaxInclusive, - LangInclusive, - OnlyDetect, + Attributes, + } + + [Flags] + public enum WixBundleRelatedPackageAttributes + { + None, + OnlyDetect = 0x1, + MinInclusive = 0x2, + MaxInclusive = 0x4, + LangInclusive = 0x8, } public class WixBundleRelatedPackageTuple : IntermediateTuple @@ -49,6 +57,12 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundleRelatedPackageTupleFields index] => this.Fields[(int)index]; + public string PackageRef + { + get => (string)this.Fields[(int)WixBundleRelatedPackageTupleFields.PackageRef]; + set => this.Set((int)WixBundleRelatedPackageTupleFields.PackageRef, value); + } + public string RelatedId { get => (string)this.Fields[(int)WixBundleRelatedPackageTupleFields.RelatedId]; @@ -73,28 +87,18 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundleRelatedPackageTupleFields.Languages, value); } - public int MinInclusive + public WixBundleRelatedPackageAttributes Attributes { - get => (int)this.Fields[(int)WixBundleRelatedPackageTupleFields.MinInclusive]; - set => this.Set((int)WixBundleRelatedPackageTupleFields.MinInclusive, value); + get => (WixBundleRelatedPackageAttributes)this.Fields[(int)WixBundleRelatedPackageTupleFields.Attributes].AsNumber(); + set => this.Set((int)WixBundleRelatedPackageTupleFields.Attributes, (int)value); } - public int MaxInclusive - { - get => (int)this.Fields[(int)WixBundleRelatedPackageTupleFields.MaxInclusive]; - set => this.Set((int)WixBundleRelatedPackageTupleFields.MaxInclusive, value); - } + public bool MinInclusive => (this.Attributes & WixBundleRelatedPackageAttributes.MinInclusive) == WixBundleRelatedPackageAttributes.MinInclusive; - public int LangInclusive - { - get => (int)this.Fields[(int)WixBundleRelatedPackageTupleFields.LangInclusive]; - set => this.Set((int)WixBundleRelatedPackageTupleFields.LangInclusive, value); - } + public bool MaxInclusive => (this.Attributes & WixBundleRelatedPackageAttributes.MaxInclusive) == WixBundleRelatedPackageAttributes.MaxInclusive; - public int OnlyDetect - { - get => (int)this.Fields[(int)WixBundleRelatedPackageTupleFields.OnlyDetect]; - set => this.Set((int)WixBundleRelatedPackageTupleFields.OnlyDetect, value); - } + public bool OnlyDetect => (this.Attributes & WixBundleRelatedPackageAttributes.OnlyDetect) == WixBundleRelatedPackageAttributes.OnlyDetect; + + public bool LangInclusive => (this.Attributes & WixBundleRelatedPackageAttributes.LangInclusive) == WixBundleRelatedPackageAttributes.LangInclusive; } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixBundleRollbackBoundaryTuple.cs b/src/WixToolset.Data/Tuples/WixBundleRollbackBoundaryTuple.cs index a11c972d..648787f9 100644 --- a/src/WixToolset.Data/Tuples/WixBundleRollbackBoundaryTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundleRollbackBoundaryTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixBundleRollbackBoundary, new[] { - new IntermediateFieldDefinition(nameof(WixBundleRollbackBoundaryTupleFields.WixChainItemRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleRollbackBoundaryTupleFields.Vital), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(WixBundleRollbackBoundaryTupleFields.Transaction), IntermediateFieldType.Number), }, @@ -22,7 +21,6 @@ namespace WixToolset.Data.Tuples { public enum WixBundleRollbackBoundaryTupleFields { - WixChainItemRef, Vital, Transaction, } @@ -39,12 +37,6 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundleRollbackBoundaryTupleFields index] => this.Fields[(int)index]; - public string WixChainItemRef - { - get => (string)this.Fields[(int)WixBundleRollbackBoundaryTupleFields.WixChainItemRef]; - set => this.Set((int)WixBundleRollbackBoundaryTupleFields.WixChainItemRef, value); - } - public bool? Vital { get => (bool?)this.Fields[(int)WixBundleRollbackBoundaryTupleFields.Vital]; diff --git a/src/WixToolset.Data/Tuples/WixBundleSlipstreamMspTuple.cs b/src/WixToolset.Data/Tuples/WixBundleSlipstreamMspTuple.cs index 3a028d16..bfe8c6e1 100644 --- a/src/WixToolset.Data/Tuples/WixBundleSlipstreamMspTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundleSlipstreamMspTuple.cs @@ -10,8 +10,8 @@ namespace WixToolset.Data TupleDefinitionType.WixBundleSlipstreamMsp, new[] { - new IntermediateFieldDefinition(nameof(WixBundleSlipstreamMspTupleFields.WixBundlePackageRef), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundleSlipstreamMspTupleFields.MspWixBundlePackageRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundleSlipstreamMspTupleFields.TargetPackageRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundleSlipstreamMspTupleFields.MspPackageRef), IntermediateFieldType.String), }, typeof(WixBundleSlipstreamMspTuple)); } @@ -21,8 +21,8 @@ namespace WixToolset.Data.Tuples { public enum WixBundleSlipstreamMspTupleFields { - WixBundlePackageRef, - MspWixBundlePackageRef, + TargetPackageRef, + MspPackageRef, } public class WixBundleSlipstreamMspTuple : IntermediateTuple @@ -37,16 +37,16 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundleSlipstreamMspTupleFields index] => this.Fields[(int)index]; - public string WixBundlePackageRef + public string TargetPackageRef { - get => (string)this.Fields[(int)WixBundleSlipstreamMspTupleFields.WixBundlePackageRef]; - set => this.Set((int)WixBundleSlipstreamMspTupleFields.WixBundlePackageRef, value); + get => (string)this.Fields[(int)WixBundleSlipstreamMspTupleFields.TargetPackageRef]; + set => this.Set((int)WixBundleSlipstreamMspTupleFields.TargetPackageRef, value); } - public string MspWixBundlePackageRef + public string MspPackageRef { - get => (string)this.Fields[(int)WixBundleSlipstreamMspTupleFields.MspWixBundlePackageRef]; - set => this.Set((int)WixBundleSlipstreamMspTupleFields.MspWixBundlePackageRef, value); + get => (string)this.Fields[(int)WixBundleSlipstreamMspTupleFields.MspPackageRef]; + set => this.Set((int)WixBundleSlipstreamMspTupleFields.MspPackageRef, value); } } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixBundleTuple.cs b/src/WixToolset.Data/Tuples/WixBundleTuple.cs index 8f6f760a..dcaea6bc 100644 --- a/src/WixToolset.Data/Tuples/WixBundleTuple.cs +++ b/src/WixToolset.Data/Tuples/WixBundleTuple.cs @@ -10,29 +10,28 @@ namespace WixToolset.Data TupleDefinitionType.WixBundle, new[] { + new IntermediateFieldDefinition(nameof(WixBundleTupleFields.UpgradeCode), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.Version), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.Copyright), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.Name), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundleTupleFields.Manufacturer), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundleTupleFields.Attributes), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.AboutUrl), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundleTupleFields.DisableModify), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(WixBundleTupleFields.DisableRemove), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(WixBundleTupleFields.DisableRepair), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(WixBundleTupleFields.HelpTelephone), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.HelpUrl), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundleTupleFields.Manufacturer), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundleTupleFields.HelpTelephone), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.UpdateUrl), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundleTupleFields.Compressed), IntermediateFieldType.Number), - new IntermediateFieldDefinition(nameof(WixBundleTupleFields.LogPrefixAndExtension), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundleTupleFields.Compressed), IntermediateFieldType.Bool), + new IntermediateFieldDefinition(nameof(WixBundleTupleFields.LogPathVariable), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundleTupleFields.LogPrefix), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixBundleTupleFields.LogExtension), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.IconSourceFile), IntermediateFieldType.Path), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.SplashScreenSourceFile), IntermediateFieldType.Path), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.Condition), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.Tag), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.Platform), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.ParentName), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundleTupleFields.UpgradeCode), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.BundleId), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixBundleTupleFields.ProviderKey), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixBundleTupleFields.PerMachine), IntermediateFieldType.Bool), }, typeof(WixBundleTuple)); } @@ -40,30 +39,41 @@ namespace WixToolset.Data namespace WixToolset.Data.Tuples { + using System; + public enum WixBundleTupleFields { + UpgradeCode, Version, Copyright, Name, + Manufacturer, + Attributes, AboutUrl, - DisableModify, - DisableRemove, - DisableRepair, - HelpTelephone, HelpUrl, - Manufacturer, + HelpTelephone, UpdateUrl, Compressed, - LogPrefixAndExtension, + LogPathVariable, + LogPrefix, + LogExtension, IconSourceFile, SplashScreenSourceFile, Condition, Tag, Platform, ParentName, - UpgradeCode, BundleId, ProviderKey, + } + + [Flags] + public enum WixBundleAttributes + { + None, + DisableModify, + DisableRemove, + SingleChangeUninstallButton, PerMachine, } @@ -79,6 +89,12 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixBundleTupleFields index] => this.Fields[(int)index]; + public string UpgradeCode + { + get => (string)this.Fields[(int)WixBundleTupleFields.UpgradeCode]; + set => this.Set((int)WixBundleTupleFields.UpgradeCode, value); + } + public string Version { get => (string)this.Fields[(int)WixBundleTupleFields.Version]; @@ -97,28 +113,22 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundleTupleFields.Name, value); } - public string AboutUrl - { - get => (string)this.Fields[(int)WixBundleTupleFields.AboutUrl]; - set => this.Set((int)WixBundleTupleFields.AboutUrl, value); - } - - public int DisableModify + public string Manufacturer { - get => (int)this.Fields[(int)WixBundleTupleFields.DisableModify]; - set => this.Set((int)WixBundleTupleFields.DisableModify, value); + get => (string)this.Fields[(int)WixBundleTupleFields.Manufacturer]; + set => this.Set((int)WixBundleTupleFields.Manufacturer, value); } - public int DisableRemove + public WixBundleAttributes Attributes { - get => (int)this.Fields[(int)WixBundleTupleFields.DisableRemove]; - set => this.Set((int)WixBundleTupleFields.DisableRemove, value); + get => (WixBundleAttributes)this.Fields[(int)WixBundleTupleFields.Attributes].AsNumber(); + set => this.Set((int)WixBundleTupleFields.Attributes, (int)value); } - public int DisableRepair + public string AboutUrl { - get => (int)this.Fields[(int)WixBundleTupleFields.DisableRepair]; - set => this.Set((int)WixBundleTupleFields.DisableRepair, value); + get => (string)this.Fields[(int)WixBundleTupleFields.AboutUrl]; + set => this.Set((int)WixBundleTupleFields.AboutUrl, value); } public string HelpTelephone @@ -133,28 +143,34 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundleTupleFields.HelpUrl, value); } - public string Manufacturer - { - get => (string)this.Fields[(int)WixBundleTupleFields.Manufacturer]; - set => this.Set((int)WixBundleTupleFields.Manufacturer, value); - } - public string UpdateUrl { get => (string)this.Fields[(int)WixBundleTupleFields.UpdateUrl]; set => this.Set((int)WixBundleTupleFields.UpdateUrl, value); } - public int Compressed + public bool? Compressed { - get => (int)this.Fields[(int)WixBundleTupleFields.Compressed]; + get => (bool?)this.Fields[(int)WixBundleTupleFields.Compressed]; set => this.Set((int)WixBundleTupleFields.Compressed, value); } - public string LogPrefixAndExtension + public string LogPathVariable { - get => (string)this.Fields[(int)WixBundleTupleFields.LogPrefixAndExtension]; - set => this.Set((int)WixBundleTupleFields.LogPrefixAndExtension, value); + get => (string)this.Fields[(int)WixBundleTupleFields.LogPathVariable]; + set => this.Set((int)WixBundleTupleFields.LogPathVariable, value); + } + + public string LogPrefix + { + get => (string)this.Fields[(int)WixBundleTupleFields.LogPrefix]; + set => this.Set((int)WixBundleTupleFields.LogPrefix, value); + } + + public string LogExtension + { + get => (string)this.Fields[(int)WixBundleTupleFields.LogExtension]; + set => this.Set((int)WixBundleTupleFields.LogExtension, value); } public string IconSourceFile @@ -181,10 +197,10 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundleTupleFields.Tag, value); } - public string Platform + public Platform Platform { - get => (string)this.Fields[(int)WixBundleTupleFields.Platform]; - set => this.Set((int)WixBundleTupleFields.Platform, value); + get => (Platform)this.Fields[(int)WixBundleTupleFields.Platform].AsNumber(); + set => this.Set((int)WixBundleTupleFields.Platform, (int)value); } public string ParentName @@ -193,12 +209,6 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundleTupleFields.ParentName, value); } - public string UpgradeCode - { - get => (string)this.Fields[(int)WixBundleTupleFields.UpgradeCode]; - set => this.Set((int)WixBundleTupleFields.UpgradeCode, value); - } - public string BundleId { get => (string)this.Fields[(int)WixBundleTupleFields.BundleId]; @@ -211,10 +221,14 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixBundleTupleFields.ProviderKey, value); } - public bool PerMachine - { - get => (bool)this.Fields[(int)WixBundleTupleFields.PerMachine]; - set => this.Set((int)WixBundleTupleFields.PerMachine, value); - } + public PackagingType DefaultPackagingType => (this.Compressed.HasValue && !this.Compressed.Value) ? PackagingType.External : PackagingType.Embedded; + + public bool DisableModify => (this.Attributes & WixBundleAttributes.DisableModify) == WixBundleAttributes.DisableModify; + + public bool DisableRemove => (this.Attributes & WixBundleAttributes.DisableRemove) == WixBundleAttributes.DisableRemove; + + public bool PerMachine => (this.Attributes & WixBundleAttributes.PerMachine) == WixBundleAttributes.PerMachine; + + public bool SingleChangeUninstallButton => (this.Attributes & WixBundleAttributes.SingleChangeUninstallButton) == WixBundleAttributes.SingleChangeUninstallButton; } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixChainTuple.cs b/src/WixToolset.Data/Tuples/WixChainTuple.cs index d8bef8cc..9343ead1 100644 --- a/src/WixToolset.Data/Tuples/WixChainTuple.cs +++ b/src/WixToolset.Data/Tuples/WixChainTuple.cs @@ -51,5 +51,11 @@ namespace WixToolset.Data.Tuples get => (WixChainAttributes)(int)this.Fields[(int)WixChainTupleFields.Attributes]; set => this.Set((int)WixChainTupleFields.Attributes, (int)value); } + + public bool DisableRollback => (this.Attributes & WixChainAttributes.DisableRollback) == WixChainAttributes.DisableRollback; + + public bool DisableSystemRestore => (this.Attributes & WixChainAttributes.DisableSystemRestore) == WixChainAttributes.DisableSystemRestore; + + public bool ParallelCache => (this.Attributes & WixChainAttributes.ParallelCache) == WixChainAttributes.ParallelCache; } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixComponentSearchTuple.cs b/src/WixToolset.Data/Tuples/WixComponentSearchTuple.cs index 47cccf25..de6f47b9 100644 --- a/src/WixToolset.Data/Tuples/WixComponentSearchTuple.cs +++ b/src/WixToolset.Data/Tuples/WixComponentSearchTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixComponentSearch, new[] { - new IntermediateFieldDefinition(nameof(WixComponentSearchTupleFields.WixSearchRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixComponentSearchTupleFields.Guid), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixComponentSearchTupleFields.ProductCode), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixComponentSearchTupleFields.Attributes), IntermediateFieldType.Number), @@ -21,14 +20,23 @@ namespace WixToolset.Data namespace WixToolset.Data.Tuples { + using System; + public enum WixComponentSearchTupleFields { - WixSearchRef, Guid, ProductCode, Attributes, } + [Flags] + public enum WixComponentSearchAttributes + { + KeyPath = 0x1, + State = 0x2, + WantDirectory = 0x4, + } + public class WixComponentSearchTuple : IntermediateTuple { public WixComponentSearchTuple() : base(TupleDefinitions.WixComponentSearch, null, null) @@ -41,12 +49,6 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixComponentSearchTupleFields index] => this.Fields[(int)index]; - public string WixSearchRef - { - get => (string)this.Fields[(int)WixComponentSearchTupleFields.WixSearchRef]; - set => this.Set((int)WixComponentSearchTupleFields.WixSearchRef, value); - } - public string Guid { get => (string)this.Fields[(int)WixComponentSearchTupleFields.Guid]; @@ -59,10 +61,10 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixComponentSearchTupleFields.ProductCode, value); } - public int Attributes + public WixComponentSearchAttributes Attributes { - get => (int)this.Fields[(int)WixComponentSearchTupleFields.Attributes]; - set => this.Set((int)WixComponentSearchTupleFields.Attributes, value); + get => (WixComponentSearchAttributes)this.Fields[(int)WixComponentSearchTupleFields.Attributes].AsNumber(); + set => this.Set((int)WixComponentSearchTupleFields.Attributes, (int)value); } } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixDependencyProviderTuple.cs b/src/WixToolset.Data/Tuples/WixDependencyProviderTuple.cs new file mode 100644 index 00000000..1953594e --- /dev/null +++ b/src/WixToolset.Data/Tuples/WixDependencyProviderTuple.cs @@ -0,0 +1,87 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. + +namespace WixToolset.Data +{ + using WixToolset.Data.Tuples; + + public static partial class TupleDefinitions + { + public static readonly IntermediateTupleDefinition WixDependencyProvider = new IntermediateTupleDefinition( + TupleDefinitionType.WixDependencyProvider.ToString(), + new[] + { + new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.ComponentRef), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.ProviderKey), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.Version), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.DisplayName), IntermediateFieldType.String), + new IntermediateFieldDefinition(nameof(WixDependencyProviderTupleFields.Attributes), IntermediateFieldType.Number), + }, + typeof(WixDependencyProviderTuple)); + } +} + +namespace WixToolset.Data.Tuples +{ + using System; + using WixToolset.Data; + + public enum WixDependencyProviderTupleFields + { + ComponentRef, + ProviderKey, + Version, + DisplayName, + Attributes, + } + + [Flags] + public enum WixDependencyProviderAttributes + { + ProvidesAttributesBundle = 0x10000 + } + + public class WixDependencyProviderTuple : IntermediateTuple + { + public WixDependencyProviderTuple() : base(TupleDefinitions.WixDependencyProvider, null, null) + { + } + + public WixDependencyProviderTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixDependencyProvider, sourceLineNumber, id) + { + } + + public IntermediateField this[WixDependencyProviderTupleFields index] => this.Fields[(int)index]; + + public string ComponentRef + { + get => this.Fields[(int)WixDependencyProviderTupleFields.ComponentRef].AsString(); + set => this.Set((int)WixDependencyProviderTupleFields.ComponentRef, value); + } + + public string ProviderKey + { + get => this.Fields[(int)WixDependencyProviderTupleFields.ProviderKey].AsString(); + set => this.Set((int)WixDependencyProviderTupleFields.ProviderKey, value); + } + + public string Version + { + get => this.Fields[(int)WixDependencyProviderTupleFields.Version].AsString(); + set => this.Set((int)WixDependencyProviderTupleFields.Version, value); + } + + public string DisplayName + { + get => this.Fields[(int)WixDependencyProviderTupleFields.DisplayName].AsString(); + set => this.Set((int)WixDependencyProviderTupleFields.DisplayName, value); + } + + public WixDependencyProviderAttributes Attributes + { + get => (WixDependencyProviderAttributes)(int)this.Fields[(int)WixDependencyProviderTupleFields.Attributes]; + set => this.Set((int)WixDependencyProviderTupleFields.Attributes, (int)value); + } + + public bool Bundle => (this.Attributes & WixDependencyProviderAttributes.ProvidesAttributesBundle) == WixDependencyProviderAttributes.ProvidesAttributesBundle; + } +} diff --git a/src/WixToolset.Data/Tuples/WixFileSearchTuple.cs b/src/WixToolset.Data/Tuples/WixFileSearchTuple.cs index 27c5cc83..4c0cedf3 100644 --- a/src/WixToolset.Data/Tuples/WixFileSearchTuple.cs +++ b/src/WixToolset.Data/Tuples/WixFileSearchTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixFileSearch, new[] { - new IntermediateFieldDefinition(nameof(WixFileSearchTupleFields.WixSearchRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixFileSearchTupleFields.Path), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixFileSearchTupleFields.MinVersion), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixFileSearchTupleFields.MaxVersion), IntermediateFieldType.String), @@ -27,9 +26,10 @@ namespace WixToolset.Data namespace WixToolset.Data.Tuples { + using System; + public enum WixFileSearchTupleFields { - WixSearchRef, Path, MinVersion, MaxVersion, @@ -41,6 +41,21 @@ namespace WixToolset.Data.Tuples Attributes, } + [Flags] + public enum WixFileSearchAttributes + { + Default = 0x001, + MinVersionInclusive = 0x002, + MaxVersionInclusive = 0x004, + MinSizeInclusive = 0x008, + MaxSizeInclusive = 0x010, + MinDateInclusive = 0x020, + MaxDateInclusive = 0x040, + WantVersion = 0x080, + WantExists = 0x100, + IsDirectory = 0x200, + } + public class WixFileSearchTuple : IntermediateTuple { public WixFileSearchTuple() : base(TupleDefinitions.WixFileSearch, null, null) @@ -53,12 +68,6 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixFileSearchTupleFields index] => this.Fields[(int)index]; - public string WixSearchRef - { - get => (string)this.Fields[(int)WixFileSearchTupleFields.WixSearchRef]; - set => this.Set((int)WixFileSearchTupleFields.WixSearchRef, value); - } - public string Path { get => (string)this.Fields[(int)WixFileSearchTupleFields.Path]; @@ -107,10 +116,10 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixFileSearchTupleFields.Languages, value); } - public int Attributes + public WixFileSearchAttributes Attributes { - get => (int)this.Fields[(int)WixFileSearchTupleFields.Attributes]; - set => this.Set((int)WixFileSearchTupleFields.Attributes, value); + get => (WixFileSearchAttributes)this.Fields[(int)WixFileSearchTupleFields.Attributes].AsNumber(); + set => this.Set((int)WixFileSearchTupleFields.Attributes, (int)value); } } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixPackageFeatureInfoTuple.cs b/src/WixToolset.Data/Tuples/WixPackageFeatureInfoTuple.cs deleted file mode 100644 index bcc0ad78..00000000 --- a/src/WixToolset.Data/Tuples/WixPackageFeatureInfoTuple.cs +++ /dev/null @@ -1,116 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Data -{ - using WixToolset.Data.Tuples; - - public static partial class TupleDefinitions - { - public static readonly IntermediateTupleDefinition WixPackageFeatureInfo = new IntermediateTupleDefinition( - TupleDefinitionType.WixPackageFeatureInfo, - new[] - { - new IntermediateFieldDefinition(nameof(WixPackageFeatureInfoTupleFields.Package), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackageFeatureInfoTupleFields.Feature), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackageFeatureInfoTupleFields.Size), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackageFeatureInfoTupleFields.Parent), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackageFeatureInfoTupleFields.Title), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackageFeatureInfoTupleFields.Description), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackageFeatureInfoTupleFields.Display), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackageFeatureInfoTupleFields.Level), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackageFeatureInfoTupleFields.Directory), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackageFeatureInfoTupleFields.Attributes), IntermediateFieldType.String), - }, - typeof(WixPackageFeatureInfoTuple)); - } -} - -namespace WixToolset.Data.Tuples -{ - public enum WixPackageFeatureInfoTupleFields - { - Package, - Feature, - Size, - Parent, - Title, - Description, - Display, - Level, - Directory, - Attributes, - } - - public class WixPackageFeatureInfoTuple : IntermediateTuple - { - public WixPackageFeatureInfoTuple() : base(TupleDefinitions.WixPackageFeatureInfo, null, null) - { - } - - public WixPackageFeatureInfoTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixPackageFeatureInfo, sourceLineNumber, id) - { - } - - public IntermediateField this[WixPackageFeatureInfoTupleFields index] => this.Fields[(int)index]; - - public string Package - { - get => (string)this.Fields[(int)WixPackageFeatureInfoTupleFields.Package]; - set => this.Set((int)WixPackageFeatureInfoTupleFields.Package, value); - } - - public string Feature - { - get => (string)this.Fields[(int)WixPackageFeatureInfoTupleFields.Feature]; - set => this.Set((int)WixPackageFeatureInfoTupleFields.Feature, value); - } - - public string Size - { - get => (string)this.Fields[(int)WixPackageFeatureInfoTupleFields.Size]; - set => this.Set((int)WixPackageFeatureInfoTupleFields.Size, value); - } - - public string Parent - { - get => (string)this.Fields[(int)WixPackageFeatureInfoTupleFields.Parent]; - set => this.Set((int)WixPackageFeatureInfoTupleFields.Parent, value); - } - - public string Title - { - get => (string)this.Fields[(int)WixPackageFeatureInfoTupleFields.Title]; - set => this.Set((int)WixPackageFeatureInfoTupleFields.Title, value); - } - - public string Description - { - get => (string)this.Fields[(int)WixPackageFeatureInfoTupleFields.Description]; - set => this.Set((int)WixPackageFeatureInfoTupleFields.Description, value); - } - - public string Display - { - get => (string)this.Fields[(int)WixPackageFeatureInfoTupleFields.Display]; - set => this.Set((int)WixPackageFeatureInfoTupleFields.Display, value); - } - - public string Level - { - get => (string)this.Fields[(int)WixPackageFeatureInfoTupleFields.Level]; - set => this.Set((int)WixPackageFeatureInfoTupleFields.Level, value); - } - - public string Directory - { - get => (string)this.Fields[(int)WixPackageFeatureInfoTupleFields.Directory]; - set => this.Set((int)WixPackageFeatureInfoTupleFields.Directory, value); - } - - public string Attributes - { - get => (string)this.Fields[(int)WixPackageFeatureInfoTupleFields.Attributes]; - set => this.Set((int)WixPackageFeatureInfoTupleFields.Attributes, value); - } - } -} \ No newline at end of file diff --git a/src/WixToolset.Data/Tuples/WixPackagePropertiesTuple.cs b/src/WixToolset.Data/Tuples/WixPackagePropertiesTuple.cs deleted file mode 100644 index 56f6523b..00000000 --- a/src/WixToolset.Data/Tuples/WixPackagePropertiesTuple.cs +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Data -{ - using WixToolset.Data.Tuples; - - public static partial class TupleDefinitions - { - public static readonly IntermediateTupleDefinition WixPackageProperties = new IntermediateTupleDefinition( - TupleDefinitionType.WixPackageProperties, - new[] - { - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.Package), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.Vital), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.DisplayName), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.Description), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.DownloadSize), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.PackageSize), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.InstalledSize), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.PackageType), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.Permanent), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.LogPathVariable), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.RollbackLogPathVariable), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.Compressed), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.DisplayInternalUI), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.ProductCode), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.UpgradeCode), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.Version), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.InstallCondition), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPackagePropertiesTupleFields.Cache), IntermediateFieldType.String), - }, - typeof(WixPackagePropertiesTuple)); - } -} - -namespace WixToolset.Data.Tuples -{ - public enum WixPackagePropertiesTupleFields - { - Package, - Vital, - DisplayName, - Description, - DownloadSize, - PackageSize, - InstalledSize, - PackageType, - Permanent, - LogPathVariable, - RollbackLogPathVariable, - Compressed, - DisplayInternalUI, - ProductCode, - UpgradeCode, - Version, - InstallCondition, - Cache, - } - - public class WixPackagePropertiesTuple : IntermediateTuple - { - public WixPackagePropertiesTuple() : base(TupleDefinitions.WixPackageProperties, null, null) - { - } - - public WixPackagePropertiesTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixPackageProperties, sourceLineNumber, id) - { - } - - public IntermediateField this[WixPackagePropertiesTupleFields index] => this.Fields[(int)index]; - - public string Package - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.Package]; - set => this.Set((int)WixPackagePropertiesTupleFields.Package, value); - } - - public string Vital - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.Vital]; - set => this.Set((int)WixPackagePropertiesTupleFields.Vital, value); - } - - public string DisplayName - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.DisplayName]; - set => this.Set((int)WixPackagePropertiesTupleFields.DisplayName, value); - } - - public string Description - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.Description]; - set => this.Set((int)WixPackagePropertiesTupleFields.Description, value); - } - - public string DownloadSize - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.DownloadSize]; - set => this.Set((int)WixPackagePropertiesTupleFields.DownloadSize, value); - } - - public string PackageSize - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.PackageSize]; - set => this.Set((int)WixPackagePropertiesTupleFields.PackageSize, value); - } - - public string InstalledSize - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.InstalledSize]; - set => this.Set((int)WixPackagePropertiesTupleFields.InstalledSize, value); - } - - public string PackageType - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.PackageType]; - set => this.Set((int)WixPackagePropertiesTupleFields.PackageType, value); - } - - public string Permanent - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.Permanent]; - set => this.Set((int)WixPackagePropertiesTupleFields.Permanent, value); - } - - public string LogPathVariable - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.LogPathVariable]; - set => this.Set((int)WixPackagePropertiesTupleFields.LogPathVariable, value); - } - - public string RollbackLogPathVariable - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.RollbackLogPathVariable]; - set => this.Set((int)WixPackagePropertiesTupleFields.RollbackLogPathVariable, value); - } - - public string Compressed - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.Compressed]; - set => this.Set((int)WixPackagePropertiesTupleFields.Compressed, value); - } - - public string DisplayInternalUI - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.DisplayInternalUI]; - set => this.Set((int)WixPackagePropertiesTupleFields.DisplayInternalUI, value); - } - - public string ProductCode - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.ProductCode]; - set => this.Set((int)WixPackagePropertiesTupleFields.ProductCode, value); - } - - public string UpgradeCode - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.UpgradeCode]; - set => this.Set((int)WixPackagePropertiesTupleFields.UpgradeCode, value); - } - - public string Version - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.Version]; - set => this.Set((int)WixPackagePropertiesTupleFields.Version, value); - } - - public string InstallCondition - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.InstallCondition]; - set => this.Set((int)WixPackagePropertiesTupleFields.InstallCondition, value); - } - - public string Cache - { - get => (string)this.Fields[(int)WixPackagePropertiesTupleFields.Cache]; - set => this.Set((int)WixPackagePropertiesTupleFields.Cache, value); - } - } -} \ No newline at end of file diff --git a/src/WixToolset.Data/Tuples/WixPayloadPropertiesTuple.cs b/src/WixToolset.Data/Tuples/WixPayloadPropertiesTuple.cs deleted file mode 100644 index c992bb4f..00000000 --- a/src/WixToolset.Data/Tuples/WixPayloadPropertiesTuple.cs +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Data -{ - using WixToolset.Data.Tuples; - - public static partial class TupleDefinitions - { - public static readonly IntermediateTupleDefinition WixPayloadProperties = new IntermediateTupleDefinition( - TupleDefinitionType.WixPayloadProperties, - new[] - { - new IntermediateFieldDefinition(nameof(WixPayloadPropertiesTupleFields.Payload), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPayloadPropertiesTupleFields.Package), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPayloadPropertiesTupleFields.Container), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPayloadPropertiesTupleFields.Name), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPayloadPropertiesTupleFields.Size), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPayloadPropertiesTupleFields.DownloadUrl), IntermediateFieldType.String), - new IntermediateFieldDefinition(nameof(WixPayloadPropertiesTupleFields.LayoutOnly), IntermediateFieldType.String), - }, - typeof(WixPayloadPropertiesTuple)); - } -} - -namespace WixToolset.Data.Tuples -{ - public enum WixPayloadPropertiesTupleFields - { - Payload, - Package, - Container, - Name, - Size, - DownloadUrl, - LayoutOnly, - } - - public class WixPayloadPropertiesTuple : IntermediateTuple - { - public WixPayloadPropertiesTuple() : base(TupleDefinitions.WixPayloadProperties, null, null) - { - } - - public WixPayloadPropertiesTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(TupleDefinitions.WixPayloadProperties, sourceLineNumber, id) - { - } - - public IntermediateField this[WixPayloadPropertiesTupleFields index] => this.Fields[(int)index]; - - public string Payload - { - get => (string)this.Fields[(int)WixPayloadPropertiesTupleFields.Payload]; - set => this.Set((int)WixPayloadPropertiesTupleFields.Payload, value); - } - - public string Package - { - get => (string)this.Fields[(int)WixPayloadPropertiesTupleFields.Package]; - set => this.Set((int)WixPayloadPropertiesTupleFields.Package, value); - } - - public string Container - { - get => (string)this.Fields[(int)WixPayloadPropertiesTupleFields.Container]; - set => this.Set((int)WixPayloadPropertiesTupleFields.Container, value); - } - - public string Name - { - get => (string)this.Fields[(int)WixPayloadPropertiesTupleFields.Name]; - set => this.Set((int)WixPayloadPropertiesTupleFields.Name, value); - } - - public string Size - { - get => (string)this.Fields[(int)WixPayloadPropertiesTupleFields.Size]; - set => this.Set((int)WixPayloadPropertiesTupleFields.Size, value); - } - - public string DownloadUrl - { - get => (string)this.Fields[(int)WixPayloadPropertiesTupleFields.DownloadUrl]; - set => this.Set((int)WixPayloadPropertiesTupleFields.DownloadUrl, value); - } - - public string LayoutOnly - { - get => (string)this.Fields[(int)WixPayloadPropertiesTupleFields.LayoutOnly]; - set => this.Set((int)WixPayloadPropertiesTupleFields.LayoutOnly, value); - } - } -} \ No newline at end of file diff --git a/src/WixToolset.Data/Tuples/WixProductSearchTuple.cs b/src/WixToolset.Data/Tuples/WixProductSearchTuple.cs index 4a13f47d..22e96365 100644 --- a/src/WixToolset.Data/Tuples/WixProductSearchTuple.cs +++ b/src/WixToolset.Data/Tuples/WixProductSearchTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixProductSearch, new[] { - new IntermediateFieldDefinition(nameof(WixProductSearchTupleFields.WixSearchRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixProductSearchTupleFields.Guid), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixProductSearchTupleFields.Attributes), IntermediateFieldType.Number), }, @@ -20,13 +19,24 @@ namespace WixToolset.Data namespace WixToolset.Data.Tuples { + using System; + public enum WixProductSearchTupleFields { - WixSearchRef, Guid, Attributes, } + [Flags] + public enum WixProductSearchAttributes + { + Version = 0x1, + Language = 0x2, + State = 0x4, + Assignment = 0x8, + UpgradeCode = 0x10, + } + public class WixProductSearchTuple : IntermediateTuple { public WixProductSearchTuple() : base(TupleDefinitions.WixProductSearch, null, null) @@ -39,22 +49,16 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixProductSearchTupleFields index] => this.Fields[(int)index]; - public string WixSearchRef - { - get => (string)this.Fields[(int)WixProductSearchTupleFields.WixSearchRef]; - set => this.Set((int)WixProductSearchTupleFields.WixSearchRef, value); - } - public string Guid { get => (string)this.Fields[(int)WixProductSearchTupleFields.Guid]; set => this.Set((int)WixProductSearchTupleFields.Guid, value); } - public int Attributes + public WixProductSearchAttributes Attributes { - get => (int)this.Fields[(int)WixProductSearchTupleFields.Attributes]; - set => this.Set((int)WixProductSearchTupleFields.Attributes, value); + get => (WixProductSearchAttributes)this.Fields[(int)WixProductSearchTupleFields.Attributes].AsNumber(); + set => this.Set((int)WixProductSearchTupleFields.Attributes, (int)value); } } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/Tuples/WixRegistrySearchTuple.cs b/src/WixToolset.Data/Tuples/WixRegistrySearchTuple.cs index c88d6982..6bf43a00 100644 --- a/src/WixToolset.Data/Tuples/WixRegistrySearchTuple.cs +++ b/src/WixToolset.Data/Tuples/WixRegistrySearchTuple.cs @@ -10,7 +10,6 @@ namespace WixToolset.Data TupleDefinitionType.WixRegistrySearch, new[] { - new IntermediateFieldDefinition(nameof(WixRegistrySearchTupleFields.WixSearchRef), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixRegistrySearchTupleFields.Root), IntermediateFieldType.Number), new IntermediateFieldDefinition(nameof(WixRegistrySearchTupleFields.Key), IntermediateFieldType.String), new IntermediateFieldDefinition(nameof(WixRegistrySearchTupleFields.Value), IntermediateFieldType.String), @@ -22,15 +21,27 @@ namespace WixToolset.Data namespace WixToolset.Data.Tuples { + using System; + public enum WixRegistrySearchTupleFields { - WixSearchRef, Root, Key, Value, Attributes, } + [Flags] + public enum WixRegistrySearchAttributes + { + Raw = 0x01, + Compatible = 0x02, + ExpandEnvironmentVariables = 0x04, + WantValue = 0x08, + WantExists = 0x10, + Win64 = 0x20, + } + public class WixRegistrySearchTuple : IntermediateTuple { public WixRegistrySearchTuple() : base(TupleDefinitions.WixRegistrySearch, null, null) @@ -43,16 +54,10 @@ namespace WixToolset.Data.Tuples public IntermediateField this[WixRegistrySearchTupleFields index] => this.Fields[(int)index]; - public string WixSearchRef + public RegistryRootType Root { - get => (string)this.Fields[(int)WixRegistrySearchTupleFields.WixSearchRef]; - set => this.Set((int)WixRegistrySearchTupleFields.WixSearchRef, value); - } - - public int Root - { - get => (int)this.Fields[(int)WixRegistrySearchTupleFields.Root]; - set => this.Set((int)WixRegistrySearchTupleFields.Root, value); + get => (RegistryRootType)this.Fields[(int)WixRegistrySearchTupleFields.Root].AsNumber(); + set => this.Set((int)WixRegistrySearchTupleFields.Root, (int)value); } public string Key @@ -67,10 +72,10 @@ namespace WixToolset.Data.Tuples set => this.Set((int)WixRegistrySearchTupleFields.Value, value); } - public int Attributes + public WixRegistrySearchAttributes Attributes { - get => (int)this.Fields[(int)WixRegistrySearchTupleFields.Attributes]; - set => this.Set((int)WixRegistrySearchTupleFields.Attributes, value); + get => (WixRegistrySearchAttributes)this.Fields[(int)WixRegistrySearchTupleFields.Attributes].AsNumber(); + set => this.Set((int)WixRegistrySearchTupleFields.Attributes, (int)value); } } -} \ No newline at end of file +} diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/WixApprovedExeForElevationRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/WixApprovedExeForElevationRow.cs index b3d85c8a..28a14ddd 100644 --- a/src/WixToolset.Data/WindowsInstaller/Rows/WixApprovedExeForElevationRow.cs +++ b/src/WixToolset.Data/WindowsInstaller/Rows/WixApprovedExeForElevationRow.cs @@ -2,6 +2,8 @@ namespace WixToolset.Data.WindowsInstaller.Rows { + using WixToolset.Data.Tuples; + /// /// Specialization of a row for the WixApprovedExeForElevation table. /// @@ -61,9 +63,9 @@ namespace WixToolset.Data.WindowsInstaller.Rows /// Gets or sets the attibutes. /// /// The BundleApprovedExeForElevationAttributes. - public BundleApprovedExeForElevationAttributes Attributes + public WixApprovedExeForElevationAttributes Attributes { - get { return (BundleApprovedExeForElevationAttributes)this.Fields[3].Data; } + get { return (WixApprovedExeForElevationAttributes)this.Fields[3].Data; } set { this.Fields[3].Data = (int)value; } } @@ -72,7 +74,7 @@ namespace WixToolset.Data.WindowsInstaller.Rows /// public bool Win64 { - get { return BundleApprovedExeForElevationAttributes.Win64 == (this.Attributes & BundleApprovedExeForElevationAttributes.Win64); } + get { return WixApprovedExeForElevationAttributes.Win64 == (this.Attributes & WixApprovedExeForElevationAttributes.Win64); } } } } diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/WixBundleExePackageRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/WixBundleExePackageRow.cs index 95fc0f54..241c1f7f 100644 --- a/src/WixToolset.Data/WindowsInstaller/Rows/WixBundleExePackageRow.cs +++ b/src/WixToolset.Data/WindowsInstaller/Rows/WixBundleExePackageRow.cs @@ -2,6 +2,7 @@ namespace WixToolset.Data.WindowsInstaller.Rows { + using System; using WixToolset.Data.Tuples; /// @@ -97,7 +98,7 @@ namespace WixToolset.Data.WindowsInstaller.Rows /// public bool Repairable { - get { return 0 != (this.Attributes & WixBundleExePackageAttributes.Repairable); } + get { return !String.IsNullOrEmpty(this.RepairCommand); } } } } diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/WixBundleMsiPackageRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/WixBundleMsiPackageRow.cs index fdd2b6cf..5f07072d 100644 --- a/src/WixToolset.Data/WindowsInstaller/Rows/WixBundleMsiPackageRow.cs +++ b/src/WixToolset.Data/WindowsInstaller/Rows/WixBundleMsiPackageRow.cs @@ -126,13 +126,5 @@ namespace WixToolset.Data.WindowsInstaller.Rows { get { return 0 != (this.Attributes & WixBundleMsiPackageAttributes.ForcePerMachine); } } - - /// - /// Gets the suppress loose file payload generation of a package. - /// - public bool SuppressLooseFilePayloadGeneration - { - get { return 0 != (this.Attributes & WixBundleMsiPackageAttributes.SuppressLooseFilePayloadGeneration); } - } } } diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/WixBundlePatchTargetCodeRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/WixBundlePatchTargetCodeRow.cs index 6e05e4b7..84d13c43 100644 --- a/src/WixToolset.Data/WindowsInstaller/Rows/WixBundlePatchTargetCodeRow.cs +++ b/src/WixToolset.Data/WindowsInstaller/Rows/WixBundlePatchTargetCodeRow.cs @@ -3,25 +3,7 @@ namespace WixToolset.Data.WindowsInstaller.Rows { using System; - - /// - /// Attributes for the PatchTargetCode table. - /// - [Flags] - public enum WixBundlePatchTargetCodeAttributes : int - { - None = 0, - - /// - /// The transform targets a specific ProductCode. - /// - TargetsProductCode = 1, - - /// - /// The transform targets a specific UpgradeCode. - /// - TargetsUpgradeCode = 2, - } + using WixToolset.Data.Tuples; /// /// Specialization of a row for the PatchTargetCode table. -- cgit v1.2.3-55-g6feb