Rename MsiPatchSequenceSymbol to MsiPatchFamilySymbol and fix the Id
The symbol now matches the name from the language. Also, fix the MsiPatchFamilySymbol id calculation to fix the linker issue and unblock patch filtering.
Rob Mensching committed
Sep 27, 2022 at 01:46 UTC
586d83b42ef69c576303720a6d9c727889842b62
6 files changed
+74
-74
src/api/wix/WixToolset.Data/Symbols/MsiPatchFamilySymbol.cs
new
+68
@@ -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 MsiPatchFamily = new IntermediateSymbolDefinition(
10
+ SymbolDefinitionType.MsiPatchFamily,
11
+ new[]
12
+ {
13
+ new IntermediateFieldDefinition(nameof(MsiPatchFamilySymbolFields.PatchFamily), IntermediateFieldType.String),
14
+ new IntermediateFieldDefinition(nameof(MsiPatchFamilySymbolFields.ProductCode), IntermediateFieldType.String),
15
+ new IntermediateFieldDefinition(nameof(MsiPatchFamilySymbolFields.Sequence), IntermediateFieldType.String),
16
+ new IntermediateFieldDefinition(nameof(MsiPatchFamilySymbolFields.Attributes), IntermediateFieldType.Number),
17
+ },
18
+ typeof(MsiPatchFamilySymbol));
19
+ }
20
+}
21
+
22
+namespace WixToolset.Data.Symbols
23
+{
24
+ public enum MsiPatchFamilySymbolFields
25
+ {
26
+ PatchFamily,
27
+ ProductCode,
28
+ Sequence,
29
+ Attributes,
30
+ }
31
+
32
+ public class MsiPatchFamilySymbol : IntermediateSymbol
33
+ {
34
+ public MsiPatchFamilySymbol() : base(SymbolDefinitions.MsiPatchFamily, null, null)
35
+ {
36
+ }
37
+
38
+ public MsiPatchFamilySymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.MsiPatchFamily, sourceLineNumber, id)
39
+ {
40
+ }
41
+
42
+ public IntermediateField this[MsiPatchFamilySymbolFields index] => this.Fields[(int)index];
43
+
44
+ public string PatchFamily
45
+ {
46
+ get => (string)this.Fields[(int)MsiPatchFamilySymbolFields.PatchFamily];
47
+ set => this.Set((int)MsiPatchFamilySymbolFields.PatchFamily, value);
48
+ }
49
+
50
+ public string ProductCode
51
+ {
52
+ get => (string)this.Fields[(int)MsiPatchFamilySymbolFields.ProductCode];
53
+ set => this.Set((int)MsiPatchFamilySymbolFields.ProductCode, value);
54
+ }
55
+
56
+ public string Sequence
57
+ {
58
+ get => (string)this.Fields[(int)MsiPatchFamilySymbolFields.Sequence];
59
+ set => this.Set((int)MsiPatchFamilySymbolFields.Sequence, value);
60
+ }
61
+
62
+ public int? Attributes
63
+ {
64
+ get => (int?)this.Fields[(int)MsiPatchFamilySymbolFields.Attributes];
65
+ set => this.Set((int)MsiPatchFamilySymbolFields.Attributes, value);
66
+ }
67
+ }
68
+}
\ No newline at end of file
src/api/wix/WixToolset.Data/Symbols/MsiPatchSequenceSymbol.cs
deleted
-68
@@ -1,68 +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 MsiPatchSequence = new IntermediateSymbolDefinition(
10
- SymbolDefinitionType.MsiPatchSequence,
11
- new[]
12
- {
13
- new IntermediateFieldDefinition(nameof(MsiPatchSequenceSymbolFields.PatchFamily), IntermediateFieldType.String),
14
- new IntermediateFieldDefinition(nameof(MsiPatchSequenceSymbolFields.ProductCode), IntermediateFieldType.String),
15
- new IntermediateFieldDefinition(nameof(MsiPatchSequenceSymbolFields.Sequence), IntermediateFieldType.String),
16
- new IntermediateFieldDefinition(nameof(MsiPatchSequenceSymbolFields.Attributes), IntermediateFieldType.Number),
17
- },
18
- typeof(MsiPatchSequenceSymbol));
19
- }
20
-}
21
-
22
-namespace WixToolset.Data.Symbols
23
-{
24
- public enum MsiPatchSequenceSymbolFields
25
- {
26
- PatchFamily,
27
- ProductCode,
28
- Sequence,
29
- Attributes,
30
- }
31
-
32
- public class MsiPatchSequenceSymbol : IntermediateSymbol
33
- {
34
- public MsiPatchSequenceSymbol() : base(SymbolDefinitions.MsiPatchSequence, null, null)
35
- {
36
- }
37
-
38
- public MsiPatchSequenceSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(SymbolDefinitions.MsiPatchSequence, sourceLineNumber, id)
39
- {
40
- }
41
-
42
- public IntermediateField this[MsiPatchSequenceSymbolFields index] => this.Fields[(int)index];
43
-
44
- public string PatchFamily
45
- {
46
- get => (string)this.Fields[(int)MsiPatchSequenceSymbolFields.PatchFamily];
47
- set => this.Set((int)MsiPatchSequenceSymbolFields.PatchFamily, value);
48
- }
49
-
50
- public string ProductCode
51
- {
52
- get => (string)this.Fields[(int)MsiPatchSequenceSymbolFields.ProductCode];
53
- set => this.Set((int)MsiPatchSequenceSymbolFields.ProductCode, value);
54
- }
55
-
56
- public string Sequence
57
- {
58
- get => (string)this.Fields[(int)MsiPatchSequenceSymbolFields.Sequence];
59
- set => this.Set((int)MsiPatchSequenceSymbolFields.Sequence, value);
60
- }
61
-
62
- public int? Attributes
63
- {
64
- get => (int?)this.Fields[(int)MsiPatchSequenceSymbolFields.Attributes];
65
- set => this.Set((int)MsiPatchSequenceSymbolFields.Attributes, value);
66
- }
67
- }
68
-}
\ No newline at end of file
src/api/wix/WixToolset.Data/Symbols/SymbolDefinitions.cs
+3
-3
@@ -74,7 +74,7 @@ namespace WixToolset.Data
74
MsiPatchMetadata,
75
MsiPatchOldAssemblyFile,
76
MsiPatchOldAssemblyName,
77
- MsiPatchSequence,
77
+ MsiPatchFamily,
78
MsiServiceConfig,
79
MsiServiceConfigFailureActions,
80
MsiShortcutProperty,
@@ -422,8 +422,8 @@ namespace WixToolset.Data
422
case SymbolDefinitionType.MsiPatchOldAssemblyName:
423
return SymbolDefinitions.MsiPatchOldAssemblyName;
424
425
- case SymbolDefinitionType.MsiPatchSequence:
426
- return SymbolDefinitions.MsiPatchSequence;
425
+ case SymbolDefinitionType.MsiPatchFamily:
426
+ return SymbolDefinitions.MsiPatchFamily;
427
428
case SymbolDefinitionType.MsiServiceConfig:
429
return SymbolDefinitions.MsiServiceConfig;
src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerTableDefinitions.cs
+1
-1
@@ -923,7 +923,7 @@ namespace WixToolset.Data.WindowsInstaller
923
924
public static readonly TableDefinition MsiPatchSequence = new TableDefinition(
925
"MsiPatchSequence",
926
- SymbolDefinitions.MsiPatchSequence,
926
+ SymbolDefinitions.MsiPatchFamily,
927
new[]
928
{
929
new ColumnDefinition("PatchFamily", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Unknown),
src/wix/WixToolset.Core/Compiler.cs
+1
-1
@@ -3620,7 +3620,7 @@ namespace WixToolset.Core
3620
this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id"));
3621
}
3622
3623
- this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.MsiPatchSequence, primaryKeys);
3623
+ this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.MsiPatchFamily, primaryKeys);
3624
3625
this.Core.ParseForExtensionElements(node);
3626
src/wix/WixToolset.Core/Compiler_Patch.cs
+1
-1
@@ -431,7 +431,7 @@ namespace WixToolset.Core
431
432
if (!this.Core.EncounteredError)
433
{
434
- this.Core.AddSymbol(new MsiPatchSequenceSymbol(sourceLineNumbers)
434
+ this.Core.AddSymbol(new MsiPatchFamilySymbol(sourceLineNumbers, new Identifier(id.Access, id.Id, productCode))
435
{
436
PatchFamily = id.Id,
437
ProductCode = productCode,