aboutsummaryrefslogtreecommitdiff
path: root/src/wixext
diff options
context:
space:
mode:
Diffstat (limited to 'src/wixext')
-rw-r--r--src/wixext/MsmqCompiler.cs188
-rw-r--r--src/wixext/MsmqDecompiler.cs4
-rw-r--r--src/wixext/MsmqErrors.cs71
-rw-r--r--src/wixext/MsmqExtensionData.cs50
-rw-r--r--src/wixext/MsmqExtensionFactory.cs18
-rw-r--r--src/wixext/MsmqWarnings.cs30
-rw-r--r--src/wixext/MsmqWindowsInstallerBackendExtension.cs31
-rw-r--r--src/wixext/Tuples/MessageQueueGroupPermissionTuple.cs79
-rw-r--r--src/wixext/Tuples/MessageQueueTuple.cs127
-rw-r--r--src/wixext/Tuples/MessageQueueUserPermissionTuple.cs79
-rw-r--r--src/wixext/Tuples/MsmqTupleDefinitions.cs47
-rw-r--r--src/wixext/WixMsmqExtension.csproj49
-rw-r--r--src/wixext/WixToolset.Msmq.wixext.csproj32
-rw-r--r--src/wixext/WixToolset.Msmq.wixext.targets11
-rw-r--r--src/wixext/messages.xml77
15 files changed, 623 insertions, 270 deletions
diff --git a/src/wixext/MsmqCompiler.cs b/src/wixext/MsmqCompiler.cs
index b40e2dc1..5365f0fb 100644
--- a/src/wixext/MsmqCompiler.cs
+++ b/src/wixext/MsmqCompiler.cs
@@ -1,30 +1,19 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. 1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 2
3namespace WixToolset.Extensions 3namespace WixToolset.Msmq
4{ 4{
5 using System; 5 using System;
6 using System.Collections;
7 using System.Collections.Generic; 6 using System.Collections.Generic;
8 using System.Globalization;
9 using System.Reflection;
10 using System.Xml;
11 using System.Xml.Linq; 7 using System.Xml.Linq;
12 using System.Xml.Schema;
13 using WixToolset.Data; 8 using WixToolset.Data;
14 using WixToolset.Extensibility; 9 using WixToolset.Extensibility;
15 10
16 /// <summary> 11 /// <summary>
17 /// The compiler for the WiX Toolset Internet Information Services Extension. 12 /// The compiler for the WiX Toolset MSMQ Extension.
18 /// </summary> 13 /// </summary>
19 public sealed class MsmqCompiler : CompilerExtension 14 public sealed class MsmqCompiler : BaseCompilerExtension
20 { 15 {
21 /// <summary> 16 public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/msmq";
22 /// Instantiate a new MsmqCompiler.
23 /// </summary>
24 public MsmqCompiler()
25 {
26 this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/msmq";
27 }
28 17
29 /// <summary> 18 /// <summary>
30 /// </summary> 19 /// </summary>
@@ -75,7 +64,7 @@ namespace WixToolset.Extensions
75 /// <param name="parentElement">Parent element of element to process.</param> 64 /// <param name="parentElement">Parent element of element to process.</param>
76 /// <param name="element">Element to process.</param> 65 /// <param name="element">Element to process.</param>
77 /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> 66 /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param>
78 public override void ParseElement(XElement parentElement, XElement element, IDictionary<string, string> context) 67 public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context)
79 { 68 {
80 switch (parentElement.Name.LocalName) 69 switch (parentElement.Name.LocalName)
81 { 70 {
@@ -86,18 +75,18 @@ namespace WixToolset.Extensions
86 switch (element.Name.LocalName) 75 switch (element.Name.LocalName)
87 { 76 {
88 case "MessageQueue": 77 case "MessageQueue":
89 this.ParseMessageQueueElement(element, componentId); 78 this.ParseMessageQueueElement(intermediate, section, element, componentId);
90 break; 79 break;
91 case "MessageQueuePermission": 80 case "MessageQueuePermission":
92 this.ParseMessageQueuePermissionElement(element, componentId, null); 81 this.ParseMessageQueuePermissionElement(intermediate, section, element, componentId, null);
93 break; 82 break;
94 default: 83 default:
95 this.Core.UnexpectedElement(parentElement, element); 84 this.ParseHelper.UnexpectedElement(parentElement, element);
96 break; 85 break;
97 } 86 }
98 break; 87 break;
99 default: 88 default:
100 this.Core.UnexpectedElement(parentElement, element); 89 this.ParseHelper.UnexpectedElement(parentElement, element);
101 break; 90 break;
102 } 91 }
103 } 92 }
@@ -107,11 +96,11 @@ namespace WixToolset.Extensions
107 /// </summary> 96 /// </summary>
108 /// <param name="node">Element to parse.</param> 97 /// <param name="node">Element to parse.</param>
109 /// <param name="componentKey">Identifier of parent component.</param> 98 /// <param name="componentKey">Identifier of parent component.</param>
110 private void ParseMessageQueueElement(XElement node, string componentId) 99 private void ParseMessageQueueElement(Intermediate intermediate, IntermediateSection section, XElement node, string componentId)
111 { 100 {
112 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); 101 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
113 102
114 string id = null; 103 Identifier id = null;
115 int basePriority = CompilerConstants.IntegerNotSet; 104 int basePriority = CompilerConstants.IntegerNotSet;
116 int journalQuota = CompilerConstants.IntegerNotSet; 105 int journalQuota = CompilerConstants.IntegerNotSet;
117 string label = null; 106 string label = null;
@@ -129,10 +118,10 @@ namespace WixToolset.Extensions
129 switch (attrib.Name.LocalName) 118 switch (attrib.Name.LocalName)
130 { 119 {
131 case "Id": 120 case "Id":
132 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 121 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
133 break; 122 break;
134 case "Authenticate": 123 case "Authenticate":
135 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 124 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
136 { 125 {
137 attributes |= (int)MqiMessageQueueAttributes.Authenticate; 126 attributes |= (int)MqiMessageQueueAttributes.Authenticate;
138 } 127 }
@@ -142,10 +131,10 @@ namespace WixToolset.Extensions
142 } 131 }
143 break; 132 break;
144 case "BasePriority": 133 case "BasePriority":
145 basePriority = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue); 134 basePriority = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue);
146 break; 135 break;
147 case "Journal": 136 case "Journal":
148 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 137 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
149 { 138 {
150 attributes |= (int)MqiMessageQueueAttributes.Journal; 139 attributes |= (int)MqiMessageQueueAttributes.Journal;
151 } 140 }
@@ -155,19 +144,19 @@ namespace WixToolset.Extensions
155 } 144 }
156 break; 145 break;
157 case "JournalQuota": 146 case "JournalQuota":
158 journalQuota = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); 147 journalQuota = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue);
159 break; 148 break;
160 case "Label": 149 case "Label":
161 label = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 150 label = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
162 break; 151 break;
163 case "MulticastAddress": 152 case "MulticastAddress":
164 multicastAddress = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 153 multicastAddress = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
165 break; 154 break;
166 case "PathName": 155 case "PathName":
167 pathName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 156 pathName = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
168 break; 157 break;
169 case "PrivLevel": 158 case "PrivLevel":
170 string privLevelAttr = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 159 string privLevelAttr = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
171 switch (privLevelAttr) 160 switch (privLevelAttr)
172 { 161 {
173 case "none": 162 case "none":
@@ -180,15 +169,15 @@ namespace WixToolset.Extensions
180 privLevel = (int)MqiMessageQueuePrivacyLevel.Body; 169 privLevel = (int)MqiMessageQueuePrivacyLevel.Body;
181 break; 170 break;
182 default: 171 default:
183 this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, "MessageQueue", "PrivLevel", privLevelAttr, "none", "body", "optional")); 172 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, "MessageQueue", "PrivLevel", privLevelAttr, "none", "body", "optional"));
184 break; 173 break;
185 } 174 }
186 break; 175 break;
187 case "Quota": 176 case "Quota":
188 quota = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); 177 quota = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue);
189 break; 178 break;
190 case "Transactional": 179 case "Transactional":
191 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 180 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
192 { 181 {
193 attributes |= (int)MqiMessageQueueAttributes.Transactional; 182 attributes |= (int)MqiMessageQueueAttributes.Transactional;
194 } 183 }
@@ -198,16 +187,16 @@ namespace WixToolset.Extensions
198 } 187 }
199 break; 188 break;
200 case "ServiceTypeGuid": 189 case "ServiceTypeGuid":
201 serviceTypeGuid = TryFormatGuidValue(this.Core.GetAttributeValue(sourceLineNumbers, attrib)); 190 serviceTypeGuid = this.TryFormatGuidValue(this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib));
202 break; 191 break;
203 default: 192 default:
204 this.Core.UnexpectedAttribute(node, attrib); 193 this.ParseHelper.UnexpectedAttribute(node, attrib);
205 break; 194 break;
206 } 195 }
207 } 196 }
208 else 197 else
209 { 198 {
210 this.Core.ParseExtensionAttribute(node, attrib); 199 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
211 } 200 }
212 } 201 }
213 202
@@ -218,46 +207,45 @@ namespace WixToolset.Extensions
218 switch (child.Name.LocalName) 207 switch (child.Name.LocalName)
219 { 208 {
220 case "MessageQueuePermission": 209 case "MessageQueuePermission":
221 this.ParseMessageQueuePermissionElement(child, componentId, id); 210 this.ParseMessageQueuePermissionElement(intermediate, section, child, componentId, id?.Id);
222 break; 211 break;
223 default: 212 default:
224 this.Core.UnexpectedElement(node, child); 213 this.ParseHelper.UnexpectedElement(node, child);
225 break; 214 break;
226 } 215 }
227 } 216 }
228 else 217 else
229 { 218 {
230 this.Core.ParseExtensionElement(node, child); 219 this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, node, child);
231 } 220 }
232 } 221 }
233 222
234 Row row = this.Core.CreateRow(sourceLineNumbers, "MessageQueue"); 223 var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "MessageQueue", id);
235 row[0] = id; 224 row.Set(1, componentId);
236 row[1] = componentId;
237 if (CompilerConstants.IntegerNotSet != basePriority) 225 if (CompilerConstants.IntegerNotSet != basePriority)
238 { 226 {
239 row[2] = basePriority; 227 row.Set(2, basePriority);
240 } 228 }
241 if (CompilerConstants.IntegerNotSet != journalQuota) 229 if (CompilerConstants.IntegerNotSet != journalQuota)
242 { 230 {
243 row[3] = journalQuota; 231 row.Set(3, journalQuota);
244 } 232 }
245 row[4] = label; 233 row.Set(4, label);
246 row[5] = multicastAddress; 234 row.Set(5, multicastAddress);
247 row[6] = pathName; 235 row.Set(6, pathName);
248 if (CompilerConstants.IntegerNotSet != privLevel) 236 if (CompilerConstants.IntegerNotSet != privLevel)
249 { 237 {
250 row[7] = privLevel; 238 row.Set(7, privLevel);
251 } 239 }
252 if (CompilerConstants.IntegerNotSet != quota) 240 if (CompilerConstants.IntegerNotSet != quota)
253 { 241 {
254 row[8] = quota; 242 row.Set(8, quota);
255 } 243 }
256 row[9] = serviceTypeGuid; 244 row.Set(9, serviceTypeGuid);
257 row[10] = attributes; 245 row.Set(10, attributes);
258 246
259 this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "MessageQueuingInstall"); 247 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "MessageQueuingInstall");
260 this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "MessageQueuingUninstall"); 248 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "MessageQueuingUninstall");
261 } 249 }
262 250
263 /// <summary> 251 /// <summary>
@@ -266,11 +254,11 @@ namespace WixToolset.Extensions
266 /// <param name="node">Element to parse.</param> 254 /// <param name="node">Element to parse.</param>
267 /// <param name="componentKey">Identifier of parent component.</param> 255 /// <param name="componentKey">Identifier of parent component.</param>
268 /// <param name="applicationKey">Optional identifier of parent message queue.</param> 256 /// <param name="applicationKey">Optional identifier of parent message queue.</param>
269 private void ParseMessageQueuePermissionElement(XElement node, string componentId, string messageQueueId) 257 private void ParseMessageQueuePermissionElement(Intermediate intermediate, IntermediateSection section, XElement node, string componentId, string messageQueueId)
270 { 258 {
271 SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); 259 SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(node);
272 260
273 string id = null; 261 Identifier id = null;
274 string user = null; 262 string user = null;
275 string group = null; 263 string group = null;
276 int permissions = 0; 264 int permissions = 0;
@@ -282,34 +270,34 @@ namespace WixToolset.Extensions
282 switch (attrib.Name.LocalName) 270 switch (attrib.Name.LocalName)
283 { 271 {
284 case "Id": 272 case "Id":
285 id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 273 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
286 break; 274 break;
287 case "MessageQueue": 275 case "MessageQueue":
288 if (null != messageQueueId) 276 if (null != messageQueueId)
289 { 277 {
290 this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); 278 this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName));
291 } 279 }
292 messageQueueId = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 280 messageQueueId = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
293 this.Core.CreateSimpleReference(sourceLineNumbers, "MessageQueue", messageQueueId); 281 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "MessageQueue", messageQueueId);
294 break; 282 break;
295 case "User": 283 case "User":
296 if (null != group) 284 if (null != group)
297 { 285 {
298 this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "User", "Group")); 286 this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "User", "Group"));
299 } 287 }
300 user = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 288 user = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
301 this.Core.CreateSimpleReference(sourceLineNumbers, "User", user); 289 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "User", user);
302 break; 290 break;
303 case "Group": 291 case "Group":
304 if (null != user) 292 if (null != user)
305 { 293 {
306 this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Group", "User")); 294 this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Group", "User"));
307 } 295 }
308 group = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 296 group = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
309 this.Core.CreateSimpleReference(sourceLineNumbers, "Group", group); 297 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Group", group);
310 break; 298 break;
311 case "DeleteMessage": 299 case "DeleteMessage":
312 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 300 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
313 { 301 {
314 permissions |= (int)MqiMessageQueuePermission.DeleteMessage; 302 permissions |= (int)MqiMessageQueuePermission.DeleteMessage;
315 } 303 }
@@ -319,7 +307,7 @@ namespace WixToolset.Extensions
319 } 307 }
320 break; 308 break;
321 case "PeekMessage": 309 case "PeekMessage":
322 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 310 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
323 { 311 {
324 permissions |= (int)MqiMessageQueuePermission.PeekMessage; 312 permissions |= (int)MqiMessageQueuePermission.PeekMessage;
325 } 313 }
@@ -329,7 +317,7 @@ namespace WixToolset.Extensions
329 } 317 }
330 break; 318 break;
331 case "WriteMessage": 319 case "WriteMessage":
332 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 320 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
333 { 321 {
334 permissions |= (int)MqiMessageQueuePermission.WriteMessage; 322 permissions |= (int)MqiMessageQueuePermission.WriteMessage;
335 } 323 }
@@ -339,7 +327,7 @@ namespace WixToolset.Extensions
339 } 327 }
340 break; 328 break;
341 case "DeleteJournalMessage": 329 case "DeleteJournalMessage":
342 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 330 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
343 { 331 {
344 permissions |= (int)MqiMessageQueuePermission.DeleteJournalMessage; 332 permissions |= (int)MqiMessageQueuePermission.DeleteJournalMessage;
345 } 333 }
@@ -349,7 +337,7 @@ namespace WixToolset.Extensions
349 } 337 }
350 break; 338 break;
351 case "SetQueueProperties": 339 case "SetQueueProperties":
352 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 340 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
353 { 341 {
354 permissions |= (int)MqiMessageQueuePermission.SetQueueProperties; 342 permissions |= (int)MqiMessageQueuePermission.SetQueueProperties;
355 } 343 }
@@ -359,7 +347,7 @@ namespace WixToolset.Extensions
359 } 347 }
360 break; 348 break;
361 case "GetQueueProperties": 349 case "GetQueueProperties":
362 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 350 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
363 { 351 {
364 permissions |= (int)MqiMessageQueuePermission.GetQueueProperties; 352 permissions |= (int)MqiMessageQueuePermission.GetQueueProperties;
365 } 353 }
@@ -369,7 +357,7 @@ namespace WixToolset.Extensions
369 } 357 }
370 break; 358 break;
371 case "DeleteQueue": 359 case "DeleteQueue":
372 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 360 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
373 { 361 {
374 permissions |= (int)MqiMessageQueuePermission.DeleteQueue; 362 permissions |= (int)MqiMessageQueuePermission.DeleteQueue;
375 } 363 }
@@ -379,7 +367,7 @@ namespace WixToolset.Extensions
379 } 367 }
380 break; 368 break;
381 case "GetQueuePermissions": 369 case "GetQueuePermissions":
382 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 370 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
383 { 371 {
384 permissions |= (int)MqiMessageQueuePermission.GetQueuePermissions; 372 permissions |= (int)MqiMessageQueuePermission.GetQueuePermissions;
385 } 373 }
@@ -389,7 +377,7 @@ namespace WixToolset.Extensions
389 } 377 }
390 break; 378 break;
391 case "ChangeQueuePermissions": 379 case "ChangeQueuePermissions":
392 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 380 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
393 { 381 {
394 permissions |= (int)MqiMessageQueuePermission.ChangeQueuePermissions; 382 permissions |= (int)MqiMessageQueuePermission.ChangeQueuePermissions;
395 } 383 }
@@ -399,7 +387,7 @@ namespace WixToolset.Extensions
399 } 387 }
400 break; 388 break;
401 case "TakeQueueOwnership": 389 case "TakeQueueOwnership":
402 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 390 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
403 { 391 {
404 permissions |= (int)MqiMessageQueuePermission.TakeQueueOwnership; 392 permissions |= (int)MqiMessageQueuePermission.TakeQueueOwnership;
405 } 393 }
@@ -409,7 +397,7 @@ namespace WixToolset.Extensions
409 } 397 }
410 break; 398 break;
411 case "ReceiveMessage": 399 case "ReceiveMessage":
412 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 400 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
413 { 401 {
414 permissions |= (int)MqiMessageQueuePermission.ReceiveMessage; 402 permissions |= (int)MqiMessageQueuePermission.ReceiveMessage;
415 } 403 }
@@ -419,7 +407,7 @@ namespace WixToolset.Extensions
419 } 407 }
420 break; 408 break;
421 case "ReceiveJournalMessage": 409 case "ReceiveJournalMessage":
422 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 410 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
423 { 411 {
424 permissions |= (int)MqiMessageQueuePermission.ReceiveJournalMessage; 412 permissions |= (int)MqiMessageQueuePermission.ReceiveJournalMessage;
425 } 413 }
@@ -429,7 +417,7 @@ namespace WixToolset.Extensions
429 } 417 }
430 break; 418 break;
431 case "QueueGenericRead": 419 case "QueueGenericRead":
432 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 420 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
433 { 421 {
434 permissions |= (int)MqiMessageQueuePermission.QueueGenericRead; 422 permissions |= (int)MqiMessageQueuePermission.QueueGenericRead;
435 } 423 }
@@ -439,7 +427,7 @@ namespace WixToolset.Extensions
439 } 427 }
440 break; 428 break;
441 case "QueueGenericWrite": 429 case "QueueGenericWrite":
442 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 430 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
443 { 431 {
444 permissions |= (int)MqiMessageQueuePermission.QueueGenericWrite; 432 permissions |= (int)MqiMessageQueuePermission.QueueGenericWrite;
445 } 433 }
@@ -449,7 +437,7 @@ namespace WixToolset.Extensions
449 } 437 }
450 break; 438 break;
451 case "QueueGenericExecute": 439 case "QueueGenericExecute":
452 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 440 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
453 { 441 {
454 permissions |= (int)MqiMessageQueuePermission.QueueGenericExecute; 442 permissions |= (int)MqiMessageQueuePermission.QueueGenericExecute;
455 } 443 }
@@ -459,7 +447,7 @@ namespace WixToolset.Extensions
459 } 447 }
460 break; 448 break;
461 case "QueueGenericAll": 449 case "QueueGenericAll":
462 if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) 450 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
463 { 451 {
464 permissions |= (int)MqiMessageQueuePermission.QueueGenericAll; 452 permissions |= (int)MqiMessageQueuePermission.QueueGenericAll;
465 } 453 }
@@ -469,44 +457,42 @@ namespace WixToolset.Extensions
469 } 457 }
470 break; 458 break;
471 default: 459 default:
472 this.Core.UnexpectedAttribute(node, attrib); 460 this.ParseHelper.UnexpectedAttribute(node, attrib);
473 break; 461 break;
474 } 462 }
475 } 463 }
476 else 464 else
477 { 465 {
478 this.Core.ParseExtensionAttribute(node, attrib); 466 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, node, attrib);
479 } 467 }
480 } 468 }
481 469
482 if (null == messageQueueId) 470 if (null == messageQueueId)
483 { 471 {
484 this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "MessageQueue")); 472 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "MessageQueue"));
485 } 473 }
486 if (null == user && null == group) 474 if (null == user && null == group)
487 { 475 {
488 this.Core.OnMessage(WixErrors.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "User", "Group")); 476 this.Messaging.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "User", "Group"));
489 } 477 }
490 478
491 this.Core.ParseForExtensionElements(node); 479 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, node);
492 480
493 if (null != user) 481 if (null != user)
494 { 482 {
495 Row row = this.Core.CreateRow(sourceLineNumbers, "MessageQueueUserPermission"); 483 var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "MessageQueueUserPermission", id);
496 row[0] = id; 484 row.Set(1, componentId);
497 row[1] = componentId; 485 row.Set(2, messageQueueId);
498 row[2] = messageQueueId; 486 row.Set(3, user);
499 row[3] = user; 487 row.Set(4, permissions);
500 row[4] = permissions;
501 } 488 }
502 if (null != group) 489 if (null != group)
503 { 490 {
504 Row row = this.Core.CreateRow(sourceLineNumbers, "MessageQueueGroupPermission"); 491 var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "MessageQueueGroupPermission", id);
505 row[0] = id; 492 row.Set(1, componentId);
506 row[1] = componentId; 493 row.Set(2, messageQueueId);
507 row[2] = messageQueueId; 494 row.Set(3, group);
508 row[3] = group; 495 row.Set(4, permissions);
509 row[4] = permissions;
510 } 496 }
511 } 497 }
512 498
diff --git a/src/wixext/MsmqDecompiler.cs b/src/wixext/MsmqDecompiler.cs
index 396fc49a..aa8c34b6 100644
--- a/src/wixext/MsmqDecompiler.cs
+++ b/src/wixext/MsmqDecompiler.cs
@@ -1,7 +1,8 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. 1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 2
3namespace WixToolset.Extensions 3namespace WixToolset.Msmq
4{ 4{
5#if TODO_CONSIDER_DECOMPILER
5 using System; 6 using System;
6 using System.Collections; 7 using System.Collections;
7 using System.Globalization; 8 using System.Globalization;
@@ -300,4 +301,5 @@ namespace WixToolset.Extensions
300 } 301 }
301 } 302 }
302 } 303 }
304#endif
303} 305}
diff --git a/src/wixext/MsmqErrors.cs b/src/wixext/MsmqErrors.cs
new file mode 100644
index 00000000..4342e1cf
--- /dev/null
+++ b/src/wixext/MsmqErrors.cs
@@ -0,0 +1,71 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Data
4{
5 using System;
6 using System.Resources;
7
8 public static class MsmqErrors
9 {
10 public static Message IllegalAttributeWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName)
11 {
12 return Message(sourceLineNumbers, Ids.IllegalAttributeWithoutComponent, "The {0}/@{1} attribute cannot be specified unless the element has a component as an ancestor. A {0} that does not have a component ancestor is not installed.", elementName, attributeName);
13 }
14
15 public static Message IllegalElementWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName)
16 {
17 return Message(sourceLineNumbers, Ids.IllegalElementWithoutComponent, "The {0} element cannot be specified unless the element has a component as an ancestor. A {0} that does not have a component ancestor is not installed.", elementName);
18 }
19
20 public static Message RequiredAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2)
21 {
22 return Message(sourceLineNumbers, Ids.RequiredAttribute, "A {0} element must have either a {1} attribute or a {2} attribute, or both set.", elementName, attributeName1, attributeName2);
23 }
24
25 public static Message RequiredAttributeNotUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2)
26 {
27 return Message(sourceLineNumbers, Ids.RequiredAttributeNotUnderComponent, "A {0} element not nested under a component must have either a {1} attribute or a {2} attribute, or both set.", elementName, attributeName1, attributeName2);
28 }
29
30 public static Message RequiredAttributeUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName)
31 {
32 return Message(sourceLineNumbers, Ids.RequiredAttributeUnderComponent, "The {0}/@{1} attribute must be provided when {0} element is nested under a component.", elementName, attributeName);
33 }
34
35 public static Message UnexpectedAttributeWithOtherValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName, string otherValue)
36 {
37 return Message(sourceLineNumbers, Ids.UnexpectedAttributeWithOtherValue, "The {0}/@{1} attribute cannot coexist with the {2} attribute's value of '{3}'.", elementName, attributeName, otherAttributeName, otherValue);
38 }
39
40 public static Message UnexpectedAttributeWithOtherValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string otherAttributeName, string otherValue)
41 {
42 return Message(sourceLineNumbers, Ids.UnexpectedAttributeWithOtherValue, "The {0}/@{1} attribute's value, '{2}', cannot coexist with the {3} attribute's value of '{4}'.", elementName, attributeName, value, otherAttributeName, otherValue);
43 }
44
45 public static Message UnexpectedAttributeWithoutOtherValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName, string otherValue)
46 {
47 return Message(sourceLineNumbers, Ids.UnexpectedAttributeWithoutOtherValue, "The {0}/@{1} cannot be provided unless the {2} attribute is provided with a value of '{3}'.", elementName, attributeName, otherAttributeName, otherValue);
48 }
49
50 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
51 {
52 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
53 }
54
55 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
56 {
57 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args);
58 }
59
60 public enum Ids
61 {
62 IllegalAttributeWithoutComponent = 6000,
63 IllegalElementWithoutComponent = 6001,
64 UnexpectedAttributeWithOtherValue = 6002,
65 UnexpectedAttributeWithoutOtherValue = 6003,
66 RequiredAttributeUnderComponent = 6004,
67 RequiredAttribute = 6005,
68 RequiredAttributeNotUnderComponent = 6006,
69 }
70 }
71}
diff --git a/src/wixext/MsmqExtensionData.cs b/src/wixext/MsmqExtensionData.cs
index 81d53ce7..dd1694f4 100644
--- a/src/wixext/MsmqExtensionData.cs
+++ b/src/wixext/MsmqExtensionData.cs
@@ -1,64 +1,30 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. 1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 2
3namespace WixToolset.Extensions 3namespace WixToolset.Msmq
4{ 4{
5 using System;
6 using System.Reflection;
7 using WixToolset.Data; 5 using WixToolset.Data;
8 using WixToolset.Extensibility; 6 using WixToolset.Extensibility;
9 7
10 /// <summary> 8 /// <summary>
11 /// The WiX Toolset MSMQ Extension. 9 /// The WiX Toolset MSMQ Extension.
12 /// </summary> 10 /// </summary>
13 public sealed class MsmqExtensionData : ExtensionData 11 public sealed class MsmqExtensionData : BaseExtensionData
14 { 12 {
15 /// <summary> 13 /// <summary>
16 /// Gets the default culture. 14 /// Gets the default culture.
17 /// </summary> 15 /// </summary>
18 /// <value>The default culture.</value> 16 /// <value>The default culture.</value>
19 public override string DefaultCulture 17 public override string DefaultCulture => "en-US";
20 {
21 get { return "en-us"; }
22 }
23
24 /// <summary>
25 /// Gets the optional table definitions for this extension.
26 /// </summary>
27 /// <value>The optional table definitions for this extension.</value>
28 public override TableDefinitionCollection TableDefinitions
29 {
30 get
31 {
32 return MsmqExtensionData.GetExtensionTableDefinitions();
33 }
34 }
35
36 /// <summary>
37 /// Gets the library associated with this extension.
38 /// </summary>
39 /// <param name="tableDefinitions">The table definitions to use while loading the library.</param>
40 /// <returns>The loaded library.</returns>
41 public override Library GetLibrary(TableDefinitionCollection tableDefinitions)
42 {
43 return MsmqExtensionData.GetExtensionLibrary(tableDefinitions);
44 }
45 18
46 /// <summary> 19 public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition)
47 /// Internal mechanism to access the extension's table definitions.
48 /// </summary>
49 /// <returns>Extension's table definitions.</returns>
50 internal static TableDefinitionCollection GetExtensionTableDefinitions()
51 { 20 {
52 return ExtensionData.LoadTableDefinitionHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.tables.xml"); 21 tupleDefinition = MsmqTupleDefinitions.ByName(name);
22 return tupleDefinition != null;
53 } 23 }
54 24
55 /// <summary> 25 public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions)
56 /// Internal mechanism to access the extension's library.
57 /// </summary>
58 /// <returns>Extension's library.</returns>
59 internal static Library GetExtensionLibrary(TableDefinitionCollection tableDefinitions)
60 { 26 {
61 return ExtensionData.LoadLibraryHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.msmq.wixlib", tableDefinitions); 27 return Intermediate.Load(typeof(MsmqExtensionData).Assembly, "WixToolset.Msmq.msmq.wixlib", tupleDefinitions);
62 } 28 }
63 } 29 }
64} 30}
diff --git a/src/wixext/MsmqExtensionFactory.cs b/src/wixext/MsmqExtensionFactory.cs
new file mode 100644
index 00000000..14dd5188
--- /dev/null
+++ b/src/wixext/MsmqExtensionFactory.cs
@@ -0,0 +1,18 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Msmq
4{
5 using System;
6 using System.Collections.Generic;
7 using WixToolset.Extensibility;
8
9 public class MsmqExtensionFactory : BaseExtensionFactory
10 {
11 protected override IEnumerable<Type> ExtensionTypes => new[]
12 {
13 typeof(MsmqCompiler),
14 typeof(MsmqExtensionData),
15 typeof(MsmqWindowsInstallerBackendBinderExtension),
16 };
17 }
18}
diff --git a/src/wixext/MsmqWarnings.cs b/src/wixext/MsmqWarnings.cs
new file mode 100644
index 00000000..41d160e9
--- /dev/null
+++ b/src/wixext/MsmqWarnings.cs
@@ -0,0 +1,30 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Data
4{
5 using System;
6 using System.Resources;
7
8 public static class MsmqWarnings
9 {
10 public static Message MissingComponents(SourceLineNumber sourceLineNumbers)
11 {
12 return Message(sourceLineNumbers, Ids.MissingComponents, "The MsmqAssembly element has a Type attribute with a value of 'native', but the element does not contain any MsmqComponent elements. All components contained in a native assembly must be listed, or they will not be correctly removed during uninstall.");
13 }
14
15 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
16 {
17 return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, format, args);
18 }
19
20 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
21 {
22 return new Message(sourceLineNumber, MessageLevel.Warning, (int)id, resourceManager, resourceName, args);
23 }
24
25 public enum Ids
26 {
27 MissingComponents = 6007,
28 }
29 }
30}
diff --git a/src/wixext/MsmqWindowsInstallerBackendExtension.cs b/src/wixext/MsmqWindowsInstallerBackendExtension.cs
new file mode 100644
index 00000000..d7e5c4e1
--- /dev/null
+++ b/src/wixext/MsmqWindowsInstallerBackendExtension.cs
@@ -0,0 +1,31 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Msmq
4{
5 using System.Linq;
6 using System.Xml;
7 using WixToolset.Data.WindowsInstaller;
8 using WixToolset.Extensibility;
9
10 public class MsmqWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension
11 {
12 public MsmqWindowsInstallerBackendBinderExtension()
13 {
14
15 }
16
17 private static readonly TableDefinition[] Tables = LoadTables();
18
19 protected override TableDefinition[] TableDefinitionsForTuples => Tables;
20
21 private static TableDefinition[] LoadTables()
22 {
23 using (var resourceStream = typeof(MsmqWindowsInstallerBackendBinderExtension).Assembly.GetManifestResourceStream("WixToolset.Msmq.tables.xml"))
24 using (var reader = XmlReader.Create(resourceStream))
25 {
26 var tables = TableDefinitionCollection.Load(reader);
27 return tables.ToArray();
28 }
29 }
30 }
31}
diff --git a/src/wixext/Tuples/MessageQueueGroupPermissionTuple.cs b/src/wixext/Tuples/MessageQueueGroupPermissionTuple.cs
new file mode 100644
index 00000000..cc690f9a
--- /dev/null
+++ b/src/wixext/Tuples/MessageQueueGroupPermissionTuple.cs
@@ -0,0 +1,79 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Msmq
4{
5 using WixToolset.Data;
6 using WixToolset.Msmq.Tuples;
7
8 public static partial class MsmqTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition MessageQueueGroupPermission = new IntermediateTupleDefinition(
11 MsmqTupleDefinitionType.MessageQueueGroupPermission.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(MessageQueueGroupPermissionTupleFields.MessageQueueGroupPermission), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(MessageQueueGroupPermissionTupleFields.Component_), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(MessageQueueGroupPermissionTupleFields.MessageQueue_), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(MessageQueueGroupPermissionTupleFields.Group_), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(MessageQueueGroupPermissionTupleFields.Permissions), IntermediateFieldType.Number),
19 },
20 typeof(MessageQueueGroupPermissionTuple));
21 }
22}
23
24namespace WixToolset.Msmq.Tuples
25{
26 using WixToolset.Data;
27
28 public enum MessageQueueGroupPermissionTupleFields
29 {
30 MessageQueueGroupPermission,
31 Component_,
32 MessageQueue_,
33 Group_,
34 Permissions,
35 }
36
37 public class MessageQueueGroupPermissionTuple : IntermediateTuple
38 {
39 public MessageQueueGroupPermissionTuple() : base(MsmqTupleDefinitions.MessageQueueGroupPermission, null, null)
40 {
41 }
42
43 public MessageQueueGroupPermissionTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(MsmqTupleDefinitions.MessageQueueGroupPermission, sourceLineNumber, id)
44 {
45 }
46
47 public IntermediateField this[MessageQueueGroupPermissionTupleFields index] => this.Fields[(int)index];
48
49 public string MessageQueueGroupPermission
50 {
51 get => this.Fields[(int)MessageQueueGroupPermissionTupleFields.MessageQueueGroupPermission].AsString();
52 set => this.Set((int)MessageQueueGroupPermissionTupleFields.MessageQueueGroupPermission, value);
53 }
54
55 public string Component_
56 {
57 get => this.Fields[(int)MessageQueueGroupPermissionTupleFields.Component_].AsString();
58 set => this.Set((int)MessageQueueGroupPermissionTupleFields.Component_, value);
59 }
60
61 public string MessageQueue_
62 {
63 get => this.Fields[(int)MessageQueueGroupPermissionTupleFields.MessageQueue_].AsString();
64 set => this.Set((int)MessageQueueGroupPermissionTupleFields.MessageQueue_, value);
65 }
66
67 public string Group_
68 {
69 get => this.Fields[(int)MessageQueueGroupPermissionTupleFields.Group_].AsString();
70 set => this.Set((int)MessageQueueGroupPermissionTupleFields.Group_, value);
71 }
72
73 public int Permissions
74 {
75 get => this.Fields[(int)MessageQueueGroupPermissionTupleFields.Permissions].AsNumber();
76 set => this.Set((int)MessageQueueGroupPermissionTupleFields.Permissions, value);
77 }
78 }
79} \ No newline at end of file
diff --git a/src/wixext/Tuples/MessageQueueTuple.cs b/src/wixext/Tuples/MessageQueueTuple.cs
new file mode 100644
index 00000000..86f7f2a4
--- /dev/null
+++ b/src/wixext/Tuples/MessageQueueTuple.cs
@@ -0,0 +1,127 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Msmq
4{
5 using WixToolset.Data;
6 using WixToolset.Msmq.Tuples;
7
8 public static partial class MsmqTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition MessageQueue = new IntermediateTupleDefinition(
11 MsmqTupleDefinitionType.MessageQueue.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.MessageQueue), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.Component_), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.BasePriority), IntermediateFieldType.Number),
17 new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.JournalQuota), IntermediateFieldType.Number),
18 new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.Label), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.MulticastAddress), IntermediateFieldType.String),
20 new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.PathName), IntermediateFieldType.String),
21 new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.PrivLevel), IntermediateFieldType.Number),
22 new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.Quota), IntermediateFieldType.Number),
23 new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.ServiceTypeGuid), IntermediateFieldType.String),
24 new IntermediateFieldDefinition(nameof(MessageQueueTupleFields.Attributes), IntermediateFieldType.Number),
25 },
26 typeof(MessageQueueTuple));
27 }
28}
29
30namespace WixToolset.Msmq.Tuples
31{
32 using WixToolset.Data;
33
34 public enum MessageQueueTupleFields
35 {
36 MessageQueue,
37 Component_,
38 BasePriority,
39 JournalQuota,
40 Label,
41 MulticastAddress,
42 PathName,
43 PrivLevel,
44 Quota,
45 ServiceTypeGuid,
46 Attributes,
47 }
48
49 public class MessageQueueTuple : IntermediateTuple
50 {
51 public MessageQueueTuple() : base(MsmqTupleDefinitions.MessageQueue, null, null)
52 {
53 }
54
55 public MessageQueueTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(MsmqTupleDefinitions.MessageQueue, sourceLineNumber, id)
56 {
57 }
58
59 public IntermediateField this[MessageQueueTupleFields index] => this.Fields[(int)index];
60
61 public string MessageQueue
62 {
63 get => this.Fields[(int)MessageQueueTupleFields.MessageQueue].AsString();
64 set => this.Set((int)MessageQueueTupleFields.MessageQueue, value);
65 }
66
67 public string Component_
68 {
69 get => this.Fields[(int)MessageQueueTupleFields.Component_].AsString();
70 set => this.Set((int)MessageQueueTupleFields.Component_, value);
71 }
72
73 public int BasePriority
74 {
75 get => this.Fields[(int)MessageQueueTupleFields.BasePriority].AsNumber();
76 set => this.Set((int)MessageQueueTupleFields.BasePriority, value);
77 }
78
79 public int JournalQuota
80 {
81 get => this.Fields[(int)MessageQueueTupleFields.JournalQuota].AsNumber();
82 set => this.Set((int)MessageQueueTupleFields.JournalQuota, value);
83 }
84
85 public string Label
86 {
87 get => this.Fields[(int)MessageQueueTupleFields.Label].AsString();
88 set => this.Set((int)MessageQueueTupleFields.Label, value);
89 }
90
91 public string MulticastAddress
92 {
93 get => this.Fields[(int)MessageQueueTupleFields.MulticastAddress].AsString();
94 set => this.Set((int)MessageQueueTupleFields.MulticastAddress, value);
95 }
96
97 public string PathName
98 {
99 get => this.Fields[(int)MessageQueueTupleFields.PathName].AsString();
100 set => this.Set((int)MessageQueueTupleFields.PathName, value);
101 }
102
103 public int PrivLevel
104 {
105 get => this.Fields[(int)MessageQueueTupleFields.PrivLevel].AsNumber();
106 set => this.Set((int)MessageQueueTupleFields.PrivLevel, value);
107 }
108
109 public int Quota
110 {
111 get => this.Fields[(int)MessageQueueTupleFields.Quota].AsNumber();
112 set => this.Set((int)MessageQueueTupleFields.Quota, value);
113 }
114
115 public string ServiceTypeGuid
116 {
117 get => this.Fields[(int)MessageQueueTupleFields.ServiceTypeGuid].AsString();
118 set => this.Set((int)MessageQueueTupleFields.ServiceTypeGuid, value);
119 }
120
121 public int Attributes
122 {
123 get => this.Fields[(int)MessageQueueTupleFields.Attributes].AsNumber();
124 set => this.Set((int)MessageQueueTupleFields.Attributes, value);
125 }
126 }
127} \ No newline at end of file
diff --git a/src/wixext/Tuples/MessageQueueUserPermissionTuple.cs b/src/wixext/Tuples/MessageQueueUserPermissionTuple.cs
new file mode 100644
index 00000000..8c5e6ade
--- /dev/null
+++ b/src/wixext/Tuples/MessageQueueUserPermissionTuple.cs
@@ -0,0 +1,79 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Msmq
4{
5 using WixToolset.Data;
6 using WixToolset.Msmq.Tuples;
7
8 public static partial class MsmqTupleDefinitions
9 {
10 public static readonly IntermediateTupleDefinition MessageQueueUserPermission = new IntermediateTupleDefinition(
11 MsmqTupleDefinitionType.MessageQueueUserPermission.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(MessageQueueUserPermissionTupleFields.MessageQueueUserPermission), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(MessageQueueUserPermissionTupleFields.Component_), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(MessageQueueUserPermissionTupleFields.MessageQueue_), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(MessageQueueUserPermissionTupleFields.User_), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(MessageQueueUserPermissionTupleFields.Permissions), IntermediateFieldType.Number),
19 },
20 typeof(MessageQueueUserPermissionTuple));
21 }
22}
23
24namespace WixToolset.Msmq.Tuples
25{
26 using WixToolset.Data;
27
28 public enum MessageQueueUserPermissionTupleFields
29 {
30 MessageQueueUserPermission,
31 Component_,
32 MessageQueue_,
33 User_,
34 Permissions,
35 }
36
37 public class MessageQueueUserPermissionTuple : IntermediateTuple
38 {
39 public MessageQueueUserPermissionTuple() : base(MsmqTupleDefinitions.MessageQueueUserPermission, null, null)
40 {
41 }
42
43 public MessageQueueUserPermissionTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(MsmqTupleDefinitions.MessageQueueUserPermission, sourceLineNumber, id)
44 {
45 }
46
47 public IntermediateField this[MessageQueueUserPermissionTupleFields index] => this.Fields[(int)index];
48
49 public string MessageQueueUserPermission
50 {
51 get => this.Fields[(int)MessageQueueUserPermissionTupleFields.MessageQueueUserPermission].AsString();
52 set => this.Set((int)MessageQueueUserPermissionTupleFields.MessageQueueUserPermission, value);
53 }
54
55 public string Component_
56 {
57 get => this.Fields[(int)MessageQueueUserPermissionTupleFields.Component_].AsString();
58 set => this.Set((int)MessageQueueUserPermissionTupleFields.Component_, value);
59 }
60
61 public string MessageQueue_
62 {
63 get => this.Fields[(int)MessageQueueUserPermissionTupleFields.MessageQueue_].AsString();
64 set => this.Set((int)MessageQueueUserPermissionTupleFields.MessageQueue_, value);
65 }
66
67 public string User_
68 {
69 get => this.Fields[(int)MessageQueueUserPermissionTupleFields.User_].AsString();
70 set => this.Set((int)MessageQueueUserPermissionTupleFields.User_, value);
71 }
72
73 public int Permissions
74 {
75 get => this.Fields[(int)MessageQueueUserPermissionTupleFields.Permissions].AsNumber();
76 set => this.Set((int)MessageQueueUserPermissionTupleFields.Permissions, value);
77 }
78 }
79} \ No newline at end of file
diff --git a/src/wixext/Tuples/MsmqTupleDefinitions.cs b/src/wixext/Tuples/MsmqTupleDefinitions.cs
new file mode 100644
index 00000000..e6accdc6
--- /dev/null
+++ b/src/wixext/Tuples/MsmqTupleDefinitions.cs
@@ -0,0 +1,47 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Msmq
4{
5 using System;
6 using WixToolset.Data;
7
8 public enum MsmqTupleDefinitionType
9 {
10 MessageQueue,
11 MessageQueueGroupPermission,
12 MessageQueueUserPermission,
13 }
14
15 public static partial class MsmqTupleDefinitions
16 {
17 public static readonly Version Version = new Version("4.0.0");
18
19 public static IntermediateTupleDefinition ByName(string name)
20 {
21 if (!Enum.TryParse(name, out MsmqTupleDefinitionType type))
22 {
23 return null;
24 }
25
26 return ByType(type);
27 }
28
29 public static IntermediateTupleDefinition ByType(MsmqTupleDefinitionType type)
30 {
31 switch (type)
32 {
33 case MsmqTupleDefinitionType.MessageQueue:
34 return MsmqTupleDefinitions.MessageQueue;
35
36 case MsmqTupleDefinitionType.MessageQueueGroupPermission:
37 return MsmqTupleDefinitions.MessageQueueGroupPermission;
38
39 case MsmqTupleDefinitionType.MessageQueueUserPermission:
40 return MsmqTupleDefinitions.MessageQueueUserPermission;
41
42 default:
43 throw new ArgumentOutOfRangeException(nameof(type));
44 }
45 }
46 }
47}
diff --git a/src/wixext/WixMsmqExtension.csproj b/src/wixext/WixMsmqExtension.csproj
deleted file mode 100644
index e37d62a3..00000000
--- a/src/wixext/WixMsmqExtension.csproj
+++ /dev/null
@@ -1,49 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
6 <PropertyGroup>
7 <ProjectGuid>{B990D81B-9F60-4EEE-B31D-B5D1EAA799EE}</ProjectGuid>
8 <AssemblyName>WixMsmqExtension</AssemblyName>
9 <OutputType>Library</OutputType>
10 <RootNamespace>WixToolset.Extensions</RootNamespace>
11 </PropertyGroup>
12 <ItemGroup>
13 <Compile Include="AssemblyInfo.cs" />
14 <Compile Include="MsmqCompiler.cs" />
15 <Compile Include="MsmqDecompiler.cs" />
16 <Compile Include="MsmqExtensionData.cs" />
17 <EmbeddedFlattenedResource Include="Data\tables.xml">
18 <LogicalName>$(RootNamespace).Data.tables.xml</LogicalName>
19 </EmbeddedFlattenedResource>
20 <EmbeddedFlattenedResource Include="Xsd\msmq.xsd">
21 <LogicalName>$(RootNamespace).Xsd.msmq.xsd</LogicalName>
22 </EmbeddedFlattenedResource>
23 <XsdGenSource Include="Xsd\msmq.xsd">
24 <CommonNamespace>WixToolset.Data.Serialize</CommonNamespace>
25 <Namespace>WixToolset.Extensions.Serialize.Msmq</Namespace>
26 </XsdGenSource>
27 <None Include="Xsd\msmq.xsd">
28 <Link>msmq.xsd</Link>
29 <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
30 </None>
31 <EmbeddedResource Include="$(OutputPath)\msmq.wixlib">
32 <Link>Data\msmq.wixlib</Link>
33 </EmbeddedResource>
34 </ItemGroup>
35
36 <ItemGroup>
37 <Reference Include="System" />
38 <Reference Include="System.Xml" />
39 <Reference Include="System.Xml.Linq" />
40 <ProjectReference Include="..\..\..\libs\WixToolset.Data\WixToolset.Data.csproj" />
41 <ProjectReference Include="..\..\..\libs\WixToolset.Extensibility\WixToolset.Extensibility.csproj" />
42 <ProjectReference Include="..\..\..\tools\wix\Wix.csproj" />
43 <ProjectReference Include="..\wixlib\MsmqExtension.wixproj">
44 <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
45 </ProjectReference>
46 </ItemGroup>
47
48 <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" />
49</Project>
diff --git a/src/wixext/WixToolset.Msmq.wixext.csproj b/src/wixext/WixToolset.Msmq.wixext.csproj
new file mode 100644
index 00000000..2db75ff7
--- /dev/null
+++ b/src/wixext/WixToolset.Msmq.wixext.csproj
@@ -0,0 +1,32 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4<Project Sdk="Microsoft.NET.Sdk">
5 <PropertyGroup>
6 <TargetFramework>netstandard2.0</TargetFramework>
7 <RootNamespace>WixToolset.Msmq</RootNamespace>
8 <Description>WiX Toolset MSMQ Extension</Description>
9 <Title>WiX Toolset MSMQ Extension</Title>
10 <IsTool>true</IsTool>
11 <ContentTargetFolders>build</ContentTargetFolders>
12 </PropertyGroup>
13
14 <ItemGroup>
15 <Content Include="$(MSBuildThisFileName).targets" />
16 <Content Include="msmq.xsd" PackagePath="tools" />
17 <EmbeddedResource Include="tables.xml" />
18 <EmbeddedResource Include="$(OutputPath)..\msmq.wixlib" />
19 </ItemGroup>
20
21 <ItemGroup>
22 <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" PrivateAssets="all" />
23 </ItemGroup>
24
25 <ItemGroup>
26 <ProjectReference Include="..\wixlib\msmq.wixproj" ReferenceOutputAssembly="false" Condition=" '$(NCrunch)'=='' " />
27 </ItemGroup>
28
29 <ItemGroup>
30 <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" />
31 </ItemGroup>
32</Project>
diff --git a/src/wixext/WixToolset.Msmq.wixext.targets b/src/wixext/WixToolset.Msmq.wixext.targets
new file mode 100644
index 00000000..5f69fe48
--- /dev/null
+++ b/src/wixext/WixToolset.Msmq.wixext.targets
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
5 <PropertyGroup>
6 <WixToolsetMsmqWixextPath Condition=" '$(WixToolsetMsmqWixextPath)' == '' ">$(MSBuildThisFileDirectory)..\tools\WixToolset.Msmq.wixext.dll</WixToolsetMsmqWixextPath>
7 </PropertyGroup>
8 <ItemGroup>
9 <WixExtension Include="$(WixToolsetMsmqWixextPath)" />
10 </ItemGroup>
11</Project>
diff --git a/src/wixext/messages.xml b/src/wixext/messages.xml
deleted file mode 100644
index 5ab6417f..00000000
--- a/src/wixext/messages.xml
+++ /dev/null
@@ -1,77 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<Messages Namespace="WixToolset.Extensions" Resources="Data.Messages" xmlns="http://schemas.microsoft.com/genmsgs/2004/07/messages">
6 <Class Name="MsmqErrors" ContainerName="MsmqErrorEventArgs" BaseContainerName="WixErrorEventArgs">
7 <Message Id="IllegalAttributeWithoutComponent" Number="6000">
8 <Instance>
9 The {0}/@{1} attribute cannot be specified unless the element has a component as an ancestor. A {0} that does not have a component ancestor is not installed.
10 <Parameter Type="System.String" Name="elementName" />
11 <Parameter Type="System.String" Name="attributeName" />
12 </Instance>
13 </Message>
14 <Message Id="IllegalElementWithoutComponent" Number="6001">
15 <Instance>
16 The {0} element cannot be specified unless the element has a component as an ancestor. A {0} that does not have a component ancestor is not installed.
17 <Parameter Type="System.String" Name="elementName" />
18 </Instance>
19 </Message>
20 <Message Id="UnexpectedAttributeWithOtherValue" Number="6002">
21 <Instance>
22 The {0}/@{1} attribute cannot coexist with the {2} attribute's value of '{3}'.
23 <Parameter Type="System.String" Name="elementName" />
24 <Parameter Type="System.String" Name="attributeName" />
25 <Parameter Type="System.String" Name="otherAttributeName" />
26 <Parameter Type="System.String" Name="otherValue" />
27 </Instance>
28 <Instance>
29 The {0}/@{1} attribute's value, '{2}', cannot coexist with the {3} attribute's value of '{4}'.
30 <Parameter Type="System.String" Name="elementName" />
31 <Parameter Type="System.String" Name="attributeName" />
32 <Parameter Type="System.String" Name="value" />
33 <Parameter Type="System.String" Name="otherAttributeName" />
34 <Parameter Type="System.String" Name="otherValue" />
35 </Instance>
36 </Message>
37 <Message Id="UnexpectedAttributeWithoutOtherValue" Number="6003">
38 <Instance>
39 The {0}/@{1} cannot be provided unless the {2} attribute is provided with a value of '{3}'.
40 <Parameter Type="System.String" Name="elementName" />
41 <Parameter Type="System.String" Name="attributeName" />
42 <Parameter Type="System.String" Name="otherAttributeName" />
43 <Parameter Type="System.String" Name="otherValue" />
44 </Instance>
45 </Message>
46 <Message Id="RequiredAttributeUnderComponent" Number="6004">
47 <Instance>
48 The {0}/@{1} attribute must be provided when {0} element is nested under a component.
49 <Parameter Type="System.String" Name="elementName" />
50 <Parameter Type="System.String" Name="attributeName" />
51 </Instance>
52 </Message>
53 <Message Id="RequiredAttribute" Number="6005">
54 <Instance>
55 A {0} element must have either a {1} attribute or a {2} attribute, or both set.
56 <Parameter Type="System.String" Name="elementName" />
57 <Parameter Type="System.String" Name="attributeName1" />
58 <Parameter Type="System.String" Name="attributeName2" />
59 </Instance>
60 </Message>
61 <Message Id="RequiredAttributeNotUnderComponent" Number="6006">
62 <Instance>
63 A {0} element not nested under a component must have either a {1} attribute or a {2} attribute, or both set.
64 <Parameter Type="System.String" Name="elementName" />
65 <Parameter Type="System.String" Name="attributeName1" />
66 <Parameter Type="System.String" Name="attributeName2" />
67 </Instance>
68 </Message>
69 </Class>
70 <Class Name="MsmqWarnings" ContainerName="MsmqWarningEventArgs" BaseContainerName="WixWarningEventArgs">
71 <Message Id="MissingComponents" Number="6007">
72 <Instance>The MsmqAssembly element has a Type attribute with a value of 'native', but the element does not contain any MsmqComponent elements. All components contained in a native assembly must be listed, or they will not be correctly removed during uninstall.</Instance>
73 </Message>
74 </Class>
75 <Class Name="MsmqVerboses" ContainerName="MsmqVerboseEventArgs" BaseContainerName="WixVerboseEventArgs">
76 </Class>
77</Messages>