@joebigelow / wix / commits / a4825894

Fix patch related tuples

Rob Mensching committed Feb 5, 2020 at 14:41 UTC a482589448fb6e0f7abc1c725c49c65344c83509
5 files changed +64 -17
src/WixToolset.Data/ErrorMessages.cs
+6
@@ -203,6 +203,11 @@ namespace WixToolset.Data
203 return Message(null, Ids.CorruptFileFormat, "Attempted to load corrupt file from path: {0}. The file with format {1} contained unexpected content. Ensure the correct path was provided and that the file has not been incorrectly modified.", path, format.ToLowerInvariant());
204 }
205
206 + public static Message CouldNotDetermineProductCodeFromTransformSummaryInfo()
207 + {
208 + return Message(null, Ids.CouldNotDetermineProductCodeFromTransformSummaryInfo, "Could not determine ProductCode from transform summary information.");
209 + }
210 +
211 public static Message CreateCabAddFileFailed()
212 {
213 return Message(null, Ids.CreateCabAddFileFailed, "An error (E_FAIL) was returned while adding files to a CAB file. This most commonly happens when creating a CAB file 2 GB or larger. Either reduce the size of your installation package, raise Media/@CompressionLevel to a higher compression level, or split your installation package's files into more than one CAB file.");
@@ -2640,6 +2645,7 @@ namespace WixToolset.Data
2645 NoSourceFiles = 391,
2646 WixiplSourceFileIsExclusive = 392,
2647 UnableToConvertFieldToNumber = 393,
2648 + CouldNotDetermineProductCodeFromTransformSummaryInfo = 394,
2649 }
2650 }
2651 }
src/WixToolset.Data/Tuples/SummaryInformationTuple.cs
+32 -1
@@ -30,20 +30,51 @@ namespace WixToolset.Data.Tuples
30 Codepage = 1,
31 Title,
32 Subject,
33 + PatchPackageName = 3, //used by patches
34 Author,
35 Keywords,
36 Comments,
37 PlatformAndLanguage,
38 + PatchProductCodes = 7, // used by patches
39 TransformPlatformAndLanguageOrStorageNames,
40 + TransformNames = 8, // used by patches
41 PackageCode,
39 - Created = 12,
42 + PatchCode = 9, // used by patches
43 + TransformProductCodes = 9, // used by transforms
44 + Reserved11 = 11, // reserved by patches
45 + Created,
46 LastSaved,
47 WindowsInstallerVersion,
48 + Reserved14 = 14, // reserved by patches
49 WordCount,
50 + PatchInstallerRequirement = 15, // used by patches
51 + Reserved16, // reserved by patches
52 + TransformValidationFlags = 16, // used by transforms
53 CreatingApplication = 18,
54 Security
55 }
56
57 + /// <summary>
58 + /// Summary information values for the PachInstallerRequirement property.
59 + /// </summary>
60 + public enum PatchInstallerRequirement
61 + {
62 + /// <summary>Any version of the installer will do</summary>
63 + Version10 = 1,
64 +
65 + /// <summary>At least 1.2</summary>
66 + Version12 = 2,
67 +
68 + /// <summary>At least 2.0</summary>
69 + Version20 = 3,
70 +
71 + /// <summary>At least 3.0</summary>
72 + Version30 = 4,
73 +
74 + /// <summary>At least 3.1</summary>
75 + Version31 = 5,
76 + }
77 +
78 public class SummaryInformationTuple : IntermediateTuple
79 {
80 public SummaryInformationTuple() : base(TupleDefinitions.SummaryInformation, null, null)
src/WixToolset.Data/Tuples/WixPatchBaselineTuple.cs
+24
@@ -12,6 +12,9 @@ namespace WixToolset.Data
12 {
13 new IntermediateFieldDefinition(nameof(WixPatchBaselineTupleFields.DiskId), IntermediateFieldType.Number),
14 new IntermediateFieldDefinition(nameof(WixPatchBaselineTupleFields.ValidationFlags), IntermediateFieldType.Number),
15 + new IntermediateFieldDefinition(nameof(WixPatchBaselineTupleFields.BaselineFile), IntermediateFieldType.Path),
16 + new IntermediateFieldDefinition(nameof(WixPatchBaselineTupleFields.UpdateFile), IntermediateFieldType.Path),
17 + new IntermediateFieldDefinition(nameof(WixPatchBaselineTupleFields.TransformFile), IntermediateFieldType.Path),
18 },
19 typeof(WixPatchBaselineTuple));
20 }
@@ -23,6 +26,9 @@ namespace WixToolset.Data.Tuples
26 {
27 DiskId,
28 ValidationFlags,
29 + BaselineFile,
30 + UpdateFile,
31 + TransformFile,
32 }
33
34 public class WixPatchBaselineTuple : IntermediateTuple
@@ -48,5 +54,23 @@ namespace WixToolset.Data.Tuples
54 get => (TransformFlags)this.Fields[(int)WixPatchBaselineTupleFields.ValidationFlags].AsNumber();
55 set => this.Set((int)WixPatchBaselineTupleFields.ValidationFlags, (int)value);
56 }
57 +
58 + public IntermediateFieldPathValue BaselineFile
59 + {
60 + get => this.Fields[(int)WixPatchBaselineTupleFields.BaselineFile].AsPath();
61 + set => this.Set((int)WixPatchBaselineTupleFields.BaselineFile, value);
62 + }
63 +
64 + public IntermediateFieldPathValue UpdateFile
65 + {
66 + get => this.Fields[(int)WixPatchBaselineTupleFields.UpdateFile].AsPath();
67 + set => this.Set((int)WixPatchBaselineTupleFields.UpdateFile, value);
68 + }
69 +
70 + public IntermediateFieldPathValue TransformFile
71 + {
72 + get => this.Fields[(int)WixPatchBaselineTupleFields.TransformFile].AsPath();
73 + set => this.Set((int)WixPatchBaselineTupleFields.TransformFile, value);
74 + }
75 }
76 }
src/WixToolset.Data/Tuples/WixPatchIdTuple.cs
-8
@@ -10,7 +10,6 @@ namespace WixToolset.Data
10 TupleDefinitionType.WixPatchId,
11 new[]
12 {
13 - new IntermediateFieldDefinition(nameof(WixPatchIdTupleFields.ProductCode), IntermediateFieldType.String),
13 new IntermediateFieldDefinition(nameof(WixPatchIdTupleFields.ClientPatchId), IntermediateFieldType.String),
14 new IntermediateFieldDefinition(nameof(WixPatchIdTupleFields.OptimizePatchSizeForLargeFiles), IntermediateFieldType.Bool),
15 new IntermediateFieldDefinition(nameof(WixPatchIdTupleFields.ApiPatchingSymbolFlags), IntermediateFieldType.Number),
@@ -23,7 +22,6 @@ namespace WixToolset.Data.Tuples
22 {
23 public enum WixPatchIdTupleFields
24 {
26 - ProductCode,
25 ClientPatchId,
26 OptimizePatchSizeForLargeFiles,
27 ApiPatchingSymbolFlags,
@@ -41,12 +39,6 @@ namespace WixToolset.Data.Tuples
39
40 public IntermediateField this[WixPatchIdTupleFields index] => this.Fields[(int)index];
41
44 - public string ProductCode
45 - {
46 - get => (string)this.Fields[(int)WixPatchIdTupleFields.ProductCode];
47 - set => this.Set((int)WixPatchIdTupleFields.ProductCode, value);
48 - }
49 -
42 public string ClientPatchId
43 {
44 get => (string)this.Fields[(int)WixPatchIdTupleFields.ClientPatchId];
src/WixToolset.Data/Tuples/WixPatchMetadataTuple.cs
+2 -8
@@ -1,5 +1,7 @@
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 +// TODO: delete this
4 +
5 namespace WixToolset.Data
6 {
7 using WixToolset.Data.Tuples;
@@ -10,7 +12,6 @@ namespace WixToolset.Data
12 TupleDefinitionType.WixPatchMetadata,
13 new[]
14 {
13 - new IntermediateFieldDefinition(nameof(WixPatchMetadataTupleFields.Property), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(WixPatchMetadataTupleFields.Value), IntermediateFieldType.String),
16 },
17 typeof(WixPatchMetadataTuple));
@@ -21,7 +22,6 @@ namespace WixToolset.Data.Tuples
22 {
23 public enum WixPatchMetadataTupleFields
24 {
24 - Property,
25 Value,
26 }
27
@@ -37,12 +37,6 @@ namespace WixToolset.Data.Tuples
37
38 public IntermediateField this[WixPatchMetadataTupleFields index] => this.Fields[(int)index];
39
40 - public string Property
41 - {
42 - get => (string)this.Fields[(int)WixPatchMetadataTupleFields.Property];
43 - set => this.Set((int)WixPatchMetadataTupleFields.Property, value);
44 - }
45 -
40 public string Value
41 {
42 get => (string)this.Fields[(int)WixPatchMetadataTupleFields.Value];