diff options
5 files changed, 874 insertions, 875 deletions
diff --git a/src/wix/WixToolset.Core.Burn/Bundles/BurnCommon.cs b/src/wix/WixToolset.Core.Burn/Bundles/BurnCommon.cs index 733f7c00..08183f32 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/BurnCommon.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/BurnCommon.cs | |||
@@ -31,31 +31,31 @@ namespace WixToolset.Core.Burn.Bundles | |||
31 | // See WinNT.h for details about the PE format, including the | 31 | // See WinNT.h for details about the PE format, including the |
32 | // structure and offsets for IMAGE_DOS_HEADER, IMAGE_NT_HEADERS32, | 32 | // structure and offsets for IMAGE_DOS_HEADER, IMAGE_NT_HEADERS32, |
33 | // IMAGE_FILE_HEADER, etc. | 33 | // IMAGE_FILE_HEADER, etc. |
34 | protected const UInt32 IMAGE_DOS_HEADER_SIZE = 64; | 34 | protected const uint IMAGE_DOS_HEADER_SIZE = 64; |
35 | protected const UInt32 IMAGE_DOS_HEADER_OFFSET_MAGIC = 0; | 35 | protected const uint IMAGE_DOS_HEADER_OFFSET_MAGIC = 0; |
36 | protected const UInt32 IMAGE_DOS_HEADER_OFFSET_NTHEADER = 60; | 36 | protected const uint IMAGE_DOS_HEADER_OFFSET_NTHEADER = 60; |
37 | 37 | ||
38 | protected const UInt32 IMAGE_NT_HEADER_SIZE = 24; // signature DWORD (4) + IMAGE_FILE_HEADER (20) | 38 | protected const uint IMAGE_NT_HEADER_SIZE = 24; // signature DWORD (4) + IMAGE_FILE_HEADER (20) |
39 | protected const UInt32 IMAGE_NT_HEADER_OFFSET_SIGNATURE = 0; | 39 | protected const uint IMAGE_NT_HEADER_OFFSET_SIGNATURE = 0; |
40 | protected const UInt32 IMAGE_NT_HEADER_OFFSET_NUMBEROFSECTIONS = 6; | 40 | protected const uint IMAGE_NT_HEADER_OFFSET_NUMBEROFSECTIONS = 6; |
41 | protected const UInt32 IMAGE_NT_HEADER_OFFSET_SIZEOFOPTIONALHEADER = 20; | 41 | protected const uint IMAGE_NT_HEADER_OFFSET_SIZEOFOPTIONALHEADER = 20; |
42 | 42 | ||
43 | protected const UInt32 IMAGE_OPTIONAL_OFFSET_CHECKSUM = 4 * 16; // checksum is 16 DWORDs into IMAGE_OPTIONAL_HEADER which is right after the IMAGE_NT_HEADER. | 43 | protected const uint IMAGE_OPTIONAL_OFFSET_CHECKSUM = 4 * 16; // checksum is 16 DWORDs into IMAGE_OPTIONAL_HEADER which is right after the IMAGE_NT_HEADER. |
44 | protected const UInt32 IMAGE_OPTIONAL_NEGATIVE_OFFSET_CERTIFICATETABLE = (IMAGE_DATA_DIRECTORY_SIZE * (IMAGE_NUMBEROF_DIRECTORY_ENTRIES - IMAGE_DIRECTORY_ENTRY_SECURITY)); | 44 | protected const uint IMAGE_OPTIONAL_NEGATIVE_OFFSET_CERTIFICATETABLE = (IMAGE_DATA_DIRECTORY_SIZE * (IMAGE_NUMBEROF_DIRECTORY_ENTRIES - IMAGE_DIRECTORY_ENTRY_SECURITY)); |
45 | 45 | ||
46 | protected const UInt32 IMAGE_SECTION_HEADER_SIZE = 40; | 46 | protected const uint IMAGE_SECTION_HEADER_SIZE = 40; |
47 | protected const UInt32 IMAGE_SECTION_HEADER_OFFSET_NAME = 0; | 47 | protected const uint IMAGE_SECTION_HEADER_OFFSET_NAME = 0; |
48 | protected const UInt32 IMAGE_SECTION_HEADER_OFFSET_VIRTUALSIZE = 8; | 48 | protected const uint IMAGE_SECTION_HEADER_OFFSET_VIRTUALSIZE = 8; |
49 | protected const UInt32 IMAGE_SECTION_HEADER_OFFSET_SIZEOFRAWDATA = 16; | 49 | protected const uint IMAGE_SECTION_HEADER_OFFSET_SIZEOFRAWDATA = 16; |
50 | protected const UInt32 IMAGE_SECTION_HEADER_OFFSET_POINTERTORAWDATA = 20; | 50 | protected const uint IMAGE_SECTION_HEADER_OFFSET_POINTERTORAWDATA = 20; |
51 | 51 | ||
52 | protected const UInt32 IMAGE_DATA_DIRECTORY_SIZE = 8; // struct of two DWORDs. | 52 | protected const uint IMAGE_DATA_DIRECTORY_SIZE = 8; // struct of two DWORDs. |
53 | protected const UInt32 IMAGE_DIRECTORY_ENTRY_SECURITY = 4; | 53 | protected const uint IMAGE_DIRECTORY_ENTRY_SECURITY = 4; |
54 | protected const UInt32 IMAGE_NUMBEROF_DIRECTORY_ENTRIES = 16; | 54 | protected const uint IMAGE_NUMBEROF_DIRECTORY_ENTRIES = 16; |
55 | 55 | ||
56 | protected const UInt16 IMAGE_DOS_SIGNATURE = 0x5A4D; | 56 | protected const ushort IMAGE_DOS_SIGNATURE = 0x5A4D; |
57 | protected const UInt32 IMAGE_NT_SIGNATURE = 0x00004550; | 57 | protected const uint IMAGE_NT_SIGNATURE = 0x00004550; |
58 | protected const UInt64 IMAGE_SECTION_WIXBURN_NAME = 0x6E7275627869772E; // ".wixburn", as a qword. | 58 | protected const ulong IMAGE_SECTION_WIXBURN_NAME = 0x6E7275627869772E; // ".wixburn", as a qword. |
59 | 59 | ||
60 | // The ".wixburn" section contains: | 60 | // The ".wixburn" section contains: |
61 | // 0- 3: magic number | 61 | // 0- 3: magic number |
@@ -69,32 +69,32 @@ namespace WixToolset.Core.Burn.Bundles | |||
69 | // 44-47: container count | 69 | // 44-47: container count |
70 | // 48-51: byte count of manifest + UX container | 70 | // 48-51: byte count of manifest + UX container |
71 | // 52-512: byte count of attached containers (4 bytes for each container) | 71 | // 52-512: byte count of attached containers (4 bytes for each container) |
72 | protected const UInt32 BURN_SECTION_OFFSET_MAGIC = 0; | 72 | protected const uint BURN_SECTION_OFFSET_MAGIC = 0; |
73 | protected const UInt32 BURN_SECTION_OFFSET_VERSION = 4; | 73 | protected const uint BURN_SECTION_OFFSET_VERSION = 4; |
74 | protected const UInt32 BURN_SECTION_OFFSET_BUNDLEGUID = 8; | 74 | protected const uint BURN_SECTION_OFFSET_BUNDLEGUID = 8; |
75 | protected const UInt32 BURN_SECTION_OFFSET_STUBSIZE = 24; | 75 | protected const uint BURN_SECTION_OFFSET_STUBSIZE = 24; |
76 | protected const UInt32 BURN_SECTION_OFFSET_ORIGINALCHECKSUM = 28; | 76 | protected const uint BURN_SECTION_OFFSET_ORIGINALCHECKSUM = 28; |
77 | protected const UInt32 BURN_SECTION_OFFSET_ORIGINALSIGNATUREOFFSET = 32; | 77 | protected const uint BURN_SECTION_OFFSET_ORIGINALSIGNATUREOFFSET = 32; |
78 | protected const UInt32 BURN_SECTION_OFFSET_ORIGINALSIGNATURESIZE = 36; | 78 | protected const uint BURN_SECTION_OFFSET_ORIGINALSIGNATURESIZE = 36; |
79 | protected const UInt32 BURN_SECTION_OFFSET_FORMAT = 40; | 79 | protected const uint BURN_SECTION_OFFSET_FORMAT = 40; |
80 | protected const UInt32 BURN_SECTION_OFFSET_COUNT = 44; | 80 | protected const uint BURN_SECTION_OFFSET_COUNT = 44; |
81 | protected const UInt32 BURN_SECTION_OFFSET_UXSIZE = 48; | 81 | protected const uint BURN_SECTION_OFFSET_UXSIZE = 48; |
82 | protected const UInt32 BURN_SECTION_OFFSET_ATTACHEDCONTAINERSIZE0 = 52; | 82 | protected const uint BURN_SECTION_OFFSET_ATTACHEDCONTAINERSIZE0 = 52; |
83 | protected const UInt32 BURN_SECTION_MIN_SIZE = BURN_SECTION_OFFSET_ATTACHEDCONTAINERSIZE0; | 83 | protected const uint BURN_SECTION_MIN_SIZE = BURN_SECTION_OFFSET_ATTACHEDCONTAINERSIZE0; |
84 | 84 | ||
85 | protected const UInt32 BURN_SECTION_MAGIC = 0x00f14300; | 85 | protected const uint BURN_SECTION_MAGIC = 0x00f14300; |
86 | protected const UInt32 BURN_SECTION_VERSION = 0x00000002; | 86 | protected const uint BURN_SECTION_VERSION = 0x00000002; |
87 | 87 | ||
88 | protected string fileExe; | 88 | protected string fileExe; |
89 | protected UInt32 peOffset = UInt32.MaxValue; | 89 | protected uint peOffset = UInt32.MaxValue; |
90 | protected UInt16 sections = UInt16.MaxValue; | 90 | protected ushort sections = UInt16.MaxValue; |
91 | protected UInt32 firstSectionOffset = UInt32.MaxValue; | 91 | protected uint firstSectionOffset = UInt32.MaxValue; |
92 | protected UInt32 checksumOffset; | 92 | protected uint checksumOffset; |
93 | protected UInt32 certificateTableSignatureOffset; | 93 | protected uint certificateTableSignatureOffset; |
94 | protected UInt32 certificateTableSignatureSize; | 94 | protected uint certificateTableSignatureSize; |
95 | protected UInt32 wixburnDataOffset = UInt32.MaxValue; | 95 | protected uint wixburnDataOffset = UInt32.MaxValue; |
96 | protected UInt32 wixburnRawDataSize; | 96 | protected uint wixburnRawDataSize; |
97 | protected UInt32 wixburnMaxContainers; | 97 | protected uint wixburnMaxContainers; |
98 | 98 | ||
99 | // TODO: does this enum exist in another form somewhere? | 99 | // TODO: does this enum exist in another form somewhere? |
100 | /// <summary> | 100 | /// <summary> |
@@ -104,7 +104,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
104 | { | 104 | { |
105 | Nothing = 0, | 105 | Nothing = 0, |
106 | UX, | 106 | UX, |
107 | Attached | 107 | Attached, |
108 | } | 108 | } |
109 | 109 | ||
110 | /// <summary> | 110 | /// <summary> |
@@ -119,16 +119,16 @@ namespace WixToolset.Core.Burn.Bundles | |||
119 | this.AttachedContainers = new List<ContainerSlot>(); | 119 | this.AttachedContainers = new List<ContainerSlot>(); |
120 | } | 120 | } |
121 | 121 | ||
122 | public UInt32 Checksum { get; protected set; } | 122 | public uint Checksum { get; protected set; } |
123 | public UInt32 SignatureOffset { get; protected set; } | 123 | public uint SignatureOffset { get; protected set; } |
124 | public UInt32 SignatureSize { get; protected set; } | 124 | public uint SignatureSize { get; protected set; } |
125 | public UInt32 Version { get; protected set; } | 125 | public uint Version { get; protected set; } |
126 | public UInt32 StubSize { get; protected set; } | 126 | public uint StubSize { get; protected set; } |
127 | public UInt32 OriginalChecksum { get; protected set; } | 127 | public uint OriginalChecksum { get; protected set; } |
128 | public UInt32 OriginalSignatureOffset { get; protected set; } | 128 | public uint OriginalSignatureOffset { get; protected set; } |
129 | public UInt32 OriginalSignatureSize { get; protected set; } | 129 | public uint OriginalSignatureSize { get; protected set; } |
130 | public UInt32 EngineSize { get; protected set; } | 130 | public uint EngineSize { get; protected set; } |
131 | public UInt32 UXAddress { get { return this.StubSize; } } | 131 | public uint UXAddress { get { return this.StubSize; } } |
132 | public List<ContainerSlot> AttachedContainers { get; protected set; } | 132 | public List<ContainerSlot> AttachedContainers { get; protected set; } |
133 | 133 | ||
134 | protected IMessaging Messaging { get; } | 134 | protected IMessaging Messaging { get; } |
@@ -179,10 +179,9 @@ namespace WixToolset.Core.Burn.Bundles | |||
179 | } | 179 | } |
180 | 180 | ||
181 | reader.BaseStream.Seek(this.wixburnDataOffset, SeekOrigin.Begin); | 181 | reader.BaseStream.Seek(this.wixburnDataOffset, SeekOrigin.Begin); |
182 | byte[] bytes = reader.ReadBytes((int)this.wixburnRawDataSize); | 182 | var bytes = reader.ReadBytes((int)this.wixburnRawDataSize); |
183 | UInt32 uint32 = 0; | ||
184 | 183 | ||
185 | uint32 = BurnCommon.ReadUInt32(bytes, BURN_SECTION_OFFSET_MAGIC); | 184 | var uint32 = BurnCommon.ReadUInt32(bytes, BURN_SECTION_OFFSET_MAGIC); |
186 | if (BURN_SECTION_MAGIC != uint32) | 185 | if (BURN_SECTION_MAGIC != uint32) |
187 | { | 186 | { |
188 | this.Messaging.Write(ErrorMessages.InvalidBundle(this.fileExe)); | 187 | this.Messaging.Write(ErrorMessages.InvalidBundle(this.fileExe)); |
@@ -208,7 +207,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
208 | this.OriginalSignatureOffset = BurnCommon.ReadUInt32(bytes, BURN_SECTION_OFFSET_ORIGINALSIGNATUREOFFSET); | 207 | this.OriginalSignatureOffset = BurnCommon.ReadUInt32(bytes, BURN_SECTION_OFFSET_ORIGINALSIGNATUREOFFSET); |
209 | this.OriginalSignatureSize = BurnCommon.ReadUInt32(bytes, BURN_SECTION_OFFSET_ORIGINALSIGNATURESIZE); | 208 | this.OriginalSignatureSize = BurnCommon.ReadUInt32(bytes, BURN_SECTION_OFFSET_ORIGINALSIGNATURESIZE); |
210 | 209 | ||
211 | uint containerCount = BurnCommon.ReadUInt32(bytes, BURN_SECTION_OFFSET_COUNT); | 210 | var containerCount = BurnCommon.ReadUInt32(bytes, BURN_SECTION_OFFSET_COUNT); |
212 | uint uxSize = 0; | 211 | uint uxSize = 0; |
213 | if (this.wixburnMaxContainers < containerCount) | 212 | if (this.wixburnMaxContainers < containerCount) |
214 | { | 213 | { |
@@ -221,7 +220,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
221 | for (uint i = 0; i < containerCount; ++i) | 220 | for (uint i = 0; i < containerCount; ++i) |
222 | { | 221 | { |
223 | uint sizeOffset = BURN_SECTION_OFFSET_UXSIZE + (i * 4); | 222 | uint sizeOffset = BURN_SECTION_OFFSET_UXSIZE + (i * 4); |
224 | uint size = BurnCommon.ReadUInt32(bytes, sizeOffset); | 223 | var size = BurnCommon.ReadUInt32(bytes, sizeOffset); |
225 | this.AttachedContainers.Add(new ContainerSlot(size)); | 224 | this.AttachedContainers.Add(new ContainerSlot(size)); |
226 | } | 225 | } |
227 | uxSize = this.AttachedContainers[0].Size; | 226 | uxSize = this.AttachedContainers[0].Size; |
@@ -261,11 +260,11 @@ namespace WixToolset.Core.Burn.Bundles | |||
261 | return false; | 260 | return false; |
262 | } | 261 | } |
263 | 262 | ||
264 | UInt32 wixburnSectionOffset = UInt32.MaxValue; | 263 | var wixburnSectionOffset = UInt32.MaxValue; |
265 | byte[] bytes = new byte[IMAGE_SECTION_HEADER_SIZE]; | 264 | var bytes = new byte[IMAGE_SECTION_HEADER_SIZE]; |
266 | 265 | ||
267 | reader.BaseStream.Seek(this.firstSectionOffset, SeekOrigin.Begin); | 266 | reader.BaseStream.Seek(this.firstSectionOffset, SeekOrigin.Begin); |
268 | for (UInt16 sectionIndex = 0; sectionIndex < this.sections; ++sectionIndex) | 267 | for (ushort sectionIndex = 0; sectionIndex < this.sections; ++sectionIndex) |
269 | { | 268 | { |
270 | reader.Read(bytes, 0, bytes.Length); | 269 | reader.Read(bytes, 0, bytes.Length); |
271 | 270 | ||
@@ -292,7 +291,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
292 | return false; | 291 | return false; |
293 | } | 292 | } |
294 | 293 | ||
295 | this.wixburnMaxContainers = (this.wixburnRawDataSize - BURN_SECTION_OFFSET_UXSIZE) / sizeof(UInt32); | 294 | this.wixburnMaxContainers = (this.wixburnRawDataSize - BURN_SECTION_OFFSET_UXSIZE) / sizeof(uint); |
296 | this.wixburnDataOffset = BurnCommon.ReadUInt32(bytes, IMAGE_SECTION_HEADER_OFFSET_POINTERTORAWDATA); | 295 | this.wixburnDataOffset = BurnCommon.ReadUInt32(bytes, IMAGE_SECTION_HEADER_OFFSET_POINTERTORAWDATA); |
297 | } | 296 | } |
298 | 297 | ||
@@ -313,7 +312,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
313 | } | 312 | } |
314 | 313 | ||
315 | reader.BaseStream.Seek(this.peOffset, SeekOrigin.Begin); | 314 | reader.BaseStream.Seek(this.peOffset, SeekOrigin.Begin); |
316 | byte[] bytes = reader.ReadBytes((int)IMAGE_NT_HEADER_SIZE); | 315 | var bytes = reader.ReadBytes((int)IMAGE_NT_HEADER_SIZE); |
317 | 316 | ||
318 | // Verify the NT signature... | 317 | // Verify the NT signature... |
319 | if (IMAGE_NT_SIGNATURE != BurnCommon.ReadUInt32(bytes, IMAGE_NT_HEADER_OFFSET_SIGNATURE)) | 318 | if (IMAGE_NT_SIGNATURE != BurnCommon.ReadUInt32(bytes, IMAGE_NT_HEADER_OFFSET_SIGNATURE)) |
@@ -322,7 +321,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
322 | return false; | 321 | return false; |
323 | } | 322 | } |
324 | 323 | ||
325 | ushort sizeOptionalHeader = BurnCommon.ReadUInt16(bytes, IMAGE_NT_HEADER_OFFSET_SIZEOFOPTIONALHEADER); | 324 | var sizeOptionalHeader = BurnCommon.ReadUInt16(bytes, IMAGE_NT_HEADER_OFFSET_SIZEOFOPTIONALHEADER); |
326 | 325 | ||
327 | this.sections = BurnCommon.ReadUInt16(bytes, IMAGE_NT_HEADER_OFFSET_NUMBEROFSECTIONS); | 326 | this.sections = BurnCommon.ReadUInt16(bytes, IMAGE_NT_HEADER_OFFSET_NUMBEROFSECTIONS); |
328 | this.firstSectionOffset = this.peOffset + IMAGE_NT_HEADER_SIZE + sizeOptionalHeader; | 327 | this.firstSectionOffset = this.peOffset + IMAGE_NT_HEADER_SIZE + sizeOptionalHeader; |
@@ -348,7 +347,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
348 | { | 347 | { |
349 | if (UInt32.MaxValue == this.peOffset) | 348 | if (UInt32.MaxValue == this.peOffset) |
350 | { | 349 | { |
351 | byte[] bytes = reader.ReadBytes((int)IMAGE_DOS_HEADER_SIZE); | 350 | var bytes = reader.ReadBytes((int)IMAGE_DOS_HEADER_SIZE); |
352 | 351 | ||
353 | // Verify the DOS 'MZ' signature. | 352 | // Verify the DOS 'MZ' signature. |
354 | if (IMAGE_DOS_SIGNATURE != BurnCommon.ReadUInt16(bytes, IMAGE_DOS_HEADER_OFFSET_MAGIC)) | 353 | if (IMAGE_DOS_SIGNATURE != BurnCommon.ReadUInt16(bytes, IMAGE_DOS_HEADER_OFFSET_MAGIC)) |
@@ -369,10 +368,10 @@ namespace WixToolset.Core.Burn.Bundles | |||
369 | /// <param name="bytes">Array from which to read.</param> | 368 | /// <param name="bytes">Array from which to read.</param> |
370 | /// <param name="offset">Beginning offset from which to read.</param> | 369 | /// <param name="offset">Beginning offset from which to read.</param> |
371 | /// <returns>value at offset</returns> | 370 | /// <returns>value at offset</returns> |
372 | internal static UInt16 ReadUInt16(byte[] bytes, UInt32 offset) | 371 | internal static ushort ReadUInt16(byte[] bytes, uint offset) |
373 | { | 372 | { |
374 | Debug.Assert(offset + 2 <= bytes.Length); | 373 | Debug.Assert(offset + 2 <= bytes.Length); |
375 | return (UInt16)(bytes[offset] + (bytes[offset + 1] << 8)); | 374 | return (ushort)(bytes[offset] + (bytes[offset + 1] << 8)); |
376 | } | 375 | } |
377 | 376 | ||
378 | /// <summary> | 377 | /// <summary> |
@@ -381,10 +380,10 @@ namespace WixToolset.Core.Burn.Bundles | |||
381 | /// <param name="bytes">Array from which to read.</param> | 380 | /// <param name="bytes">Array from which to read.</param> |
382 | /// <param name="offset">Beginning offset from which to read.</param> | 381 | /// <param name="offset">Beginning offset from which to read.</param> |
383 | /// <returns>value at offset</returns> | 382 | /// <returns>value at offset</returns> |
384 | internal static UInt32 ReadUInt32(byte[] bytes, UInt32 offset) | 383 | internal static uint ReadUInt32(byte[] bytes, uint offset) |
385 | { | 384 | { |
386 | Debug.Assert(offset + 4 <= bytes.Length); | 385 | Debug.Assert(offset + 4 <= bytes.Length); |
387 | return BurnCommon.ReadUInt16(bytes, offset) + ((UInt32)BurnCommon.ReadUInt16(bytes, offset + 2) << 16); | 386 | return BurnCommon.ReadUInt16(bytes, offset) + ((uint)BurnCommon.ReadUInt16(bytes, offset + 2) << 16); |
388 | } | 387 | } |
389 | 388 | ||
390 | /// <summary> | 389 | /// <summary> |
@@ -393,10 +392,10 @@ namespace WixToolset.Core.Burn.Bundles | |||
393 | /// <param name="bytes">Array from which to read.</param> | 392 | /// <param name="bytes">Array from which to read.</param> |
394 | /// <param name="offset">Beginning offset from which to read.</param> | 393 | /// <param name="offset">Beginning offset from which to read.</param> |
395 | /// <returns>value at offset</returns> | 394 | /// <returns>value at offset</returns> |
396 | internal static UInt64 ReadUInt64(byte[] bytes, UInt32 offset) | 395 | internal static ulong ReadUInt64(byte[] bytes, uint offset) |
397 | { | 396 | { |
398 | Debug.Assert(offset + 8 <= bytes.Length); | 397 | Debug.Assert(offset + 8 <= bytes.Length); |
399 | return BurnCommon.ReadUInt32(bytes, offset) + ((UInt64)BurnCommon.ReadUInt32(bytes, offset + 4) << 32); | 398 | return BurnCommon.ReadUInt32(bytes, offset) + ((ulong)BurnCommon.ReadUInt32(bytes, offset + 4) << 32); |
400 | } | 399 | } |
401 | } | 400 | } |
402 | 401 | ||
diff --git a/src/wix/WixToolset.Core.Burn/Bundles/BurnWriter.cs b/src/wix/WixToolset.Core.Burn/Bundles/BurnWriter.cs index 46835974..5800f5c0 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/BurnWriter.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/BurnWriter.cs | |||
@@ -44,9 +44,9 @@ namespace WixToolset.Core.Burn.Bundles | |||
44 | /// <returns>Burn writer.</returns> | 44 | /// <returns>Burn writer.</returns> |
45 | public static BurnWriter Open(IMessaging messaging, string fileExe) | 45 | public static BurnWriter Open(IMessaging messaging, string fileExe) |
46 | { | 46 | { |
47 | BurnWriter writer = new BurnWriter(messaging, fileExe); | 47 | var writer = new BurnWriter(messaging, fileExe); |
48 | 48 | ||
49 | using (BinaryReader binaryReader = new BinaryReader(File.Open(fileExe, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete))) | 49 | using (var binaryReader = new BinaryReader(File.Open(fileExe, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete))) |
50 | { | 50 | { |
51 | if (!writer.Initialize(binaryReader)) | 51 | if (!writer.Initialize(binaryReader)) |
52 | { | 52 | { |
@@ -93,7 +93,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
93 | this.WriteToBurnSectionOffset(BURN_SECTION_OFFSET_FORMAT, 1); // Hard-coded to CAB for now. | 93 | this.WriteToBurnSectionOffset(BURN_SECTION_OFFSET_FORMAT, 1); // Hard-coded to CAB for now. |
94 | this.AttachedContainers.Clear(); | 94 | this.AttachedContainers.Clear(); |
95 | this.WriteToBurnSectionOffset(BURN_SECTION_OFFSET_COUNT, 0); | 95 | this.WriteToBurnSectionOffset(BURN_SECTION_OFFSET_COUNT, 0); |
96 | for (uint i = BURN_SECTION_OFFSET_UXSIZE; i < this.wixburnMaxContainers; i += sizeof(UInt32)) | 96 | for (var i = BURN_SECTION_OFFSET_UXSIZE; i < this.wixburnMaxContainers; i += sizeof(uint)) |
97 | { | 97 | { |
98 | this.WriteToBurnSectionOffset(i, 0); | 98 | this.WriteToBurnSectionOffset(i, 0); |
99 | } | 99 | } |
@@ -112,7 +112,7 @@ namespace WixToolset.Core.Burn.Bundles | |||
112 | /// <returns>true if the container data is successfully appended; false otherwise</returns> | 112 | /// <returns>true if the container data is successfully appended; false otherwise</returns> |
113 | public bool AppendContainer(string fileContainer, BurnCommon.Container container) | 113 | public bool AppendContainer(string fileContainer, BurnCommon.Container container) |
114 | { | 114 | { |
115 | using (FileStream reader = File.OpenRead(fileContainer)) | 115 | using (var reader = File.OpenRead(fileContainer)) |
116 | { | 116 | { |
117 | return this.AppendContainer(reader, reader.Length, container); | 117 | return this.AppendContainer(reader, reader.Length, container); |
118 | } | 118 | } |
@@ -136,10 +136,10 @@ namespace WixToolset.Core.Burn.Bundles | |||
136 | this.AttachedContainers.Clear(); | 136 | this.AttachedContainers.Clear(); |
137 | this.AttachedContainers.Add(uxContainerSlot); | 137 | this.AttachedContainers.Add(uxContainerSlot); |
138 | 138 | ||
139 | uint nextAddress = this.EngineSize; | 139 | var nextAddress = this.EngineSize; |
140 | for (int i = 1; i < reader.AttachedContainers.Count; i++) | 140 | for (var i = 1; i < reader.AttachedContainers.Count; i++) |
141 | { | 141 | { |
142 | ContainerSlot cntnr = reader.AttachedContainers[i]; | 142 | var cntnr = reader.AttachedContainers[i]; |
143 | 143 | ||
144 | reader.Stream.Seek(nextAddress, SeekOrigin.Begin); | 144 | reader.Stream.Seek(nextAddress, SeekOrigin.Begin); |
145 | // TODO: verify that the size in the section data is 0 or the same size. | 145 | // TODO: verify that the size in the section data is 0 or the same size. |
@@ -160,8 +160,8 @@ namespace WixToolset.Core.Burn.Bundles | |||
160 | /// <returns>true if the container data is successfully appended; false otherwise</returns> | 160 | /// <returns>true if the container data is successfully appended; false otherwise</returns> |
161 | public bool AppendContainer(Stream containerStream, long containerSize, BurnCommon.Container container) | 161 | public bool AppendContainer(Stream containerStream, long containerSize, BurnCommon.Container container) |
162 | { | 162 | { |
163 | uint containerCount = (uint)this.AttachedContainers.Count; | 163 | var containerCount = (uint)this.AttachedContainers.Count; |
164 | uint burnSectionOffsetSize = BURN_SECTION_OFFSET_UXSIZE + (containerCount * sizeof(UInt32)); | 164 | uint burnSectionOffsetSize = BURN_SECTION_OFFSET_UXSIZE + (containerCount * sizeof(uint)); |
165 | var containerSlot = new ContainerSlot((uint)containerSize); | 165 | var containerSlot = new ContainerSlot((uint)containerSize); |
166 | 166 | ||
167 | switch (container) | 167 | switch (container) |
@@ -239,13 +239,14 @@ namespace WixToolset.Core.Burn.Bundles | |||
239 | /// <param name="burnSectionOffsetSize">Offset of size field for this container in ".wixburn" section data.</param> | 239 | /// <param name="burnSectionOffsetSize">Offset of size field for this container in ".wixburn" section data.</param> |
240 | /// <param name="burnSectionCount">Number of Burn sections.</param> | 240 | /// <param name="burnSectionCount">Number of Burn sections.</param> |
241 | /// <returns>true if the container data is successfully appended; false otherwise</returns> | 241 | /// <returns>true if the container data is successfully appended; false otherwise</returns> |
242 | private bool AppendContainer(Stream containerStream, UInt32 containerSize, UInt32 burnSectionOffsetSize, UInt32 burnSectionCount) | 242 | private bool AppendContainer(Stream containerStream, uint containerSize, uint burnSectionOffsetSize, uint burnSectionCount) |
243 | { | 243 | { |
244 | if (this.invalidBundle) | 244 | if (this.invalidBundle) |
245 | { | 245 | { |
246 | return false; | 246 | return false; |
247 | } | 247 | } |
248 | if (burnSectionOffsetSize > (this.wixburnRawDataSize - sizeof(UInt32))) | 248 | |
249 | if (burnSectionOffsetSize > (this.wixburnRawDataSize - sizeof(uint))) | ||
249 | { | 250 | { |
250 | this.invalidBundle = true; | 251 | this.invalidBundle = true; |
251 | this.Messaging.Write(BurnBackendErrors.TooManyAttachedContainers(this.wixburnMaxContainers)); | 252 | this.Messaging.Write(BurnBackendErrors.TooManyAttachedContainers(this.wixburnMaxContainers)); |
diff --git a/src/wix/WixToolset.Core.Burn/Bundles/GetPackageFacadesCommand.cs b/src/wix/WixToolset.Core.Burn/Bundles/GetPackageFacadesCommand.cs index b8b256fd..2bf22a3d 100644 --- a/src/wix/WixToolset.Core.Burn/Bundles/GetPackageFacadesCommand.cs +++ b/src/wix/WixToolset.Core.Burn/Bundles/GetPackageFacadesCommand.cs | |||
@@ -129,49 +129,49 @@ namespace WixToolset.Core.Burn.Bundles | |||
129 | 129 | ||
130 | switch (package.Type) | 130 | switch (package.Type) |
131 | { | 131 | { |
132 | case WixBundlePackageType.Exe: | 132 | case WixBundlePackageType.Exe: |
133 | if (exePackages.TryGetValue(id, out var exePackage)) | 133 | if (exePackages.TryGetValue(id, out var exePackage)) |
134 | { | 134 | { |
135 | facades.Add(id, new PackageFacade(package, exePackage)); | 135 | facades.Add(id, new PackageFacade(package, exePackage)); |
136 | } | 136 | } |
137 | else | 137 | else |
138 | { | 138 | { |
139 | this.Messaging.Write(ErrorMessages.IdentifierNotFound("WixBundleExePackage", id)); | 139 | this.Messaging.Write(ErrorMessages.IdentifierNotFound("WixBundleExePackage", id)); |
140 | } | 140 | } |
141 | break; | 141 | break; |
142 | 142 | ||
143 | case WixBundlePackageType.Msi: | 143 | case WixBundlePackageType.Msi: |
144 | if (msiPackages.TryGetValue(id, out var msiPackage)) | 144 | if (msiPackages.TryGetValue(id, out var msiPackage)) |
145 | { | 145 | { |
146 | facades.Add(id, new PackageFacade(package, msiPackage)); | 146 | facades.Add(id, new PackageFacade(package, msiPackage)); |
147 | } | 147 | } |
148 | else | 148 | else |
149 | { | 149 | { |
150 | this.Messaging.Write(ErrorMessages.IdentifierNotFound("WixBundleMsiPackage", id)); | 150 | this.Messaging.Write(ErrorMessages.IdentifierNotFound("WixBundleMsiPackage", id)); |
151 | } | 151 | } |
152 | break; | 152 | break; |
153 | 153 | ||
154 | case WixBundlePackageType.Msp: | 154 | case WixBundlePackageType.Msp: |
155 | if (mspPackages.TryGetValue(id, out var mspPackage)) | 155 | if (mspPackages.TryGetValue(id, out var mspPackage)) |
156 | { | 156 | { |
157 | facades.Add(id, new PackageFacade(package, mspPackage)); | 157 | facades.Add(id, new PackageFacade(package, mspPackage)); |
158 | } | 158 | } |
159 | else | 159 | else |
160 | { | 160 | { |
161 | this.Messaging.Write(ErrorMessages.IdentifierNotFound("WixBundleMspPackage", id)); | 161 | this.Messaging.Write(ErrorMessages.IdentifierNotFound("WixBundleMspPackage", id)); |
162 | } | 162 | } |
163 | break; | 163 | break; |
164 | 164 | ||
165 | case WixBundlePackageType.Msu: | 165 | case WixBundlePackageType.Msu: |
166 | if (msuPackages.TryGetValue(id, out var msuPackage)) | 166 | if (msuPackages.TryGetValue(id, out var msuPackage)) |
167 | { | 167 | { |
168 | facades.Add(id, new PackageFacade(package, msuPackage)); | 168 | facades.Add(id, new PackageFacade(package, msuPackage)); |
169 | } | 169 | } |
170 | else | 170 | else |
171 | { | 171 | { |
172 | this.Messaging.Write(ErrorMessages.IdentifierNotFound("WixBundleMsuPackage", id)); | 172 | this.Messaging.Write(ErrorMessages.IdentifierNotFound("WixBundleMsuPackage", id)); |
173 | } | 173 | } |
174 | break; | 174 | break; |
175 | } | 175 | } |
176 | } | 176 | } |
177 | 177 | ||
diff --git a/src/wix/WixToolset.Core/Compiler_Bundle.cs b/src/wix/WixToolset.Core/Compiler_Bundle.cs index 2f31c774..f671e90b 100644 --- a/src/wix/WixToolset.Core/Compiler_Bundle.cs +++ b/src/wix/WixToolset.Core/Compiler_Bundle.cs | |||
@@ -40,36 +40,36 @@ namespace WixToolset.Core | |||
40 | { | 40 | { |
41 | switch (attrib.Name.LocalName) | 41 | switch (attrib.Name.LocalName) |
42 | { | 42 | { |
43 | case "Id": | 43 | case "Id": |
44 | id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); | 44 | id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); |
45 | break; | ||
46 | case "Bitness": | ||
47 | var bitnessValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
48 | switch (bitnessValue) | ||
49 | { | ||
50 | case "always32": | ||
51 | win64 = false; | ||
52 | break; | 45 | break; |
53 | case "always64": | 46 | case "Bitness": |
54 | win64 = true; | 47 | var bitnessValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
48 | switch (bitnessValue) | ||
49 | { | ||
50 | case "always32": | ||
51 | win64 = false; | ||
52 | break; | ||
53 | case "always64": | ||
54 | win64 = true; | ||
55 | break; | ||
56 | case "default": | ||
57 | case "": | ||
58 | break; | ||
59 | default: | ||
60 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, bitnessValue, "default", "always32", "always64")); | ||
61 | break; | ||
62 | } | ||
63 | break; | ||
64 | case "Key": | ||
65 | key = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
55 | break; | 66 | break; |
56 | case "default": | 67 | case "Value": |
57 | case "": | 68 | valueName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
58 | break; | 69 | break; |
59 | default: | 70 | default: |
60 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, bitnessValue, "default", "always32", "always64")); | 71 | this.Core.UnexpectedAttribute(node, attrib); |
61 | break; | 72 | break; |
62 | } | ||
63 | break; | ||
64 | case "Key": | ||
65 | key = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
66 | break; | ||
67 | case "Value": | ||
68 | valueName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
69 | break; | ||
70 | default: | ||
71 | this.Core.UnexpectedAttribute(node, attrib); | ||
72 | break; | ||
73 | } | 73 | } |
74 | } | 74 | } |
75 | else | 75 | else |
@@ -133,7 +133,7 @@ namespace WixToolset.Core | |||
133 | string parentName = null; | 133 | string parentName = null; |
134 | 134 | ||
135 | string fileSystemSafeBundleName = null; | 135 | string fileSystemSafeBundleName = null; |
136 | string logVariablePrefixAndExtension = null; | 136 | string logVariablePrefixAndExtension; |
137 | string iconSourceFile = null; | 137 | string iconSourceFile = null; |
138 | string splashScreenSourceFile = null; | 138 | string splashScreenSourceFile = null; |
139 | 139 | ||
@@ -144,98 +144,98 @@ namespace WixToolset.Core | |||
144 | { | 144 | { |
145 | switch (attrib.Name.LocalName) | 145 | switch (attrib.Name.LocalName) |
146 | { | 146 | { |
147 | case "AboutUrl": | 147 | case "AboutUrl": |
148 | aboutUrl = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 148 | aboutUrl = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
149 | break; | ||
150 | case "CommandLineVariables": | ||
151 | var commandLineVariablesValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
152 | switch (commandLineVariablesValue) | ||
153 | { | ||
154 | case "upperCase": | ||
155 | commandLineVariables = WixBundleCommandLineVariables.UpperCase; | ||
156 | break; | 149 | break; |
157 | case "caseSensitive": | 150 | case "CommandLineVariables": |
158 | commandLineVariables = WixBundleCommandLineVariables.CaseSensitive; | 151 | var commandLineVariablesValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
152 | switch (commandLineVariablesValue) | ||
153 | { | ||
154 | case "upperCase": | ||
155 | commandLineVariables = WixBundleCommandLineVariables.UpperCase; | ||
156 | break; | ||
157 | case "caseSensitive": | ||
158 | commandLineVariables = WixBundleCommandLineVariables.CaseSensitive; | ||
159 | break; | ||
160 | default: | ||
161 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, commandLineVariablesValue, "upperCase", "caseSensitive")); | ||
162 | break; | ||
163 | } | ||
159 | break; | 164 | break; |
160 | default: | 165 | case "Compressed": |
161 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, commandLineVariablesValue, "upperCase", "caseSensitive")); | 166 | compressed = this.Core.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib); |
162 | break; | 167 | break; |
163 | } | 168 | case "Condition": |
164 | break; | 169 | condition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
165 | case "Compressed": | 170 | break; |
166 | compressed = this.Core.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib); | 171 | case "Copyright": |
167 | break; | 172 | copyright = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
168 | case "Condition": | 173 | break; |
169 | condition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 174 | case "DisableModify": |
170 | break; | 175 | var value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
171 | case "Copyright": | 176 | switch (value) |
172 | copyright = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 177 | { |
173 | break; | 178 | case "button": |
174 | case "DisableModify": | 179 | attributes |= WixBundleAttributes.SingleChangeUninstallButton; |
175 | var value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 180 | break; |
176 | switch (value) | 181 | case "yes": |
177 | { | 182 | attributes |= WixBundleAttributes.DisableModify; |
178 | case "button": | 183 | break; |
179 | attributes |= WixBundleAttributes.SingleChangeUninstallButton; | 184 | case "no": |
185 | break; | ||
186 | default: | ||
187 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, value, "button", "yes", "no")); | ||
188 | break; | ||
189 | } | ||
190 | break; | ||
191 | case "DisableRemove": | ||
192 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
193 | { | ||
194 | attributes |= WixBundleAttributes.DisableRemove; | ||
195 | } | ||
196 | break; | ||
197 | case "HelpTelephone": | ||
198 | helpTelephone = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
199 | break; | ||
200 | case "HelpUrl": | ||
201 | helpUrl = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
202 | break; | ||
203 | case "Manufacturer": | ||
204 | manufacturer = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
205 | break; | ||
206 | case "IconSourceFile": | ||
207 | iconSourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
208 | break; | ||
209 | case "InProgressName": | ||
210 | inProgressName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
211 | break; | ||
212 | case "Name": | ||
213 | name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
214 | break; | ||
215 | case "ParentName": | ||
216 | parentName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
217 | break; | ||
218 | case "ProviderKey": | ||
219 | // This can't be processed until we create the section. | ||
220 | break; | ||
221 | case "SplashScreenSourceFile": | ||
222 | splashScreenSourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
180 | break; | 223 | break; |
181 | case "yes": | 224 | case "Tag": |
182 | attributes |= WixBundleAttributes.DisableModify; | 225 | tag = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
183 | break; | 226 | break; |
184 | case "no": | 227 | case "UpdateUrl": |
228 | updateUrl = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
229 | break; | ||
230 | case "UpgradeCode": | ||
231 | upgradeCode = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); | ||
232 | break; | ||
233 | case "Version": | ||
234 | version = this.Core.GetAttributeVersionValue(sourceLineNumbers, attrib); | ||
185 | break; | 235 | break; |
186 | default: | 236 | default: |
187 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, value, "button", "yes", "no")); | 237 | this.Core.UnexpectedAttribute(node, attrib); |
188 | break; | 238 | break; |
189 | } | ||
190 | break; | ||
191 | case "DisableRemove": | ||
192 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
193 | { | ||
194 | attributes |= WixBundleAttributes.DisableRemove; | ||
195 | } | ||
196 | break; | ||
197 | case "HelpTelephone": | ||
198 | helpTelephone = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
199 | break; | ||
200 | case "HelpUrl": | ||
201 | helpUrl = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
202 | break; | ||
203 | case "Manufacturer": | ||
204 | manufacturer = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
205 | break; | ||
206 | case "IconSourceFile": | ||
207 | iconSourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
208 | break; | ||
209 | case "InProgressName": | ||
210 | inProgressName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
211 | break; | ||
212 | case "Name": | ||
213 | name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
214 | break; | ||
215 | case "ParentName": | ||
216 | parentName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
217 | break; | ||
218 | case "ProviderKey": | ||
219 | // This can't be processed until we create the section. | ||
220 | break; | ||
221 | case "SplashScreenSourceFile": | ||
222 | splashScreenSourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
223 | break; | ||
224 | case "Tag": | ||
225 | tag = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
226 | break; | ||
227 | case "UpdateUrl": | ||
228 | updateUrl = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
229 | break; | ||
230 | case "UpgradeCode": | ||
231 | upgradeCode = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); | ||
232 | break; | ||
233 | case "Version": | ||
234 | version = this.Core.GetAttributeVersionValue(sourceLineNumbers, attrib); | ||
235 | break; | ||
236 | default: | ||
237 | this.Core.UnexpectedAttribute(node, attrib); | ||
238 | break; | ||
239 | } | 239 | } |
240 | } | 240 | } |
241 | } | 241 | } |
@@ -314,87 +314,87 @@ namespace WixToolset.Core | |||
314 | { | 314 | { |
315 | switch (child.Name.LocalName) | 315 | switch (child.Name.LocalName) |
316 | { | 316 | { |
317 | case "ApprovedExeForElevation": | 317 | case "ApprovedExeForElevation": |
318 | this.ParseApprovedExeForElevation(child); | 318 | this.ParseApprovedExeForElevation(child); |
319 | break; | 319 | break; |
320 | case "BootstrapperApplication": | 320 | case "BootstrapperApplication": |
321 | this.ParseBootstrapperApplicationElement(child); | 321 | this.ParseBootstrapperApplicationElement(child); |
322 | break; | 322 | break; |
323 | case "BootstrapperApplicationRef": | 323 | case "BootstrapperApplicationRef": |
324 | this.ParseBootstrapperApplicationRefElement(child); | 324 | this.ParseBootstrapperApplicationRefElement(child); |
325 | break; | 325 | break; |
326 | case "BundleCustomData": | 326 | case "BundleCustomData": |
327 | this.ParseBundleCustomDataElement(child); | 327 | this.ParseBundleCustomDataElement(child); |
328 | break; | 328 | break; |
329 | case "BundleCustomDataRef": | 329 | case "BundleCustomDataRef": |
330 | this.ParseBundleCustomDataRefElement(child); | 330 | this.ParseBundleCustomDataRefElement(child); |
331 | break; | 331 | break; |
332 | case "BundleExtension": | 332 | case "BundleExtension": |
333 | this.ParseBundleExtensionElement(child); | 333 | this.ParseBundleExtensionElement(child); |
334 | break; | 334 | break; |
335 | case "BundleExtensionRef": | 335 | case "BundleExtensionRef": |
336 | this.ParseSimpleRefElement(child, SymbolDefinitions.WixBundleExtension); | 336 | this.ParseSimpleRefElement(child, SymbolDefinitions.WixBundleExtension); |
337 | break; | 337 | break; |
338 | case "OptionalUpdateRegistration": | 338 | case "OptionalUpdateRegistration": |
339 | this.ParseOptionalUpdateRegistrationElement(child, manufacturer, parentName, name); | 339 | this.ParseOptionalUpdateRegistrationElement(child, manufacturer, parentName, name); |
340 | break; | 340 | break; |
341 | case "Chain": | 341 | case "Chain": |
342 | if (chainSeen) | 342 | if (chainSeen) |
343 | { | 343 | { |
344 | var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); | 344 | var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); |
345 | this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, "Chain")); | 345 | this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, "Chain")); |
346 | } | 346 | } |
347 | this.ParseChainElement(child); | 347 | this.ParseChainElement(child); |
348 | chainSeen = true; | 348 | chainSeen = true; |
349 | break; | 349 | break; |
350 | case "Container": | 350 | case "Container": |
351 | this.ParseContainerElement(child); | 351 | this.ParseContainerElement(child); |
352 | break; | 352 | break; |
353 | case "ContainerRef": | 353 | case "ContainerRef": |
354 | this.ParseSimpleRefElement(child, SymbolDefinitions.WixBundleContainer); | 354 | this.ParseSimpleRefElement(child, SymbolDefinitions.WixBundleContainer); |
355 | break; | 355 | break; |
356 | case "Log": | 356 | case "Log": |
357 | if (logSeen) | 357 | if (logSeen) |
358 | { | 358 | { |
359 | var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); | 359 | var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); |
360 | this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, "Log")); | 360 | this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, "Log")); |
361 | } | 361 | } |
362 | logVariablePrefixAndExtension = this.ParseLogElement(child, fileSystemSafeBundleName); | 362 | logVariablePrefixAndExtension = this.ParseLogElement(child, fileSystemSafeBundleName); |
363 | logSeen = true; | 363 | logSeen = true; |
364 | break; | 364 | break; |
365 | case "PayloadGroup": | 365 | case "PayloadGroup": |
366 | this.ParsePayloadGroupElement(child, ComplexReferenceParentType.Layout, Compiler.BundleLayoutOnlyPayloads); | 366 | this.ParsePayloadGroupElement(child, ComplexReferenceParentType.Layout, Compiler.BundleLayoutOnlyPayloads); |
367 | break; | 367 | break; |
368 | case "PayloadGroupRef": | 368 | case "PayloadGroupRef": |
369 | this.ParsePayloadGroupRefElement(child, ComplexReferenceParentType.Layout, Compiler.BundleLayoutOnlyPayloads); | 369 | this.ParsePayloadGroupRefElement(child, ComplexReferenceParentType.Layout, Compiler.BundleLayoutOnlyPayloads); |
370 | break; | 370 | break; |
371 | case "RelatedBundle": | 371 | case "RelatedBundle": |
372 | this.ParseRelatedBundleElement(child); | 372 | this.ParseRelatedBundleElement(child); |
373 | break; | 373 | break; |
374 | case "Requires": | 374 | case "Requires": |
375 | this.ParseRequiresElement(child, null); | 375 | this.ParseRequiresElement(child, null); |
376 | break; | 376 | break; |
377 | case "SetVariable": | 377 | case "SetVariable": |
378 | this.ParseSetVariableElement(child); | 378 | this.ParseSetVariableElement(child); |
379 | break; | 379 | break; |
380 | case "SetVariableRef": | 380 | case "SetVariableRef": |
381 | this.ParseSimpleRefElement(child, SymbolDefinitions.WixSetVariable); | 381 | this.ParseSimpleRefElement(child, SymbolDefinitions.WixSetVariable); |
382 | break; | 382 | break; |
383 | case "SoftwareTag": | 383 | case "SoftwareTag": |
384 | this.ParseBundleTagElement(child); | 384 | this.ParseBundleTagElement(child); |
385 | break; | 385 | break; |
386 | case "Update": | 386 | case "Update": |
387 | this.ParseUpdateElement(child); | 387 | this.ParseUpdateElement(child); |
388 | break; | 388 | break; |
389 | case "Variable": | 389 | case "Variable": |
390 | this.ParseVariableElement(child); | 390 | this.ParseVariableElement(child); |
391 | break; | 391 | break; |
392 | case "WixVariable": | 392 | case "WixVariable": |
393 | this.ParseWixVariableElement(child); | 393 | this.ParseWixVariableElement(child); |
394 | break; | 394 | break; |
395 | default: | 395 | default: |
396 | this.Core.UnexpectedElement(node, child); | 396 | this.Core.UnexpectedElement(node, child); |
397 | break; | 397 | break; |
398 | } | 398 | } |
399 | } | 399 | } |
400 | else | 400 | else |
@@ -508,21 +508,21 @@ namespace WixToolset.Core | |||
508 | { | 508 | { |
509 | switch (attrib.Name.LocalName) | 509 | switch (attrib.Name.LocalName) |
510 | { | 510 | { |
511 | case "Disable": | 511 | case "Disable": |
512 | disableLog = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 512 | disableLog = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
513 | break; | 513 | break; |
514 | case "PathVariable": | 514 | case "PathVariable": |
515 | variable = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | 515 | variable = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); |
516 | break; | 516 | break; |
517 | case "Prefix": | 517 | case "Prefix": |
518 | logPrefix = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 518 | logPrefix = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
519 | break; | 519 | break; |
520 | case "Extension": | 520 | case "Extension": |
521 | logExtension = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 521 | logExtension = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
522 | break; | 522 | break; |
523 | default: | 523 | default: |
524 | this.Core.UnexpectedAttribute(node, attrib); | 524 | this.Core.UnexpectedAttribute(node, attrib); |
525 | break; | 525 | break; |
526 | } | 526 | } |
527 | } | 527 | } |
528 | else | 528 | else |
@@ -559,37 +559,37 @@ namespace WixToolset.Core | |||
559 | { | 559 | { |
560 | switch (attrib.Name.LocalName) | 560 | switch (attrib.Name.LocalName) |
561 | { | 561 | { |
562 | case "Id": | 562 | case "Id": |
563 | id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); | 563 | id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); |
564 | if (id?.Id == BurnConstants.BurnUXContainerName || id?.Id == BurnConstants.BurnDefaultAttachedContainerName) | 564 | if (id?.Id == BurnConstants.BurnUXContainerName || id?.Id == BurnConstants.BurnDefaultAttachedContainerName) |
565 | { | 565 | { |
566 | this.Messaging.Write(CompilerErrors.ReservedValue(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); | 566 | this.Messaging.Write(CompilerErrors.ReservedValue(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); |
567 | } | 567 | } |
568 | break; | 568 | break; |
569 | case "DownloadUrl": | 569 | case "DownloadUrl": |
570 | downloadUrl = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 570 | downloadUrl = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
571 | break; | 571 | break; |
572 | case "Name": | 572 | case "Name": |
573 | name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 573 | name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
574 | break; | 574 | break; |
575 | case "Type": | 575 | case "Type": |
576 | var typeString = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 576 | var typeString = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
577 | switch (typeString) | 577 | switch (typeString) |
578 | { | 578 | { |
579 | case "attached": | 579 | case "attached": |
580 | type = ContainerType.Attached; | 580 | type = ContainerType.Attached; |
581 | break; | 581 | break; |
582 | case "detached": | 582 | case "detached": |
583 | type = ContainerType.Detached; | 583 | type = ContainerType.Detached; |
584 | break; | 584 | break; |
585 | default: | 585 | default: |
586 | this.Core.Write(ErrorMessages.IllegalAttributeValueWithLegalList(sourceLineNumbers, node.Name.LocalName, "Type", typeString, "attached, detached")); | 586 | this.Core.Write(ErrorMessages.IllegalAttributeValueWithLegalList(sourceLineNumbers, node.Name.LocalName, "Type", typeString, "attached, detached")); |
587 | break; | 587 | break; |
588 | } | 588 | } |
589 | break; | 589 | break; |
590 | default: | 590 | default: |
591 | this.Core.UnexpectedAttribute(node, attrib); | 591 | this.Core.UnexpectedAttribute(node, attrib); |
592 | break; | 592 | break; |
593 | } | 593 | } |
594 | } | 594 | } |
595 | else | 595 | else |
@@ -631,12 +631,12 @@ namespace WixToolset.Core | |||
631 | { | 631 | { |
632 | switch (child.Name.LocalName) | 632 | switch (child.Name.LocalName) |
633 | { | 633 | { |
634 | case "PackageGroupRef": | 634 | case "PackageGroupRef": |
635 | this.ParsePackageGroupRefElement(child, ComplexReferenceParentType.Container, id.Id); | 635 | this.ParsePackageGroupRefElement(child, ComplexReferenceParentType.Container, id.Id); |
636 | break; | 636 | break; |
637 | default: | 637 | default: |
638 | this.Core.UnexpectedElement(node, child); | 638 | this.Core.UnexpectedElement(node, child); |
639 | break; | 639 | break; |
640 | } | 640 | } |
641 | } | 641 | } |
642 | else | 642 | else |
@@ -845,12 +845,12 @@ namespace WixToolset.Core | |||
845 | { | 845 | { |
846 | switch (attrib.Name.LocalName) | 846 | switch (attrib.Name.LocalName) |
847 | { | 847 | { |
848 | case "Id": | 848 | case "Id": |
849 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 849 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
850 | break; | 850 | break; |
851 | default: | 851 | default: |
852 | this.Core.UnexpectedAttribute(node, attrib); | 852 | this.Core.UnexpectedAttribute(node, attrib); |
853 | break; | 853 | break; |
854 | } | 854 | } |
855 | } | 855 | } |
856 | else | 856 | else |
@@ -865,15 +865,15 @@ namespace WixToolset.Core | |||
865 | { | 865 | { |
866 | switch (child.Name.LocalName) | 866 | switch (child.Name.LocalName) |
867 | { | 867 | { |
868 | case "Payload": | 868 | case "Payload": |
869 | this.ParsePayloadElement(child, ComplexReferenceParentType.Container, Compiler.BurnUXContainerId); | 869 | this.ParsePayloadElement(child, ComplexReferenceParentType.Container, Compiler.BurnUXContainerId); |
870 | break; | 870 | break; |
871 | case "PayloadGroupRef": | 871 | case "PayloadGroupRef": |
872 | this.ParsePayloadGroupRefElement(child, ComplexReferenceParentType.Container, Compiler.BurnUXContainerId); | 872 | this.ParsePayloadGroupRefElement(child, ComplexReferenceParentType.Container, Compiler.BurnUXContainerId); |
873 | break; | 873 | break; |
874 | default: | 874 | default: |
875 | this.Core.UnexpectedElement(node, child); | 875 | this.Core.UnexpectedElement(node, child); |
876 | break; | 876 | break; |
877 | } | 877 | } |
878 | } | 878 | } |
879 | else | 879 | else |
@@ -1303,24 +1303,24 @@ namespace WixToolset.Core | |||
1303 | { | 1303 | { |
1304 | switch (attrib.Name.LocalName) | 1304 | switch (attrib.Name.LocalName) |
1305 | { | 1305 | { |
1306 | case "Manufacturer": | 1306 | case "Manufacturer": |
1307 | manufacturer = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 1307 | manufacturer = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
1308 | break; | 1308 | break; |
1309 | case "Department": | 1309 | case "Department": |
1310 | department = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 1310 | department = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
1311 | break; | 1311 | break; |
1312 | case "ProductFamily": | 1312 | case "ProductFamily": |
1313 | productFamily = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 1313 | productFamily = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
1314 | break; | 1314 | break; |
1315 | case "Name": | 1315 | case "Name": |
1316 | name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 1316 | name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
1317 | break; | 1317 | break; |
1318 | case "Classification": | 1318 | case "Classification": |
1319 | classification = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 1319 | classification = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
1320 | break; | 1320 | break; |
1321 | default: | 1321 | default: |
1322 | this.Core.UnexpectedAttribute(node, attrib); | 1322 | this.Core.UnexpectedAttribute(node, attrib); |
1323 | break; | 1323 | break; |
1324 | } | 1324 | } |
1325 | } | 1325 | } |
1326 | else | 1326 | else |
@@ -1490,12 +1490,12 @@ namespace WixToolset.Core | |||
1490 | { | 1490 | { |
1491 | switch (attrib.Name.LocalName) | 1491 | switch (attrib.Name.LocalName) |
1492 | { | 1492 | { |
1493 | case "Id": | 1493 | case "Id": |
1494 | id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); | 1494 | id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); |
1495 | break; | 1495 | break; |
1496 | default: | 1496 | default: |
1497 | this.Core.UnexpectedAttribute(node, attrib); | 1497 | this.Core.UnexpectedAttribute(node, attrib); |
1498 | break; | 1498 | break; |
1499 | } | 1499 | } |
1500 | } | 1500 | } |
1501 | else | 1501 | else |
@@ -1517,27 +1517,27 @@ namespace WixToolset.Core | |||
1517 | WixBundlePackageType? packageType = null; | 1517 | WixBundlePackageType? packageType = null; |
1518 | switch (child.Name.LocalName) | 1518 | switch (child.Name.LocalName) |
1519 | { | 1519 | { |
1520 | case "ExePackagePayload": | 1520 | case "ExePackagePayload": |
1521 | packageType = WixBundlePackageType.Exe; | 1521 | packageType = WixBundlePackageType.Exe; |
1522 | break; | 1522 | break; |
1523 | case "MsiPackagePayload": | 1523 | case "MsiPackagePayload": |
1524 | packageType = WixBundlePackageType.Msi; | 1524 | packageType = WixBundlePackageType.Msi; |
1525 | break; | 1525 | break; |
1526 | case "MspPackagePayload": | 1526 | case "MspPackagePayload": |
1527 | packageType = WixBundlePackageType.Msp; | 1527 | packageType = WixBundlePackageType.Msp; |
1528 | break; | 1528 | break; |
1529 | case "MsuPackagePayload": | 1529 | case "MsuPackagePayload": |
1530 | packageType = WixBundlePackageType.Msu; | 1530 | packageType = WixBundlePackageType.Msu; |
1531 | break; | 1531 | break; |
1532 | case "Payload": | 1532 | case "Payload": |
1533 | this.ParsePayloadElement(child, ComplexReferenceParentType.PayloadGroup, id); | 1533 | this.ParsePayloadElement(child, ComplexReferenceParentType.PayloadGroup, id); |
1534 | break; | 1534 | break; |
1535 | case "PayloadGroupRef": | 1535 | case "PayloadGroupRef": |
1536 | this.ParsePayloadGroupRefElement(child, ComplexReferenceParentType.PayloadGroup, id); | 1536 | this.ParsePayloadGroupRefElement(child, ComplexReferenceParentType.PayloadGroup, id); |
1537 | break; | 1537 | break; |
1538 | default: | 1538 | default: |
1539 | this.Core.UnexpectedElement(node, child); | 1539 | this.Core.UnexpectedElement(node, child); |
1540 | break; | 1540 | break; |
1541 | } | 1541 | } |
1542 | 1542 | ||
1543 | if (packageType.HasValue) | 1543 | if (packageType.HasValue) |
@@ -1584,13 +1584,13 @@ namespace WixToolset.Core | |||
1584 | { | 1584 | { |
1585 | switch (attrib.Name.LocalName) | 1585 | switch (attrib.Name.LocalName) |
1586 | { | 1586 | { |
1587 | case "Id": | 1587 | case "Id": |
1588 | id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); | 1588 | id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); |
1589 | this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixBundlePayloadGroup, id.Id); | 1589 | this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixBundlePayloadGroup, id.Id); |
1590 | break; | 1590 | break; |
1591 | default: | 1591 | default: |
1592 | this.Core.UnexpectedAttribute(node, attrib); | 1592 | this.Core.UnexpectedAttribute(node, attrib); |
1593 | break; | 1593 | break; |
1594 | } | 1594 | } |
1595 | } | 1595 | } |
1596 | else | 1596 | else |
@@ -1628,34 +1628,34 @@ namespace WixToolset.Core | |||
1628 | { | 1628 | { |
1629 | switch (attrib.Name.LocalName) | 1629 | switch (attrib.Name.LocalName) |
1630 | { | 1630 | { |
1631 | case "Value": | 1631 | case "Value": |
1632 | value = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, Int32.MinValue + 2, Int32.MaxValue); | 1632 | value = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, Int32.MinValue + 2, Int32.MaxValue); |
1633 | break; | 1633 | break; |
1634 | case "Behavior": | 1634 | case "Behavior": |
1635 | var behaviorString = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 1635 | var behaviorString = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
1636 | switch (behaviorString) | 1636 | switch (behaviorString) |
1637 | { | 1637 | { |
1638 | case "error": | 1638 | case "error": |
1639 | behavior = ExitCodeBehaviorType.Error; | 1639 | behavior = ExitCodeBehaviorType.Error; |
1640 | break; | 1640 | break; |
1641 | case "forceReboot": | 1641 | case "forceReboot": |
1642 | behavior = ExitCodeBehaviorType.ForceReboot; | 1642 | behavior = ExitCodeBehaviorType.ForceReboot; |
1643 | break; | 1643 | break; |
1644 | case "scheduleReboot": | 1644 | case "scheduleReboot": |
1645 | behavior = ExitCodeBehaviorType.ScheduleReboot; | 1645 | behavior = ExitCodeBehaviorType.ScheduleReboot; |
1646 | break; | 1646 | break; |
1647 | case "success": | 1647 | case "success": |
1648 | behavior = ExitCodeBehaviorType.Success; | 1648 | behavior = ExitCodeBehaviorType.Success; |
1649 | break; | 1649 | break; |
1650 | default: | 1650 | default: |
1651 | this.Core.Write(ErrorMessages.IllegalAttributeValueWithLegalList(sourceLineNumbers, node.Name.LocalName, "Behavior", behaviorString, "success, error, scheduleReboot, forceReboot")); | 1651 | this.Core.Write(ErrorMessages.IllegalAttributeValueWithLegalList(sourceLineNumbers, node.Name.LocalName, "Behavior", behaviorString, "success, error, scheduleReboot, forceReboot")); |
1652 | behavior = ExitCodeBehaviorType.Success; // set value to avoid ExpectedAttribute below. | 1652 | behavior = ExitCodeBehaviorType.Success; // set value to avoid ExpectedAttribute below. |
1653 | break; | 1653 | break; |
1654 | } | 1654 | } |
1655 | break; | 1655 | break; |
1656 | default: | 1656 | default: |
1657 | this.Core.UnexpectedAttribute(node, attrib); | 1657 | this.Core.UnexpectedAttribute(node, attrib); |
1658 | break; | 1658 | break; |
1659 | } | 1659 | } |
1660 | } | 1660 | } |
1661 | else | 1661 | else |
@@ -1697,27 +1697,27 @@ namespace WixToolset.Core | |||
1697 | { | 1697 | { |
1698 | switch (attrib.Name.LocalName) | 1698 | switch (attrib.Name.LocalName) |
1699 | { | 1699 | { |
1700 | case "DisableRollback": | 1700 | case "DisableRollback": |
1701 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | 1701 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) |
1702 | { | 1702 | { |
1703 | attributes |= WixChainAttributes.DisableRollback; | 1703 | attributes |= WixChainAttributes.DisableRollback; |
1704 | } | 1704 | } |
1705 | break; | 1705 | break; |
1706 | case "DisableSystemRestore": | 1706 | case "DisableSystemRestore": |
1707 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | 1707 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) |
1708 | { | 1708 | { |
1709 | attributes |= WixChainAttributes.DisableSystemRestore; | 1709 | attributes |= WixChainAttributes.DisableSystemRestore; |
1710 | } | 1710 | } |
1711 | break; | 1711 | break; |
1712 | case "ParallelCache": | 1712 | case "ParallelCache": |
1713 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | 1713 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) |
1714 | { | 1714 | { |
1715 | attributes |= WixChainAttributes.ParallelCache; | 1715 | attributes |= WixChainAttributes.ParallelCache; |
1716 | } | 1716 | } |
1717 | break; | 1717 | break; |
1718 | default: | 1718 | default: |
1719 | this.Core.UnexpectedAttribute(node, attrib); | 1719 | this.Core.UnexpectedAttribute(node, attrib); |
1720 | break; | 1720 | break; |
1721 | } | 1721 | } |
1722 | } | 1722 | } |
1723 | else | 1723 | else |
@@ -1735,33 +1735,33 @@ namespace WixToolset.Core | |||
1735 | { | 1735 | { |
1736 | switch (child.Name.LocalName) | 1736 | switch (child.Name.LocalName) |
1737 | { | 1737 | { |
1738 | case "MsiPackage": | 1738 | case "MsiPackage": |
1739 | previousId = this.ParseMsiPackageElement(child, ComplexReferenceParentType.PackageGroup, BurnConstants.BundleChainPackageGroupId, previousType, previousId); | 1739 | previousId = this.ParseMsiPackageElement(child, ComplexReferenceParentType.PackageGroup, BurnConstants.BundleChainPackageGroupId, previousType, previousId); |
1740 | previousType = ComplexReferenceChildType.Package; | 1740 | previousType = ComplexReferenceChildType.Package; |
1741 | break; | 1741 | break; |
1742 | case "MspPackage": | 1742 | case "MspPackage": |
1743 | previousId = this.ParseMspPackageElement(child, ComplexReferenceParentType.PackageGroup, BurnConstants.BundleChainPackageGroupId, previousType, previousId); | 1743 | previousId = this.ParseMspPackageElement(child, ComplexReferenceParentType.PackageGroup, BurnConstants.BundleChainPackageGroupId, previousType, previousId); |
1744 | previousType = ComplexReferenceChildType.Package; | 1744 | previousType = ComplexReferenceChildType.Package; |
1745 | break; | 1745 | break; |
1746 | case "MsuPackage": | 1746 | case "MsuPackage": |
1747 | previousId = this.ParseMsuPackageElement(child, ComplexReferenceParentType.PackageGroup, BurnConstants.BundleChainPackageGroupId, previousType, previousId); | 1747 | previousId = this.ParseMsuPackageElement(child, ComplexReferenceParentType.PackageGroup, BurnConstants.BundleChainPackageGroupId, previousType, previousId); |
1748 | previousType = ComplexReferenceChildType.Package; | 1748 | previousType = ComplexReferenceChildType.Package; |
1749 | break; | 1749 | break; |
1750 | case "ExePackage": | 1750 | case "ExePackage": |
1751 | previousId = this.ParseExePackageElement(child, ComplexReferenceParentType.PackageGroup, BurnConstants.BundleChainPackageGroupId, previousType, previousId); | 1751 | previousId = this.ParseExePackageElement(child, ComplexReferenceParentType.PackageGroup, BurnConstants.BundleChainPackageGroupId, previousType, previousId); |
1752 | previousType = ComplexReferenceChildType.Package; | 1752 | previousType = ComplexReferenceChildType.Package; |
1753 | break; | 1753 | break; |
1754 | case "RollbackBoundary": | 1754 | case "RollbackBoundary": |
1755 | previousId = this.ParseRollbackBoundaryElement(child, ComplexReferenceParentType.PackageGroup, BurnConstants.BundleChainPackageGroupId, previousType, previousId); | 1755 | previousId = this.ParseRollbackBoundaryElement(child, ComplexReferenceParentType.PackageGroup, BurnConstants.BundleChainPackageGroupId, previousType, previousId); |
1756 | previousType = ComplexReferenceChildType.Package; | 1756 | previousType = ComplexReferenceChildType.Package; |
1757 | break; | 1757 | break; |
1758 | case "PackageGroupRef": | 1758 | case "PackageGroupRef": |
1759 | previousId = this.ParsePackageGroupRefElement(child, ComplexReferenceParentType.PackageGroup, BurnConstants.BundleChainPackageGroupId, previousType, previousId); | 1759 | previousId = this.ParsePackageGroupRefElement(child, ComplexReferenceParentType.PackageGroup, BurnConstants.BundleChainPackageGroupId, previousType, previousId); |
1760 | previousType = ComplexReferenceChildType.PackageGroup; | 1760 | previousType = ComplexReferenceChildType.PackageGroup; |
1761 | break; | 1761 | break; |
1762 | default: | 1762 | default: |
1763 | this.Core.UnexpectedElement(node, child); | 1763 | this.Core.UnexpectedElement(node, child); |
1764 | break; | 1764 | break; |
1765 | } | 1765 | } |
1766 | } | 1766 | } |
1767 | else | 1767 | else |
@@ -1872,25 +1872,25 @@ namespace WixToolset.Core | |||
1872 | var allowed = true; | 1872 | var allowed = true; |
1873 | switch (attrib.Name.LocalName) | 1873 | switch (attrib.Name.LocalName) |
1874 | { | 1874 | { |
1875 | case "Id": | 1875 | case "Id": |
1876 | id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); | 1876 | id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); |
1877 | if (id?.Id == BurnConstants.BundleDefaultBoundaryId) | 1877 | if (id?.Id == BurnConstants.BundleDefaultBoundaryId) |
1878 | { | 1878 | { |
1879 | this.Messaging.Write(CompilerErrors.ReservedValue(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); | 1879 | this.Messaging.Write(CompilerErrors.ReservedValue(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); |
1880 | } | 1880 | } |
1881 | break; | 1881 | break; |
1882 | case "Vital": | 1882 | case "Vital": |
1883 | vital = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 1883 | vital = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
1884 | break; | 1884 | break; |
1885 | case "Transaction": | 1885 | case "Transaction": |
1886 | transaction = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 1886 | transaction = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
1887 | break; | 1887 | break; |
1888 | case "LogPathVariable": | 1888 | case "LogPathVariable": |
1889 | logPathVariable = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | 1889 | logPathVariable = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); |
1890 | break; | 1890 | break; |
1891 | default: | 1891 | default: |
1892 | allowed = false; | 1892 | allowed = false; |
1893 | break; | 1893 | break; |
1894 | } | 1894 | } |
1895 | 1895 | ||
1896 | if (!allowed) | 1896 | if (!allowed) |
@@ -2016,126 +2016,126 @@ namespace WixToolset.Core | |||
2016 | var allowed = true; | 2016 | var allowed = true; |
2017 | switch (attrib.Name.LocalName) | 2017 | switch (attrib.Name.LocalName) |
2018 | { | 2018 | { |
2019 | case "Id": | 2019 | case "Id": |
2020 | compilerPayload.ParseId(attrib); | 2020 | compilerPayload.ParseId(attrib); |
2021 | break; | 2021 | break; |
2022 | case "Name": | 2022 | case "Name": |
2023 | compilerPayload.ParseName(attrib); | 2023 | compilerPayload.ParseName(attrib); |
2024 | hasPayloadInfo = true; | 2024 | hasPayloadInfo = true; |
2025 | break; | 2025 | break; |
2026 | case "SourceFile": | 2026 | case "SourceFile": |
2027 | compilerPayload.ParseSourceFile(attrib); | 2027 | compilerPayload.ParseSourceFile(attrib); |
2028 | hasPayloadInfo = true; | 2028 | hasPayloadInfo = true; |
2029 | break; | 2029 | break; |
2030 | case "DownloadUrl": | 2030 | case "DownloadUrl": |
2031 | compilerPayload.ParseDownloadUrl(attrib); | 2031 | compilerPayload.ParseDownloadUrl(attrib); |
2032 | hasPayloadInfo = true; | 2032 | hasPayloadInfo = true; |
2033 | break; | 2033 | break; |
2034 | case "After": | 2034 | case "After": |
2035 | after = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 2035 | after = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
2036 | break; | 2036 | break; |
2037 | case "InstallCondition": | 2037 | case "InstallCondition": |
2038 | installCondition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 2038 | installCondition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
2039 | break; | 2039 | break; |
2040 | case "Cache": | 2040 | case "Cache": |
2041 | var value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 2041 | var value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
2042 | switch (value) | 2042 | switch (value) |
2043 | { | 2043 | { |
2044 | case "force": | 2044 | case "force": |
2045 | cache = BundleCacheType.Force; | 2045 | cache = BundleCacheType.Force; |
2046 | break; | ||
2047 | case "keep": | ||
2048 | cache = BundleCacheType.Keep; | ||
2049 | break; | ||
2050 | case "remove": | ||
2051 | cache = BundleCacheType.Remove; | ||
2052 | break; | ||
2053 | case "": | ||
2054 | break; | ||
2055 | default: | ||
2056 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, value, "force", "keep", "remove")); | ||
2057 | break; | ||
2058 | } | ||
2059 | break; | ||
2060 | case "CacheId": | ||
2061 | cacheId = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
2062 | break; | ||
2063 | case "Description": | ||
2064 | description = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
2065 | break; | ||
2066 | case "DisplayName": | ||
2067 | displayName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
2068 | break; | ||
2069 | case "EnableFeatureSelection": | ||
2070 | enableFeatureSelection = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
2071 | allowed = (packageType == WixBundlePackageType.Msi); | ||
2072 | break; | ||
2073 | case "ForcePerMachine": | ||
2074 | forcePerMachine = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
2075 | allowed = (packageType == WixBundlePackageType.Msi); | ||
2076 | break; | ||
2077 | case "LogPathVariable": | ||
2078 | logPathVariable = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | ||
2079 | break; | ||
2080 | case "RollbackLogPathVariable": | ||
2081 | rollbackPathVariable = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | ||
2082 | break; | ||
2083 | case "Permanent": | ||
2084 | permanent = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
2046 | break; | 2085 | break; |
2047 | case "keep": | 2086 | case "Visible": |
2048 | cache = BundleCacheType.Keep; | 2087 | visible = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
2088 | allowed = (packageType == WixBundlePackageType.Msi); | ||
2049 | break; | 2089 | break; |
2050 | case "remove": | 2090 | case "Vital": |
2051 | cache = BundleCacheType.Remove; | 2091 | vital = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
2052 | break; | 2092 | break; |
2053 | case "": | 2093 | case "Bundle": |
2094 | bundle = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
2095 | allowed = (packageType == WixBundlePackageType.Exe); | ||
2096 | break; | ||
2097 | case "InstallArguments": | ||
2098 | installArguments = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
2099 | allowed = (packageType == WixBundlePackageType.Exe); | ||
2100 | break; | ||
2101 | case "RepairArguments": | ||
2102 | repairArguments = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | ||
2103 | allowed = (packageType == WixBundlePackageType.Exe); | ||
2104 | break; | ||
2105 | case "UninstallArguments": | ||
2106 | uninstallArguments = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | ||
2107 | allowed = (packageType == WixBundlePackageType.Exe); | ||
2108 | break; | ||
2109 | case "PerMachine": | ||
2110 | perMachine = this.Core.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib); | ||
2111 | allowed = (packageType == WixBundlePackageType.Exe || packageType == WixBundlePackageType.Msp); | ||
2112 | break; | ||
2113 | case "DetectCondition": | ||
2114 | detectCondition = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | ||
2115 | allowed = (packageType == WixBundlePackageType.Exe || packageType == WixBundlePackageType.Msu); | ||
2116 | break; | ||
2117 | case "Protocol": | ||
2118 | protocol = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
2119 | allowed = (packageType == WixBundlePackageType.Exe); | ||
2120 | break; | ||
2121 | case "InstallSize": | ||
2122 | installSize = this.Core.GetAttributeLongValue(sourceLineNumbers, attrib, 0, Int64.MaxValue); | ||
2123 | break; | ||
2124 | case "KB": | ||
2125 | msuKB = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
2126 | allowed = (packageType == WixBundlePackageType.Msu); | ||
2127 | break; | ||
2128 | case "Compressed": | ||
2129 | compilerPayload.ParseCompressed(attrib); | ||
2130 | hasPayloadInfo = true; | ||
2131 | break; | ||
2132 | case "Slipstream": | ||
2133 | slipstream = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
2134 | allowed = (packageType == WixBundlePackageType.Msp); | ||
2054 | break; | 2135 | break; |
2055 | default: | 2136 | default: |
2056 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, value, "force", "keep", "remove")); | 2137 | allowed = false; |
2057 | break; | 2138 | break; |
2058 | } | ||
2059 | break; | ||
2060 | case "CacheId": | ||
2061 | cacheId = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
2062 | break; | ||
2063 | case "Description": | ||
2064 | description = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
2065 | break; | ||
2066 | case "DisplayName": | ||
2067 | displayName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
2068 | break; | ||
2069 | case "EnableFeatureSelection": | ||
2070 | enableFeatureSelection = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
2071 | allowed = (packageType == WixBundlePackageType.Msi); | ||
2072 | break; | ||
2073 | case "ForcePerMachine": | ||
2074 | forcePerMachine = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
2075 | allowed = (packageType == WixBundlePackageType.Msi); | ||
2076 | break; | ||
2077 | case "LogPathVariable": | ||
2078 | logPathVariable = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | ||
2079 | break; | ||
2080 | case "RollbackLogPathVariable": | ||
2081 | rollbackPathVariable = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | ||
2082 | break; | ||
2083 | case "Permanent": | ||
2084 | permanent = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
2085 | break; | ||
2086 | case "Visible": | ||
2087 | visible = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
2088 | allowed = (packageType == WixBundlePackageType.Msi); | ||
2089 | break; | ||
2090 | case "Vital": | ||
2091 | vital = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
2092 | break; | ||
2093 | case "Bundle": | ||
2094 | bundle = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
2095 | allowed = (packageType == WixBundlePackageType.Exe); | ||
2096 | break; | ||
2097 | case "InstallArguments": | ||
2098 | installArguments = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
2099 | allowed = (packageType == WixBundlePackageType.Exe); | ||
2100 | break; | ||
2101 | case "RepairArguments": | ||
2102 | repairArguments = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | ||
2103 | allowed = (packageType == WixBundlePackageType.Exe); | ||
2104 | break; | ||
2105 | case "UninstallArguments": | ||
2106 | uninstallArguments = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | ||
2107 | allowed = (packageType == WixBundlePackageType.Exe); | ||
2108 | break; | ||
2109 | case "PerMachine": | ||
2110 | perMachine = this.Core.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib); | ||
2111 | allowed = (packageType == WixBundlePackageType.Exe || packageType == WixBundlePackageType.Msp); | ||
2112 | break; | ||
2113 | case "DetectCondition": | ||
2114 | detectCondition = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | ||
2115 | allowed = (packageType == WixBundlePackageType.Exe || packageType == WixBundlePackageType.Msu); | ||
2116 | break; | ||
2117 | case "Protocol": | ||
2118 | protocol = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
2119 | allowed = (packageType == WixBundlePackageType.Exe); | ||
2120 | break; | ||
2121 | case "InstallSize": | ||
2122 | installSize = this.Core.GetAttributeLongValue(sourceLineNumbers, attrib, 0, Int64.MaxValue); | ||
2123 | break; | ||
2124 | case "KB": | ||
2125 | msuKB = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
2126 | allowed = (packageType == WixBundlePackageType.Msu); | ||
2127 | break; | ||
2128 | case "Compressed": | ||
2129 | compilerPayload.ParseCompressed(attrib); | ||
2130 | hasPayloadInfo = true; | ||
2131 | break; | ||
2132 | case "Slipstream": | ||
2133 | slipstream = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
2134 | allowed = (packageType == WixBundlePackageType.Msp); | ||
2135 | break; | ||
2136 | default: | ||
2137 | allowed = false; | ||
2138 | break; | ||
2139 | } | 2139 | } |
2140 | 2140 | ||
2141 | if (!allowed) | 2141 | if (!allowed) |
@@ -2315,53 +2315,53 @@ namespace WixToolset.Core | |||
2315 | var allowed = true; | 2315 | var allowed = true; |
2316 | switch (child.Name.LocalName) | 2316 | switch (child.Name.LocalName) |
2317 | { | 2317 | { |
2318 | case "SlipstreamMsp": | 2318 | case "SlipstreamMsp": |
2319 | allowed = (packageType == WixBundlePackageType.Msi); | 2319 | allowed = (packageType == WixBundlePackageType.Msi); |
2320 | if (allowed) | 2320 | if (allowed) |
2321 | { | 2321 | { |
2322 | this.ParseSlipstreamMspElement(child, id.Id); | 2322 | this.ParseSlipstreamMspElement(child, id.Id); |
2323 | } | 2323 | } |
2324 | break; | 2324 | break; |
2325 | case "MsiProperty": | 2325 | case "MsiProperty": |
2326 | allowed = (packageType == WixBundlePackageType.Msi || packageType == WixBundlePackageType.Msp); | 2326 | allowed = (packageType == WixBundlePackageType.Msi || packageType == WixBundlePackageType.Msp); |
2327 | if (allowed) | 2327 | if (allowed) |
2328 | { | 2328 | { |
2329 | this.ParseMsiPropertyElement(child, id.Id); | 2329 | this.ParseMsiPropertyElement(child, id.Id); |
2330 | } | 2330 | } |
2331 | break; | 2331 | break; |
2332 | case "Payload": | 2332 | case "Payload": |
2333 | this.ParsePayloadElement(child, ComplexReferenceParentType.Package, id); | 2333 | this.ParsePayloadElement(child, ComplexReferenceParentType.Package, id); |
2334 | break; | 2334 | break; |
2335 | case "PayloadGroupRef": | 2335 | case "PayloadGroupRef": |
2336 | this.ParsePayloadGroupRefElement(child, ComplexReferenceParentType.Package, id); | 2336 | this.ParsePayloadGroupRefElement(child, ComplexReferenceParentType.Package, id); |
2337 | break; | 2337 | break; |
2338 | case "Provides": | 2338 | case "Provides": |
2339 | this.ParseProvidesElement(child, packageType, id.Id, out _); | 2339 | this.ParseProvidesElement(child, packageType, id.Id, out _); |
2340 | break; | 2340 | break; |
2341 | case "ExitCode": | 2341 | case "ExitCode": |
2342 | allowed = (packageType == WixBundlePackageType.Exe); | 2342 | allowed = (packageType == WixBundlePackageType.Exe); |
2343 | if (allowed) | 2343 | if (allowed) |
2344 | { | 2344 | { |
2345 | this.ParseExitCodeElement(child, id.Id); | 2345 | this.ParseExitCodeElement(child, id.Id); |
2346 | } | 2346 | } |
2347 | break; | 2347 | break; |
2348 | case "CommandLine": | 2348 | case "CommandLine": |
2349 | allowed = (packageType == WixBundlePackageType.Exe); | 2349 | allowed = (packageType == WixBundlePackageType.Exe); |
2350 | if (allowed) | 2350 | if (allowed) |
2351 | { | 2351 | { |
2352 | this.ParseCommandLineElement(child, id.Id); | 2352 | this.ParseCommandLineElement(child, id.Id); |
2353 | } | 2353 | } |
2354 | break; | 2354 | break; |
2355 | case "ExePackagePayload": | 2355 | case "ExePackagePayload": |
2356 | case "MsiPackagePayload": | 2356 | case "MsiPackagePayload": |
2357 | case "MspPackagePayload": | 2357 | case "MspPackagePayload": |
2358 | case "MsuPackagePayload": | 2358 | case "MsuPackagePayload": |
2359 | allowed = packagePayloadElementName == child.Name.LocalName; | 2359 | allowed = packagePayloadElementName == child.Name.LocalName; |
2360 | // Handled previously | 2360 | // Handled previously |
2361 | break; | 2361 | break; |
2362 | default: | 2362 | default: |
2363 | allowed = false; | 2363 | allowed = false; |
2364 | break; | 2364 | break; |
2365 | } | 2365 | } |
2366 | 2366 | ||
2367 | if (!allowed) | 2367 | if (!allowed) |
@@ -2422,49 +2422,49 @@ namespace WixToolset.Core | |||
2422 | 2422 | ||
2423 | switch (packageType) | 2423 | switch (packageType) |
2424 | { | 2424 | { |
2425 | case WixBundlePackageType.Exe: | 2425 | case WixBundlePackageType.Exe: |
2426 | WixBundleExePackageAttributes exeAttributes = 0; | 2426 | WixBundleExePackageAttributes exeAttributes = 0; |
2427 | exeAttributes |= (YesNoType.Yes == bundle) ? WixBundleExePackageAttributes.Bundle : 0; | 2427 | exeAttributes |= (YesNoType.Yes == bundle) ? WixBundleExePackageAttributes.Bundle : 0; |
2428 | 2428 | ||
2429 | this.Core.AddSymbol(new WixBundleExePackageSymbol(sourceLineNumbers, id) | 2429 | this.Core.AddSymbol(new WixBundleExePackageSymbol(sourceLineNumbers, id) |
2430 | { | 2430 | { |
2431 | Attributes = exeAttributes, | 2431 | Attributes = exeAttributes, |
2432 | DetectCondition = detectCondition, | 2432 | DetectCondition = detectCondition, |
2433 | InstallCommand = installArguments, | 2433 | InstallCommand = installArguments, |
2434 | RepairCommand = repairArguments, | 2434 | RepairCommand = repairArguments, |
2435 | UninstallCommand = uninstallArguments, | 2435 | UninstallCommand = uninstallArguments, |
2436 | ExeProtocol = protocol | 2436 | ExeProtocol = protocol |
2437 | }); | 2437 | }); |
2438 | break; | 2438 | break; |
2439 | 2439 | ||
2440 | case WixBundlePackageType.Msi: | 2440 | case WixBundlePackageType.Msi: |
2441 | WixBundleMsiPackageAttributes msiAttributes = 0; | 2441 | WixBundleMsiPackageAttributes msiAttributes = 0; |
2442 | msiAttributes |= (YesNoType.Yes == enableFeatureSelection) ? WixBundleMsiPackageAttributes.EnableFeatureSelection : 0; | 2442 | msiAttributes |= (YesNoType.Yes == enableFeatureSelection) ? WixBundleMsiPackageAttributes.EnableFeatureSelection : 0; |
2443 | msiAttributes |= (YesNoType.Yes == forcePerMachine) ? WixBundleMsiPackageAttributes.ForcePerMachine : 0; | 2443 | msiAttributes |= (YesNoType.Yes == forcePerMachine) ? WixBundleMsiPackageAttributes.ForcePerMachine : 0; |
2444 | 2444 | ||
2445 | this.Core.AddSymbol(new WixBundleMsiPackageSymbol(sourceLineNumbers, id) | 2445 | this.Core.AddSymbol(new WixBundleMsiPackageSymbol(sourceLineNumbers, id) |
2446 | { | 2446 | { |
2447 | Attributes = msiAttributes | 2447 | Attributes = msiAttributes |
2448 | }); | 2448 | }); |
2449 | break; | 2449 | break; |
2450 | 2450 | ||
2451 | case WixBundlePackageType.Msp: | 2451 | case WixBundlePackageType.Msp: |
2452 | WixBundleMspPackageAttributes mspAttributes = 0; | 2452 | WixBundleMspPackageAttributes mspAttributes = 0; |
2453 | mspAttributes |= (YesNoType.Yes == slipstream) ? WixBundleMspPackageAttributes.Slipstream : 0; | 2453 | mspAttributes |= (YesNoType.Yes == slipstream) ? WixBundleMspPackageAttributes.Slipstream : 0; |
2454 | 2454 | ||
2455 | this.Core.AddSymbol(new WixBundleMspPackageSymbol(sourceLineNumbers, id) | 2455 | this.Core.AddSymbol(new WixBundleMspPackageSymbol(sourceLineNumbers, id) |
2456 | { | 2456 | { |
2457 | Attributes = mspAttributes | 2457 | Attributes = mspAttributes |
2458 | }); | 2458 | }); |
2459 | break; | 2459 | break; |
2460 | 2460 | ||
2461 | case WixBundlePackageType.Msu: | 2461 | case WixBundlePackageType.Msu: |
2462 | this.Core.AddSymbol(new WixBundleMsuPackageSymbol(sourceLineNumbers, id) | 2462 | this.Core.AddSymbol(new WixBundleMsuPackageSymbol(sourceLineNumbers, id) |
2463 | { | 2463 | { |
2464 | DetectCondition = detectCondition, | 2464 | DetectCondition = detectCondition, |
2465 | MsuKB = msuKB | 2465 | MsuKB = msuKB |
2466 | }); | 2466 | }); |
2467 | break; | 2467 | break; |
2468 | } | 2468 | } |
2469 | 2469 | ||
2470 | this.CreateChainPackageMetaRows(sourceLineNumbers, parentType, parentId, ComplexReferenceChildType.Package, id.Id, previousType, previousId, after); | 2470 | this.CreateChainPackageMetaRows(sourceLineNumbers, parentType, parentId, ComplexReferenceChildType.Package, id.Id, previousType, previousId, after); |
@@ -2635,21 +2635,21 @@ namespace WixToolset.Core | |||
2635 | { | 2635 | { |
2636 | switch (attrib.Name.LocalName) | 2636 | switch (attrib.Name.LocalName) |
2637 | { | 2637 | { |
2638 | case "InstallArgument": | 2638 | case "InstallArgument": |
2639 | installArgument = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 2639 | installArgument = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
2640 | break; | 2640 | break; |
2641 | case "UninstallArgument": | 2641 | case "UninstallArgument": |
2642 | uninstallArgument = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 2642 | uninstallArgument = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
2643 | break; | 2643 | break; |
2644 | case "RepairArgument": | 2644 | case "RepairArgument": |
2645 | repairArgument = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 2645 | repairArgument = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
2646 | break; | 2646 | break; |
2647 | case "Condition": | 2647 | case "Condition": |
2648 | condition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 2648 | condition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
2649 | break; | 2649 | break; |
2650 | default: | 2650 | default: |
2651 | this.Core.UnexpectedAttribute(node, attrib); | 2651 | this.Core.UnexpectedAttribute(node, attrib); |
2652 | break; | 2652 | break; |
2653 | } | 2653 | } |
2654 | } | 2654 | } |
2655 | else | 2655 | else |
@@ -2693,16 +2693,16 @@ namespace WixToolset.Core | |||
2693 | { | 2693 | { |
2694 | switch (attrib.Name.LocalName) | 2694 | switch (attrib.Name.LocalName) |
2695 | { | 2695 | { |
2696 | case "Id": | 2696 | case "Id": |
2697 | id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); | 2697 | id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); |
2698 | if (id?.Id == BurnConstants.BundleChainPackageGroupId) | 2698 | if (id?.Id == BurnConstants.BundleChainPackageGroupId) |
2699 | { | 2699 | { |
2700 | this.Messaging.Write(CompilerErrors.ReservedValue(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); | 2700 | this.Messaging.Write(CompilerErrors.ReservedValue(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); |
2701 | } | 2701 | } |
2702 | break; | 2702 | break; |
2703 | default: | 2703 | default: |
2704 | this.Core.UnexpectedAttribute(node, attrib); | 2704 | this.Core.UnexpectedAttribute(node, attrib); |
2705 | break; | 2705 | break; |
2706 | } | 2706 | } |
2707 | } | 2707 | } |
2708 | else | 2708 | else |
@@ -2725,33 +2725,33 @@ namespace WixToolset.Core | |||
2725 | { | 2725 | { |
2726 | switch (child.Name.LocalName) | 2726 | switch (child.Name.LocalName) |
2727 | { | 2727 | { |
2728 | case "MsiPackage": | 2728 | case "MsiPackage": |
2729 | previousId = this.ParseMsiPackageElement(child, ComplexReferenceParentType.PackageGroup, id.Id, previousType, previousId); | 2729 | previousId = this.ParseMsiPackageElement(child, ComplexReferenceParentType.PackageGroup, id.Id, previousType, previousId); |
2730 | previousType = ComplexReferenceChildType.Package; | 2730 | previousType = ComplexReferenceChildType.Package; |
2731 | break; | 2731 | break; |
2732 | case "MspPackage": | 2732 | case "MspPackage": |
2733 | previousId = this.ParseMspPackageElement(child, ComplexReferenceParentType.PackageGroup, id.Id, previousType, previousId); | 2733 | previousId = this.ParseMspPackageElement(child, ComplexReferenceParentType.PackageGroup, id.Id, previousType, previousId); |
2734 | previousType = ComplexReferenceChildType.Package; | 2734 | previousType = ComplexReferenceChildType.Package; |
2735 | break; | 2735 | break; |
2736 | case "MsuPackage": | 2736 | case "MsuPackage": |
2737 | previousId = this.ParseMsuPackageElement(child, ComplexReferenceParentType.PackageGroup, id.Id, previousType, previousId); | 2737 | previousId = this.ParseMsuPackageElement(child, ComplexReferenceParentType.PackageGroup, id.Id, previousType, previousId); |
2738 | previousType = ComplexReferenceChildType.Package; | 2738 | previousType = ComplexReferenceChildType.Package; |
2739 | break; | 2739 | break; |
2740 | case "ExePackage": | 2740 | case "ExePackage": |
2741 | previousId = this.ParseExePackageElement(child, ComplexReferenceParentType.PackageGroup, id.Id, previousType, previousId); | 2741 | previousId = this.ParseExePackageElement(child, ComplexReferenceParentType.PackageGroup, id.Id, previousType, previousId); |
2742 | previousType = ComplexReferenceChildType.Package; | 2742 | previousType = ComplexReferenceChildType.Package; |
2743 | break; | 2743 | break; |
2744 | case "RollbackBoundary": | 2744 | case "RollbackBoundary": |
2745 | previousId = this.ParseRollbackBoundaryElement(child, ComplexReferenceParentType.PackageGroup, id.Id, previousType, previousId); | 2745 | previousId = this.ParseRollbackBoundaryElement(child, ComplexReferenceParentType.PackageGroup, id.Id, previousType, previousId); |
2746 | previousType = ComplexReferenceChildType.Package; | 2746 | previousType = ComplexReferenceChildType.Package; |
2747 | break; | 2747 | break; |
2748 | case "PackageGroupRef": | 2748 | case "PackageGroupRef": |
2749 | previousId = this.ParsePackageGroupRefElement(child, ComplexReferenceParentType.PackageGroup, id.Id, previousType, previousId); | 2749 | previousId = this.ParsePackageGroupRefElement(child, ComplexReferenceParentType.PackageGroup, id.Id, previousType, previousId); |
2750 | previousType = ComplexReferenceChildType.PackageGroup; | 2750 | previousType = ComplexReferenceChildType.PackageGroup; |
2751 | break; | 2751 | break; |
2752 | default: | 2752 | default: |
2753 | this.Core.UnexpectedElement(node, child); | 2753 | this.Core.UnexpectedElement(node, child); |
2754 | break; | 2754 | break; |
2755 | } | 2755 | } |
2756 | } | 2756 | } |
2757 | else | 2757 | else |
@@ -2803,23 +2803,23 @@ namespace WixToolset.Core | |||
2803 | { | 2803 | { |
2804 | switch (attrib.Name.LocalName) | 2804 | switch (attrib.Name.LocalName) |
2805 | { | 2805 | { |
2806 | case "Id": | 2806 | case "Id": |
2807 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 2807 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
2808 | if (id == BurnConstants.BundleChainPackageGroupId) | 2808 | if (id == BurnConstants.BundleChainPackageGroupId) |
2809 | { | 2809 | { |
2810 | this.Messaging.Write(CompilerErrors.ReservedValue(sourceLineNumbers, node.Name.LocalName, "Id", id)); | 2810 | this.Messaging.Write(CompilerErrors.ReservedValue(sourceLineNumbers, node.Name.LocalName, "Id", id)); |
2811 | } | 2811 | } |
2812 | else | 2812 | else |
2813 | { | 2813 | { |
2814 | this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixBundlePackageGroup, id); | 2814 | this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixBundlePackageGroup, id); |
2815 | } | 2815 | } |
2816 | break; | 2816 | break; |
2817 | case "After": | 2817 | case "After": |
2818 | after = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 2818 | after = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
2819 | break; | 2819 | break; |
2820 | default: | 2820 | default: |
2821 | this.Core.UnexpectedAttribute(node, attrib); | 2821 | this.Core.UnexpectedAttribute(node, attrib); |
2822 | break; | 2822 | break; |
2823 | } | 2823 | } |
2824 | } | 2824 | } |
2825 | else | 2825 | else |
@@ -2933,18 +2933,18 @@ namespace WixToolset.Core | |||
2933 | { | 2933 | { |
2934 | switch (attrib.Name.LocalName) | 2934 | switch (attrib.Name.LocalName) |
2935 | { | 2935 | { |
2936 | case "Name": | 2936 | case "Name": |
2937 | name = this.Core.GetAttributeMsiPropertyNameValue(sourceLineNumbers, attrib); | 2937 | name = this.Core.GetAttributeMsiPropertyNameValue(sourceLineNumbers, attrib); |
2938 | break; | 2938 | break; |
2939 | case "Value": | 2939 | case "Value": |
2940 | value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 2940 | value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
2941 | break; | 2941 | break; |
2942 | case "Condition": | 2942 | case "Condition": |
2943 | condition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 2943 | condition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
2944 | break; | 2944 | break; |
2945 | default: | 2945 | default: |
2946 | this.Core.UnexpectedAttribute(node, attrib); | 2946 | this.Core.UnexpectedAttribute(node, attrib); |
2947 | break; | 2947 | break; |
2948 | } | 2948 | } |
2949 | } | 2949 | } |
2950 | else | 2950 | else |
@@ -2997,13 +2997,13 @@ namespace WixToolset.Core | |||
2997 | { | 2997 | { |
2998 | switch (attrib.Name.LocalName) | 2998 | switch (attrib.Name.LocalName) |
2999 | { | 2999 | { |
3000 | case "Id": | 3000 | case "Id": |
3001 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | 3001 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); |
3002 | this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixBundlePackage, id); | 3002 | this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.WixBundlePackage, id); |
3003 | break; | 3003 | break; |
3004 | default: | 3004 | default: |
3005 | this.Core.UnexpectedAttribute(node, attrib); | 3005 | this.Core.UnexpectedAttribute(node, attrib); |
3006 | break; | 3006 | break; |
3007 | } | 3007 | } |
3008 | } | 3008 | } |
3009 | else | 3009 | else |
@@ -3045,39 +3045,39 @@ namespace WixToolset.Core | |||
3045 | { | 3045 | { |
3046 | switch (attrib.Name.LocalName) | 3046 | switch (attrib.Name.LocalName) |
3047 | { | 3047 | { |
3048 | case "Id": | 3048 | case "Id": |
3049 | id = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); | 3049 | id = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); |
3050 | break; | ||
3051 | case "Action": | ||
3052 | var action = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
3053 | switch (action) | ||
3054 | { | ||
3055 | case "Detect": | ||
3056 | case "detect": | ||
3057 | actionType = RelatedBundleActionType.Detect; | ||
3058 | break; | ||
3059 | case "Upgrade": | ||
3060 | case "upgrade": | ||
3061 | actionType = RelatedBundleActionType.Upgrade; | ||
3062 | break; | ||
3063 | case "Addon": | ||
3064 | case "addon": | ||
3065 | actionType = RelatedBundleActionType.Addon; | ||
3066 | break; | ||
3067 | case "Patch": | ||
3068 | case "patch": | ||
3069 | actionType = RelatedBundleActionType.Patch; | ||
3070 | break; | 3050 | break; |
3071 | case "": | 3051 | case "Action": |
3052 | var action = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
3053 | switch (action) | ||
3054 | { | ||
3055 | case "Detect": | ||
3056 | case "detect": | ||
3057 | actionType = RelatedBundleActionType.Detect; | ||
3058 | break; | ||
3059 | case "Upgrade": | ||
3060 | case "upgrade": | ||
3061 | actionType = RelatedBundleActionType.Upgrade; | ||
3062 | break; | ||
3063 | case "Addon": | ||
3064 | case "addon": | ||
3065 | actionType = RelatedBundleActionType.Addon; | ||
3066 | break; | ||
3067 | case "Patch": | ||
3068 | case "patch": | ||
3069 | actionType = RelatedBundleActionType.Patch; | ||
3070 | break; | ||
3071 | case "": | ||
3072 | break; | ||
3073 | default: | ||
3074 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Action", action, "Detect", "Upgrade", "Addon", "Patch")); | ||
3075 | break; | ||
3076 | } | ||
3072 | break; | 3077 | break; |
3073 | default: | 3078 | default: |
3074 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Action", action, "Detect", "Upgrade", "Addon", "Patch")); | 3079 | this.Core.UnexpectedAttribute(node, attrib); |
3075 | break; | 3080 | break; |
3076 | } | ||
3077 | break; | ||
3078 | default: | ||
3079 | this.Core.UnexpectedAttribute(node, attrib); | ||
3080 | break; | ||
3081 | } | 3081 | } |
3082 | } | 3082 | } |
3083 | else | 3083 | else |
@@ -3118,12 +3118,12 @@ namespace WixToolset.Core | |||
3118 | { | 3118 | { |
3119 | switch (attrib.Name.LocalName) | 3119 | switch (attrib.Name.LocalName) |
3120 | { | 3120 | { |
3121 | case "Location": | 3121 | case "Location": |
3122 | location = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 3122 | location = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
3123 | break; | 3123 | break; |
3124 | default: | 3124 | default: |
3125 | this.Core.UnexpectedAttribute(node, attrib); | 3125 | this.Core.UnexpectedAttribute(node, attrib); |
3126 | break; | 3126 | break; |
3127 | } | 3127 | } |
3128 | } | 3128 | } |
3129 | else | 3129 | else |
@@ -3238,30 +3238,30 @@ namespace WixToolset.Core | |||
3238 | { | 3238 | { |
3239 | switch (attrib.Name.LocalName) | 3239 | switch (attrib.Name.LocalName) |
3240 | { | 3240 | { |
3241 | case "Hidden": | 3241 | case "Hidden": |
3242 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | 3242 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) |
3243 | { | 3243 | { |
3244 | hidden = true; | 3244 | hidden = true; |
3245 | } | 3245 | } |
3246 | break; | 3246 | break; |
3247 | case "Name": | 3247 | case "Name": |
3248 | name = this.Core.GetAttributeBundleVariableValue(sourceLineNumbers, attrib); | 3248 | name = this.Core.GetAttributeBundleVariableValue(sourceLineNumbers, attrib); |
3249 | break; | 3249 | break; |
3250 | case "Persisted": | 3250 | case "Persisted": |
3251 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | 3251 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) |
3252 | { | 3252 | { |
3253 | persisted = true; | 3253 | persisted = true; |
3254 | } | 3254 | } |
3255 | break; | 3255 | break; |
3256 | case "Value": | 3256 | case "Value": |
3257 | value = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | 3257 | value = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); |
3258 | break; | 3258 | break; |
3259 | case "Type": | 3259 | case "Type": |
3260 | typeValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | 3260 | typeValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); |
3261 | break; | 3261 | break; |
3262 | default: | 3262 | default: |
3263 | this.Core.UnexpectedAttribute(node, attrib); | 3263 | this.Core.UnexpectedAttribute(node, attrib); |
3264 | break; | 3264 | break; |
3265 | } | 3265 | } |
3266 | } | 3266 | } |
3267 | else | 3267 | else |
diff --git a/src/wix/WixToolset.Core/Link/FlattenAndProcessBundleTablesCommand.cs b/src/wix/WixToolset.Core/Link/FlattenAndProcessBundleTablesCommand.cs index 16593c7d..6c1c0cf3 100644 --- a/src/wix/WixToolset.Core/Link/FlattenAndProcessBundleTablesCommand.cs +++ b/src/wix/WixToolset.Core/Link/FlattenAndProcessBundleTablesCommand.cs | |||
@@ -188,7 +188,6 @@ namespace WixToolset.Core.Link | |||
188 | } | 188 | } |
189 | } | 189 | } |
190 | } | 190 | } |
191 | |||
192 | } | 191 | } |
193 | } | 192 | } |
194 | } | 193 | } |