diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-04-02 14:28:56 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-04-02 14:46:29 -0700 |
| commit | 4bb99d4a7521f3182b3d8ea9833038dc067db118 (patch) | |
| tree | 031c917bfc0fd3c513579646e92c3e9f823efba3 /src/WixToolset.Data/Symbols | |
| parent | a0dd2bc561ee6aa6b7aebedcff76c8a11e14bc9f (diff) | |
| download | wix-4bb99d4a7521f3182b3d8ea9833038dc067db118.tar.gz wix-4bb99d4a7521f3182b3d8ea9833038dc067db118.tar.bz2 wix-4bb99d4a7521f3182b3d8ea9833038dc067db118.zip | |
Move codepage from section and to package, module, patch symbols
Contributes to wixtoolset/issues#5801
Diffstat (limited to 'src/WixToolset.Data/Symbols')
| -rw-r--r-- | src/WixToolset.Data/Symbols/ModuleSignatureSymbol.cs | 60 | ||||
| -rw-r--r-- | src/WixToolset.Data/Symbols/SymbolDefinitions.cs | 14 | ||||
| -rw-r--r-- | src/WixToolset.Data/Symbols/WixModuleSymbol.cs | 68 | ||||
| -rw-r--r-- | src/WixToolset.Data/Symbols/WixPackageSymbol.cs | 111 | ||||
| -rw-r--r-- | src/WixToolset.Data/Symbols/WixPatchIdSymbol.cs | 90 | ||||
| -rw-r--r-- | src/WixToolset.Data/Symbols/WixPatchSymbol.cs | 98 |
6 files changed, 286 insertions, 155 deletions
diff --git a/src/WixToolset.Data/Symbols/ModuleSignatureSymbol.cs b/src/WixToolset.Data/Symbols/ModuleSignatureSymbol.cs deleted file mode 100644 index 5f6ded09..00000000 --- a/src/WixToolset.Data/Symbols/ModuleSignatureSymbol.cs +++ /dev/null | |||
| @@ -1,60 +0,0 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolset.Data | ||
| 4 | { | ||
| 5 | using WixToolset.Data.Symbols; | ||
| 6 | |||
| 7 | public static partial class SymbolDefinitions | ||
| 8 | { | ||
| 9 | public static readonly IntermediateSymbolDefinition ModuleSignature = new IntermediateSymbolDefinition( | ||
| 10 | SymbolDefinitionType.ModuleSignature, | ||
| 11 | new[] | ||
| 12 | { | ||
| 13 | new IntermediateFieldDefinition(nameof(ModuleSignatureSymbolFields.ModuleID), IntermediateFieldType.String), | ||
| 14 | new IntermediateFieldDefinition(nameof(ModuleSignatureSymbolFields.Language), IntermediateFieldType.Number), | ||
| 15 | new IntermediateFieldDefinition(nameof(ModuleSignatureSymbolFields.Version), IntermediateFieldType.String), | ||
| 16 | }, | ||
| 17 | typeof(ModuleSignatureSymbol)); | ||
| 18 | } | ||
| 19 | } | ||
| 20 | |||
| 21 | namespace WixToolset.Data.Symbols | ||
| 22 | { | ||
| 23 | public enum ModuleSignatureSymbolFields | ||
| 24 | { | ||
| 25 | ModuleID, | ||
| 26 | Language, | ||
| 27 | Version, | ||
| 28 | } | ||
| 29 | |||
| 30 | public class ModuleSignatureSymbol : IntermediateSymbol | ||
| 31 | { | ||
| 32 | public ModuleSignatureSymbol() : base(SymbolDefinitions.ModuleSignature, null, null) | ||
| 33 | { | ||
| 34 | } | ||
| 35 | |||
| 36 | public ModuleSignatureSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.ModuleSignature, sourceLineNumber, id) | ||
| 37 | { | ||
| 38 | } | ||
| 39 | |||
| 40 | public IntermediateField this[ModuleSignatureSymbolFields index] => this.Fields[(int)index]; | ||
| 41 | |||
| 42 | public string ModuleID | ||
| 43 | { | ||
| 44 | get => (string)this.Fields[(int)ModuleSignatureSymbolFields.ModuleID]; | ||
| 45 | set => this.Set((int)ModuleSignatureSymbolFields.ModuleID, value); | ||
| 46 | } | ||
| 47 | |||
| 48 | public int Language | ||
| 49 | { | ||
| 50 | get => (int)this.Fields[(int)ModuleSignatureSymbolFields.Language]; | ||
| 51 | set => this.Set((int)ModuleSignatureSymbolFields.Language, value); | ||
| 52 | } | ||
| 53 | |||
| 54 | public string Version | ||
| 55 | { | ||
| 56 | get => (string)this.Fields[(int)ModuleSignatureSymbolFields.Version]; | ||
| 57 | set => this.Set((int)ModuleSignatureSymbolFields.Version, value); | ||
| 58 | } | ||
| 59 | } | ||
| 60 | } \ No newline at end of file | ||
diff --git a/src/WixToolset.Data/Symbols/SymbolDefinitions.cs b/src/WixToolset.Data/Symbols/SymbolDefinitions.cs index 54deb87f..0ed0a4ec 100644 --- a/src/WixToolset.Data/Symbols/SymbolDefinitions.cs +++ b/src/WixToolset.Data/Symbols/SymbolDefinitions.cs | |||
| @@ -56,7 +56,7 @@ namespace WixToolset.Data | |||
| 56 | ModuleDependency, | 56 | ModuleDependency, |
| 57 | ModuleExclusion, | 57 | ModuleExclusion, |
| 58 | ModuleIgnoreTable, | 58 | ModuleIgnoreTable, |
| 59 | ModuleSignature, | 59 | WixModule, |
| 60 | ModuleSubstitution, | 60 | ModuleSubstitution, |
| 61 | MoveFile, | 61 | MoveFile, |
| 62 | Assembly, | 62 | Assembly, |
| @@ -172,9 +172,10 @@ namespace WixToolset.Data | |||
| 172 | WixMediaTemplate, | 172 | WixMediaTemplate, |
| 173 | WixMerge, | 173 | WixMerge, |
| 174 | WixOrdering, | 174 | WixOrdering, |
| 175 | WixPackage, | ||
| 175 | WixPatchBaseline, | 176 | WixPatchBaseline, |
| 176 | WixPatchFamilyGroup, | 177 | WixPatchFamilyGroup, |
| 177 | WixPatchId, | 178 | WixPatch, |
| 178 | WixPatchRef, | 179 | WixPatchRef, |
| 179 | WixPatchTarget, | 180 | WixPatchTarget, |
| 180 | WixProductSearch, | 181 | WixProductSearch, |
| @@ -362,8 +363,8 @@ namespace WixToolset.Data | |||
| 362 | case SymbolDefinitionType.ModuleIgnoreTable: | 363 | case SymbolDefinitionType.ModuleIgnoreTable: |
| 363 | return SymbolDefinitions.ModuleIgnoreTable; | 364 | return SymbolDefinitions.ModuleIgnoreTable; |
| 364 | 365 | ||
| 365 | case SymbolDefinitionType.ModuleSignature: | 366 | case SymbolDefinitionType.WixModule: |
| 366 | return SymbolDefinitions.ModuleSignature; | 367 | return SymbolDefinitions.WixModule; |
| 367 | 368 | ||
| 368 | case SymbolDefinitionType.ModuleSubstitution: | 369 | case SymbolDefinitionType.ModuleSubstitution: |
| 369 | return SymbolDefinitions.ModuleSubstitution; | 370 | return SymbolDefinitions.ModuleSubstitution; |
| @@ -707,13 +708,16 @@ namespace WixToolset.Data | |||
| 707 | case SymbolDefinitionType.WixOrdering: | 708 | case SymbolDefinitionType.WixOrdering: |
| 708 | return SymbolDefinitions.WixOrdering; | 709 | return SymbolDefinitions.WixOrdering; |
| 709 | 710 | ||
| 711 | case SymbolDefinitionType.WixPackage: | ||
| 712 | return SymbolDefinitions.WixPackage; | ||
| 713 | |||
| 710 | case SymbolDefinitionType.WixPatchBaseline: | 714 | case SymbolDefinitionType.WixPatchBaseline: |
| 711 | return SymbolDefinitions.WixPatchBaseline; | 715 | return SymbolDefinitions.WixPatchBaseline; |
| 712 | 716 | ||
| 713 | case SymbolDefinitionType.WixPatchFamilyGroup: | 717 | case SymbolDefinitionType.WixPatchFamilyGroup: |
| 714 | return SymbolDefinitions.WixPatchFamilyGroup; | 718 | return SymbolDefinitions.WixPatchFamilyGroup; |
| 715 | 719 | ||
| 716 | case SymbolDefinitionType.WixPatchId: | 720 | case SymbolDefinitionType.WixPatch: |
| 717 | return SymbolDefinitions.WixPatchId; | 721 | return SymbolDefinitions.WixPatchId; |
| 718 | 722 | ||
| 719 | case SymbolDefinitionType.WixPatchRef: | 723 | case SymbolDefinitionType.WixPatchRef: |
diff --git a/src/WixToolset.Data/Symbols/WixModuleSymbol.cs b/src/WixToolset.Data/Symbols/WixModuleSymbol.cs new file mode 100644 index 00000000..fbb16764 --- /dev/null +++ b/src/WixToolset.Data/Symbols/WixModuleSymbol.cs | |||
| @@ -0,0 +1,68 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolset.Data | ||
| 4 | { | ||
| 5 | using WixToolset.Data.Symbols; | ||
| 6 | |||
| 7 | public static partial class SymbolDefinitions | ||
| 8 | { | ||
| 9 | public static readonly IntermediateSymbolDefinition WixModule = new IntermediateSymbolDefinition( | ||
| 10 | SymbolDefinitionType.WixModule, | ||
| 11 | new[] | ||
| 12 | { | ||
| 13 | new IntermediateFieldDefinition(nameof(WixModuleSymbolFields.ModuleId), IntermediateFieldType.String), | ||
| 14 | new IntermediateFieldDefinition(nameof(WixModuleSymbolFields.Language), IntermediateFieldType.String), | ||
| 15 | new IntermediateFieldDefinition(nameof(WixModuleSymbolFields.Version), IntermediateFieldType.String), | ||
| 16 | new IntermediateFieldDefinition(nameof(WixModuleSymbolFields.Codepage), IntermediateFieldType.String), | ||
| 17 | }, | ||
| 18 | typeof(WixModuleSymbol)); | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | namespace WixToolset.Data.Symbols | ||
| 23 | { | ||
| 24 | public enum WixModuleSymbolFields | ||
| 25 | { | ||
| 26 | ModuleId, | ||
| 27 | Language, | ||
| 28 | Version, | ||
| 29 | Codepage, | ||
| 30 | } | ||
| 31 | |||
| 32 | public class WixModuleSymbol : IntermediateSymbol | ||
| 33 | { | ||
| 34 | public WixModuleSymbol() : base(SymbolDefinitions.WixModule, null, null) | ||
| 35 | { | ||
| 36 | } | ||
| 37 | |||
| 38 | public WixModuleSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixModule, sourceLineNumber, id) | ||
| 39 | { | ||
| 40 | } | ||
| 41 | |||
| 42 | public IntermediateField this[WixModuleSymbolFields index] => this.Fields[(int)index]; | ||
| 43 | |||
| 44 | public string ModuleId | ||
| 45 | { | ||
| 46 | get => (string)this.Fields[(int)WixModuleSymbolFields.ModuleId]; | ||
| 47 | set => this.Set((int)WixModuleSymbolFields.ModuleId, value); | ||
| 48 | } | ||
| 49 | |||
| 50 | public string Language | ||
| 51 | { | ||
| 52 | get => (string)this.Fields[(int)WixModuleSymbolFields.Language]; | ||
| 53 | set => this.Set((int)WixModuleSymbolFields.Language, value); | ||
| 54 | } | ||
| 55 | |||
| 56 | public string Version | ||
| 57 | { | ||
| 58 | get => (string)this.Fields[(int)WixModuleSymbolFields.Version]; | ||
| 59 | set => this.Set((int)WixModuleSymbolFields.Version, value); | ||
| 60 | } | ||
| 61 | |||
| 62 | public string Codepage | ||
| 63 | { | ||
| 64 | get => (string)this.Fields[(int)WixModuleSymbolFields.Codepage]; | ||
| 65 | set => this.Set((int)WixModuleSymbolFields.Codepage, value); | ||
| 66 | } | ||
| 67 | } | ||
| 68 | } | ||
diff --git a/src/WixToolset.Data/Symbols/WixPackageSymbol.cs b/src/WixToolset.Data/Symbols/WixPackageSymbol.cs new file mode 100644 index 00000000..e1720033 --- /dev/null +++ b/src/WixToolset.Data/Symbols/WixPackageSymbol.cs | |||
| @@ -0,0 +1,111 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolset.Data | ||
| 4 | { | ||
| 5 | using WixToolset.Data.Symbols; | ||
| 6 | |||
| 7 | public static partial class SymbolDefinitions | ||
| 8 | { | ||
| 9 | public static readonly IntermediateSymbolDefinition WixPackage = new IntermediateSymbolDefinition( | ||
| 10 | SymbolDefinitionType.WixPackage, | ||
| 11 | new[] | ||
| 12 | { | ||
| 13 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.PackageId), IntermediateFieldType.String), | ||
| 14 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.UpgradeCode), IntermediateFieldType.String), | ||
| 15 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Name), IntermediateFieldType.String), | ||
| 16 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Language), IntermediateFieldType.String), | ||
| 17 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Version), IntermediateFieldType.String), | ||
| 18 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Manufacturer), IntermediateFieldType.String), | ||
| 19 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Attributes), IntermediateFieldType.Number), | ||
| 20 | new IntermediateFieldDefinition(nameof(WixPackageSymbolFields.Codepage), IntermediateFieldType.String), | ||
| 21 | }, | ||
| 22 | typeof(WixPackageSymbol)); | ||
| 23 | } | ||
| 24 | } | ||
| 25 | |||
| 26 | namespace WixToolset.Data.Symbols | ||
| 27 | { | ||
| 28 | using System; | ||
| 29 | |||
| 30 | public enum WixPackageSymbolFields | ||
| 31 | { | ||
| 32 | PackageId, | ||
| 33 | UpgradeCode, | ||
| 34 | Name, | ||
| 35 | Language, | ||
| 36 | Version, | ||
| 37 | Manufacturer, | ||
| 38 | Attributes, | ||
| 39 | Codepage, | ||
| 40 | } | ||
| 41 | |||
| 42 | [Flags] | ||
| 43 | public enum WixPackageAttributes | ||
| 44 | { | ||
| 45 | None = 0x0, | ||
| 46 | PerMachine = 0x1, | ||
| 47 | } | ||
| 48 | |||
| 49 | public class WixPackageSymbol : IntermediateSymbol | ||
| 50 | { | ||
| 51 | public WixPackageSymbol() : base(SymbolDefinitions.WixPackage, null, null) | ||
| 52 | { | ||
| 53 | } | ||
| 54 | |||
| 55 | public WixPackageSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixPackage, sourceLineNumber, id) | ||
| 56 | { | ||
| 57 | } | ||
| 58 | |||
| 59 | public IntermediateField this[WixPackageSymbolFields index] => this.Fields[(int)index]; | ||
| 60 | |||
| 61 | public string PackageId | ||
| 62 | { | ||
| 63 | get => (string)this.Fields[(int)WixPackageSymbolFields.PackageId]; | ||
| 64 | set => this.Set((int)WixPackageSymbolFields.PackageId, value); | ||
| 65 | } | ||
| 66 | |||
| 67 | public string UpgradeCode | ||
| 68 | { | ||
| 69 | get => (string)this.Fields[(int)WixPackageSymbolFields.UpgradeCode]; | ||
| 70 | set => this.Set((int)WixPackageSymbolFields.UpgradeCode, value); | ||
| 71 | } | ||
| 72 | |||
| 73 | public string Name | ||
| 74 | { | ||
| 75 | get => (string)this.Fields[(int)WixPackageSymbolFields.Name]; | ||
| 76 | set => this.Set((int)WixPackageSymbolFields.Name, value); | ||
| 77 | } | ||
| 78 | |||
| 79 | public string Language | ||
| 80 | { | ||
| 81 | get => (string)this.Fields[(int)WixPackageSymbolFields.Language]; | ||
| 82 | set => this.Set((int)WixPackageSymbolFields.Language, value); | ||
| 83 | } | ||
| 84 | |||
| 85 | public string Version | ||
| 86 | { | ||
| 87 | get => (string)this.Fields[(int)WixPackageSymbolFields.Version]; | ||
| 88 | set => this.Set((int)WixPackageSymbolFields.Version, value); | ||
| 89 | } | ||
| 90 | |||
| 91 | public string Manufacturer | ||
| 92 | { | ||
| 93 | get => (string)this.Fields[(int)WixPackageSymbolFields.Manufacturer]; | ||
| 94 | set => this.Set((int)WixPackageSymbolFields.Manufacturer, value); | ||
| 95 | } | ||
| 96 | |||
| 97 | public WixPackageAttributes Attributes | ||
| 98 | { | ||
| 99 | get => (WixPackageAttributes)this.Fields[(int)WixPackageSymbolFields.Attributes].AsNumber(); | ||
| 100 | set => this.Set((int)WixPackageSymbolFields.Attributes, (int)value); | ||
| 101 | } | ||
| 102 | |||
| 103 | public string Codepage | ||
| 104 | { | ||
| 105 | get => (string)this.Fields[(int)WixPackageSymbolFields.Codepage]; | ||
| 106 | set => this.Set((int)WixPackageSymbolFields.Codepage, value); | ||
| 107 | } | ||
| 108 | |||
| 109 | public bool PerMachine => (this.Attributes & WixPackageAttributes.PerMachine) == WixPackageAttributes.PerMachine; | ||
| 110 | } | ||
| 111 | } | ||
diff --git a/src/WixToolset.Data/Symbols/WixPatchIdSymbol.cs b/src/WixToolset.Data/Symbols/WixPatchIdSymbol.cs deleted file mode 100644 index 344fc058..00000000 --- a/src/WixToolset.Data/Symbols/WixPatchIdSymbol.cs +++ /dev/null | |||
| @@ -1,90 +0,0 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolset.Data | ||
| 4 | { | ||
| 5 | using WixToolset.Data.Symbols; | ||
| 6 | |||
| 7 | public static partial class SymbolDefinitions | ||
| 8 | { | ||
| 9 | public static readonly IntermediateSymbolDefinition WixPatchId = new IntermediateSymbolDefinition( | ||
| 10 | SymbolDefinitionType.WixPatchId, | ||
| 11 | new[] | ||
| 12 | { | ||
| 13 | new IntermediateFieldDefinition(nameof(WixPatchIdSymbolFields.ClientPatchId), IntermediateFieldType.String), | ||
| 14 | new IntermediateFieldDefinition(nameof(WixPatchIdSymbolFields.OptimizePatchSizeForLargeFiles), IntermediateFieldType.Bool), | ||
| 15 | new IntermediateFieldDefinition(nameof(WixPatchIdSymbolFields.ApiPatchingSymbolFlags), IntermediateFieldType.Number), | ||
| 16 | }, | ||
| 17 | typeof(WixPatchIdSymbol)); | ||
| 18 | } | ||
| 19 | } | ||
| 20 | |||
| 21 | namespace WixToolset.Data.Symbols | ||
| 22 | { | ||
| 23 | using System; | ||
| 24 | |||
| 25 | public enum WixPatchIdSymbolFields | ||
| 26 | { | ||
| 27 | ClientPatchId, | ||
| 28 | OptimizePatchSizeForLargeFiles, | ||
| 29 | ApiPatchingSymbolFlags, | ||
| 30 | } | ||
| 31 | |||
| 32 | /// <summary> | ||
| 33 | /// The following flags are used with PATCH_OPTION_DATA SymbolOptionFlags: | ||
| 34 | /// </summary> | ||
| 35 | [Flags] | ||
| 36 | [CLSCompliant(false)] | ||
| 37 | public enum PatchSymbolFlags : uint | ||
| 38 | { | ||
| 39 | /// <summary> | ||
| 40 | /// Don't use imagehlp.dll | ||
| 41 | /// </summary> | ||
| 42 | PatchSymbolNoImagehlp = 0x00000001, | ||
| 43 | |||
| 44 | /// <summary> | ||
| 45 | /// Don't fail patch due to imagehlp failures. | ||
| 46 | /// </summary> | ||
| 47 | PatchSymbolNoFailures = 0x00000002, | ||
| 48 | |||
| 49 | /// <summary> | ||
| 50 | /// After matching decorated symbols, try to match remaining by undecorated names. | ||
| 51 | /// </summary> | ||
| 52 | PatchSymbolUndecoratedToo = 0x00000004, | ||
| 53 | |||
| 54 | /// <summary> | ||
| 55 | /// (used internally) | ||
| 56 | /// </summary> | ||
| 57 | PatchSymbolReserved = 0x80000000, | ||
| 58 | } | ||
| 59 | |||
| 60 | public class WixPatchIdSymbol : IntermediateSymbol | ||
| 61 | { | ||
| 62 | public WixPatchIdSymbol() : base(SymbolDefinitions.WixPatchId, null, null) | ||
| 63 | { | ||
| 64 | } | ||
| 65 | |||
| 66 | public WixPatchIdSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixPatchId, sourceLineNumber, id) | ||
| 67 | { | ||
| 68 | } | ||
| 69 | |||
| 70 | public IntermediateField this[WixPatchIdSymbolFields index] => this.Fields[(int)index]; | ||
| 71 | |||
| 72 | public string ClientPatchId | ||
| 73 | { | ||
| 74 | get => (string)this.Fields[(int)WixPatchIdSymbolFields.ClientPatchId]; | ||
| 75 | set => this.Set((int)WixPatchIdSymbolFields.ClientPatchId, value); | ||
| 76 | } | ||
| 77 | |||
| 78 | public bool? OptimizePatchSizeForLargeFiles | ||
| 79 | { | ||
| 80 | get => (bool?)this.Fields[(int)WixPatchIdSymbolFields.OptimizePatchSizeForLargeFiles]; | ||
| 81 | set => this.Set((int)WixPatchIdSymbolFields.OptimizePatchSizeForLargeFiles, value); | ||
| 82 | } | ||
| 83 | |||
| 84 | public int? ApiPatchingSymbolFlags | ||
| 85 | { | ||
| 86 | get => (int?)this.Fields[(int)WixPatchIdSymbolFields.ApiPatchingSymbolFlags]; | ||
| 87 | set => this.Set((int)WixPatchIdSymbolFields.ApiPatchingSymbolFlags, value); | ||
| 88 | } | ||
| 89 | } | ||
| 90 | } \ No newline at end of file | ||
diff --git a/src/WixToolset.Data/Symbols/WixPatchSymbol.cs b/src/WixToolset.Data/Symbols/WixPatchSymbol.cs new file mode 100644 index 00000000..3f1f20bb --- /dev/null +++ b/src/WixToolset.Data/Symbols/WixPatchSymbol.cs | |||
| @@ -0,0 +1,98 @@ | |||
| 1 | // 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. | ||
| 2 | |||
| 3 | namespace WixToolset.Data | ||
| 4 | { | ||
| 5 | using WixToolset.Data.Symbols; | ||
| 6 | |||
| 7 | public static partial class SymbolDefinitions | ||
| 8 | { | ||
| 9 | public static readonly IntermediateSymbolDefinition WixPatchId = new IntermediateSymbolDefinition( | ||
| 10 | SymbolDefinitionType.WixPatch, | ||
| 11 | new[] | ||
| 12 | { | ||
| 13 | new IntermediateFieldDefinition(nameof(WixPatchSymbolFields.ClientPatchId), IntermediateFieldType.String), | ||
| 14 | new IntermediateFieldDefinition(nameof(WixPatchSymbolFields.OptimizePatchSizeForLargeFiles), IntermediateFieldType.Bool), | ||
| 15 | new IntermediateFieldDefinition(nameof(WixPatchSymbolFields.ApiPatchingSymbolFlags), IntermediateFieldType.Number), | ||
| 16 | new IntermediateFieldDefinition(nameof(WixPatchSymbolFields.Codepage), IntermediateFieldType.String), | ||
| 17 | }, | ||
| 18 | typeof(WixPatchSymbol)); | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | namespace WixToolset.Data.Symbols | ||
| 23 | { | ||
| 24 | using System; | ||
| 25 | |||
| 26 | public enum WixPatchSymbolFields | ||
| 27 | { | ||
| 28 | ClientPatchId, | ||
| 29 | OptimizePatchSizeForLargeFiles, | ||
| 30 | ApiPatchingSymbolFlags, | ||
| 31 | Codepage, | ||
| 32 | } | ||
| 33 | |||
| 34 | /// <summary> | ||
| 35 | /// The following flags are used with PATCH_OPTION_DATA SymbolOptionFlags: | ||
| 36 | /// </summary> | ||
| 37 | [Flags] | ||
| 38 | [CLSCompliant(false)] | ||
| 39 | public enum PatchSymbolFlags : uint | ||
| 40 | { | ||
| 41 | /// <summary> | ||
| 42 | /// Don't use imagehlp.dll | ||
| 43 | /// </summary> | ||
| 44 | PatchSymbolNoImagehlp = 0x00000001, | ||
| 45 | |||
| 46 | /// <summary> | ||
| 47 | /// Don't fail patch due to imagehlp failures. | ||
| 48 | /// </summary> | ||
| 49 | PatchSymbolNoFailures = 0x00000002, | ||
| 50 | |||
| 51 | /// <summary> | ||
| 52 | /// After matching decorated symbols, try to match remaining by undecorated names. | ||
| 53 | /// </summary> | ||
| 54 | PatchSymbolUndecoratedToo = 0x00000004, | ||
| 55 | |||
| 56 | /// <summary> | ||
| 57 | /// (used internally) | ||
| 58 | /// </summary> | ||
| 59 | PatchSymbolReserved = 0x80000000, | ||
| 60 | } | ||
| 61 | |||
| 62 | public class WixPatchSymbol : IntermediateSymbol | ||
| 63 | { | ||
| 64 | public WixPatchSymbol() : base(SymbolDefinitions.WixPatchId, null, null) | ||
| 65 | { | ||
| 66 | } | ||
| 67 | |||
| 68 | public WixPatchSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.WixPatchId, sourceLineNumber, id) | ||
| 69 | { | ||
| 70 | } | ||
| 71 | |||
| 72 | public IntermediateField this[WixPatchSymbolFields index] => this.Fields[(int)index]; | ||
| 73 | |||
| 74 | public string ClientPatchId | ||
| 75 | { | ||
| 76 | get => (string)this.Fields[(int)WixPatchSymbolFields.ClientPatchId]; | ||
| 77 | set => this.Set((int)WixPatchSymbolFields.ClientPatchId, value); | ||
| 78 | } | ||
| 79 | |||
| 80 | public bool? OptimizePatchSizeForLargeFiles | ||
| 81 | { | ||
| 82 | get => (bool?)this.Fields[(int)WixPatchSymbolFields.OptimizePatchSizeForLargeFiles]; | ||
| 83 | set => this.Set((int)WixPatchSymbolFields.OptimizePatchSizeForLargeFiles, value); | ||
| 84 | } | ||
| 85 | |||
| 86 | public int? ApiPatchingSymbolFlags | ||
| 87 | { | ||
| 88 | get => (int?)this.Fields[(int)WixPatchSymbolFields.ApiPatchingSymbolFlags]; | ||
| 89 | set => this.Set((int)WixPatchSymbolFields.ApiPatchingSymbolFlags, value); | ||
| 90 | } | ||
| 91 | |||
| 92 | public string Codepage | ||
| 93 | { | ||
| 94 | get => (string)this.Fields[(int)WixPatchSymbolFields.Codepage]; | ||
| 95 | set => this.Set((int)WixPatchSymbolFields.Codepage, value); | ||
| 96 | } | ||
| 97 | } | ||
| 98 | } \ No newline at end of file | ||
