diff options
author | Bevan Weiss <bevan.weiss@gmail.com> | 2025-01-18 23:01:30 +1100 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2025-03-03 06:35:56 -0800 |
commit | 61d789db5de8613c51df1e7db94f459aadbd3ca8 (patch) | |
tree | be35d8cddab1d70df621949afd5ef84456602a37 /src/ext/Msmq/wixext | |
parent | 3b9efe831c6a408cd71a7bea6fa95f65c141911b (diff) | |
download | wix-61d789db5de8613c51df1e7db94f459aadbd3ca8.tar.gz wix-61d789db5de8613c51df1e7db94f459aadbd3ca8.tar.bz2 wix-61d789db5de8613c51df1e7db94f459aadbd3ca8.zip |
Add a basic unit test for the round msmq decompiler round trip.
Needed fix up for Group decompiler to work correctly, adding to Index,
and fixing where the Group name column is located.
Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
Diffstat (limited to 'src/ext/Msmq/wixext')
-rw-r--r-- | src/ext/Msmq/wixext/MsmqDecompiler.cs | 38 | ||||
-rw-r--r-- | src/ext/Msmq/wixext/MsmqExtensionFactory.cs | 1 | ||||
-rw-r--r-- | src/ext/Msmq/wixext/MsmqTableDefinitions.cs | 4 |
3 files changed, 22 insertions, 21 deletions
diff --git a/src/ext/Msmq/wixext/MsmqDecompiler.cs b/src/ext/Msmq/wixext/MsmqDecompiler.cs index 53734e88..44bd8aba 100644 --- a/src/ext/Msmq/wixext/MsmqDecompiler.cs +++ b/src/ext/Msmq/wixext/MsmqDecompiler.cs | |||
@@ -144,17 +144,17 @@ namespace WixToolset.Msmq | |||
144 | 144 | ||
145 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Authenticate)) | 145 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Authenticate)) |
146 | { | 146 | { |
147 | messageQueue.Add(new XAttribute("Authenticate", YesNoType.Yes)); | 147 | messageQueue.Add(new XAttribute("Authenticate", "yes")); |
148 | } | 148 | } |
149 | 149 | ||
150 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Journal)) | 150 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Journal)) |
151 | { | 151 | { |
152 | messageQueue.Add(new XAttribute("Journal", YesNoType.Yes)); | 152 | messageQueue.Add(new XAttribute("Journal", "yes")); |
153 | } | 153 | } |
154 | 154 | ||
155 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Transactional)) | 155 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Transactional)) |
156 | { | 156 | { |
157 | messageQueue.Add(new XAttribute("Transactional", YesNoType.Yes)); | 157 | messageQueue.Add(new XAttribute("Transactional", "yes")); |
158 | } | 158 | } |
159 | 159 | ||
160 | this.DecompilerHelper.IndexElement(row, messageQueue); | 160 | this.DecompilerHelper.IndexElement(row, messageQueue); |
@@ -337,82 +337,82 @@ namespace WixToolset.Msmq | |||
337 | 337 | ||
338 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.DeleteMessage)) | 338 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.DeleteMessage)) |
339 | { | 339 | { |
340 | element.Add("DeleteMessage", YesNoType.Yes); | 340 | element.Add(new XAttribute("DeleteMessage", "yes")); |
341 | } | 341 | } |
342 | 342 | ||
343 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.PeekMessage)) | 343 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.PeekMessage)) |
344 | { | 344 | { |
345 | element.Add("PeekMessage", YesNoType.Yes); | 345 | element.Add(new XAttribute("PeekMessage", "yes")); |
346 | } | 346 | } |
347 | 347 | ||
348 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.WriteMessage)) | 348 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.WriteMessage)) |
349 | { | 349 | { |
350 | element.Add("WriteMessage", YesNoType.Yes); | 350 | element.Add(new XAttribute("WriteMessage", "yes")); |
351 | } | 351 | } |
352 | 352 | ||
353 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.DeleteJournalMessage)) | 353 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.DeleteJournalMessage)) |
354 | { | 354 | { |
355 | element.Add("DeleteJournalMessage", YesNoType.Yes); | 355 | element.Add(new XAttribute("DeleteJournalMessage", "yes")); |
356 | } | 356 | } |
357 | 357 | ||
358 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.SetQueueProperties)) | 358 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.SetQueueProperties)) |
359 | { | 359 | { |
360 | element.Add("SetQueueProperties", YesNoType.Yes); | 360 | element.Add(new XAttribute("SetQueueProperties", "yes")); |
361 | } | 361 | } |
362 | 362 | ||
363 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.GetQueueProperties)) | 363 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.GetQueueProperties)) |
364 | { | 364 | { |
365 | element.Add("GetQueueProperties", YesNoType.Yes); | 365 | element.Add(new XAttribute("GetQueueProperties", "yes")); |
366 | } | 366 | } |
367 | 367 | ||
368 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.DeleteQueue)) | 368 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.DeleteQueue)) |
369 | { | 369 | { |
370 | element.Add("DeleteQueue", YesNoType.Yes); | 370 | element.Add(new XAttribute("DeleteQueue", "yes")); |
371 | } | 371 | } |
372 | 372 | ||
373 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.GetQueuePermissions)) | 373 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.GetQueuePermissions)) |
374 | { | 374 | { |
375 | element.Add("GetQueuePermissions", YesNoType.Yes); | 375 | element.Add(new XAttribute("GetQueuePermissions", "yes")); |
376 | } | 376 | } |
377 | 377 | ||
378 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.ChangeQueuePermissions)) | 378 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.ChangeQueuePermissions)) |
379 | { | 379 | { |
380 | element.Add("ChangeQueuePermissions", YesNoType.Yes); | 380 | element.Add(new XAttribute("ChangeQueuePermissions", "yes")); |
381 | } | 381 | } |
382 | 382 | ||
383 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.TakeQueueOwnership)) | 383 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.TakeQueueOwnership)) |
384 | { | 384 | { |
385 | element.Add("TakeQueueOwnership", YesNoType.Yes); | 385 | element.Add(new XAttribute("TakeQueueOwnership", "yes")); |
386 | } | 386 | } |
387 | 387 | ||
388 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.ReceiveMessage)) | 388 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.ReceiveMessage)) |
389 | { | 389 | { |
390 | element.Add("ReceiveMessage", YesNoType.Yes); | 390 | element.Add(new XAttribute("ReceiveMessage", "yes")); |
391 | } | 391 | } |
392 | 392 | ||
393 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.ReceiveJournalMessage)) | 393 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.ReceiveJournalMessage)) |
394 | { | 394 | { |
395 | element.Add("ReceiveJournalMessage", YesNoType.Yes); | 395 | element.Add(new XAttribute("ReceiveJournalMessage", "yes")); |
396 | } | 396 | } |
397 | 397 | ||
398 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.QueueGenericRead)) | 398 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.QueueGenericRead)) |
399 | { | 399 | { |
400 | element.Add("QueueGenericRead", YesNoType.Yes); | 400 | element.Add(new XAttribute("QueueGenericRead", "yes")); |
401 | } | 401 | } |
402 | 402 | ||
403 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.QueueGenericWrite)) | 403 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.QueueGenericWrite)) |
404 | { | 404 | { |
405 | element.Add("QueueGenericWrite", YesNoType.Yes); | 405 | element.Add(new XAttribute("QueueGenericWrite", "yes")); |
406 | } | 406 | } |
407 | 407 | ||
408 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.QueueGenericExecute)) | 408 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.QueueGenericExecute)) |
409 | { | 409 | { |
410 | element.Add("QueueGenericExecute", YesNoType.Yes); | 410 | element.Add(new XAttribute("QueueGenericExecute", "yes")); |
411 | } | 411 | } |
412 | 412 | ||
413 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.QueueGenericAll)) | 413 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.QueueGenericAll)) |
414 | { | 414 | { |
415 | element.Add("QueueGenericAll", YesNoType.Yes); | 415 | element.Add(new XAttribute("QueueGenericAll", "yes")); |
416 | } | 416 | } |
417 | } | 417 | } |
418 | } | 418 | } |
diff --git a/src/ext/Msmq/wixext/MsmqExtensionFactory.cs b/src/ext/Msmq/wixext/MsmqExtensionFactory.cs index de9f786d..6bb3fb64 100644 --- a/src/ext/Msmq/wixext/MsmqExtensionFactory.cs +++ b/src/ext/Msmq/wixext/MsmqExtensionFactory.cs | |||
@@ -11,6 +11,7 @@ namespace WixToolset.Msmq | |||
11 | protected override IReadOnlyCollection<Type> ExtensionTypes => new[] | 11 | protected override IReadOnlyCollection<Type> ExtensionTypes => new[] |
12 | { | 12 | { |
13 | typeof(MsmqCompiler), | 13 | typeof(MsmqCompiler), |
14 | typeof(MsmqDecompiler), | ||
14 | typeof(MsmqExtensionData), | 15 | typeof(MsmqExtensionData), |
15 | typeof(MsmqWindowsInstallerBackendBinderExtension), | 16 | typeof(MsmqWindowsInstallerBackendBinderExtension), |
16 | }; | 17 | }; |
diff --git a/src/ext/Msmq/wixext/MsmqTableDefinitions.cs b/src/ext/Msmq/wixext/MsmqTableDefinitions.cs index 610e9409..0046c7ec 100644 --- a/src/ext/Msmq/wixext/MsmqTableDefinitions.cs +++ b/src/ext/Msmq/wixext/MsmqTableDefinitions.cs | |||
@@ -34,7 +34,7 @@ namespace WixToolset.Msmq | |||
34 | new ColumnDefinition("MessageQueueUserPermission", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, modularizeType: ColumnModularizeType.Column), | 34 | new ColumnDefinition("MessageQueueUserPermission", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, modularizeType: ColumnModularizeType.Column), |
35 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, modularizeType: ColumnModularizeType.Column), | 35 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, modularizeType: ColumnModularizeType.Column), |
36 | new ColumnDefinition("MessageQueue_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Wix4MessageQueue", keyColumn: 1, modularizeType: ColumnModularizeType.Column), | 36 | new ColumnDefinition("MessageQueue_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Wix4MessageQueue", keyColumn: 1, modularizeType: ColumnModularizeType.Column), |
37 | new ColumnDefinition("User_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, modularizeType: ColumnModularizeType.Column), | 37 | new ColumnDefinition("User_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Wix4User", keyColumn: 1, modularizeType: ColumnModularizeType.Column), |
38 | new ColumnDefinition("Permissions", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown), | 38 | new ColumnDefinition("Permissions", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown), |
39 | }, | 39 | }, |
40 | symbolIdIsPrimaryKey: true | 40 | symbolIdIsPrimaryKey: true |
@@ -48,7 +48,7 @@ namespace WixToolset.Msmq | |||
48 | new ColumnDefinition("MessageQueueGroupPermission", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, modularizeType: ColumnModularizeType.Column), | 48 | new ColumnDefinition("MessageQueueGroupPermission", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, modularizeType: ColumnModularizeType.Column), |
49 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, modularizeType: ColumnModularizeType.Column), | 49 | new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, modularizeType: ColumnModularizeType.Column), |
50 | new ColumnDefinition("MessageQueue_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Wix4MessageQueue", keyColumn: 1, modularizeType: ColumnModularizeType.Column), | 50 | new ColumnDefinition("MessageQueue_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Wix4MessageQueue", keyColumn: 1, modularizeType: ColumnModularizeType.Column), |
51 | new ColumnDefinition("Group_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, modularizeType: ColumnModularizeType.Column), | 51 | new ColumnDefinition("Group_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Wix4Group", keyColumn: 1, modularizeType: ColumnModularizeType.Column), |
52 | new ColumnDefinition("Permissions", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown), | 52 | new ColumnDefinition("Permissions", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown), |
53 | }, | 53 | }, |
54 | symbolIdIsPrimaryKey: true | 54 | symbolIdIsPrimaryKey: true |