diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2019-01-19 19:19:15 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2019-01-19 19:19:15 -0600 |
commit | a12b13c36d1da707cf541595cf5f38338f37cc68 (patch) | |
tree | 8dc9b00c7bcad590a21f09e5cf494d740832d25f /src/wixext | |
parent | ed56e28bad640bb3164929a66ad45150a577adbf (diff) | |
download | wix-a12b13c36d1da707cf541595cf5f38338f37cc68.tar.gz wix-a12b13c36d1da707cf541595cf5f38338f37cc68.tar.bz2 wix-a12b13c36d1da707cf541595cf5f38338f37cc68.zip |
Import code from old v4 repo
Diffstat (limited to 'src/wixext')
-rw-r--r-- | src/wixext/MsmqCompiler.cs | 536 | ||||
-rw-r--r-- | src/wixext/MsmqDecompiler.cs | 303 | ||||
-rw-r--r-- | src/wixext/MsmqExtensionData.cs | 64 | ||||
-rw-r--r-- | src/wixext/WixMsmqExtension.csproj | 49 | ||||
-rw-r--r-- | src/wixext/messages.xml | 77 | ||||
-rw-r--r-- | src/wixext/msmq.xsd | 121 | ||||
-rw-r--r-- | src/wixext/tables.xml | 54 |
7 files changed, 1204 insertions, 0 deletions
diff --git a/src/wixext/MsmqCompiler.cs b/src/wixext/MsmqCompiler.cs new file mode 100644 index 00000000..b40e2dc1 --- /dev/null +++ b/src/wixext/MsmqCompiler.cs | |||
@@ -0,0 +1,536 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensions | ||
4 | { | ||
5 | using System; | ||
6 | using System.Collections; | ||
7 | using System.Collections.Generic; | ||
8 | using System.Globalization; | ||
9 | using System.Reflection; | ||
10 | using System.Xml; | ||
11 | using System.Xml.Linq; | ||
12 | using System.Xml.Schema; | ||
13 | using WixToolset.Data; | ||
14 | using WixToolset.Extensibility; | ||
15 | |||
16 | /// <summary> | ||
17 | /// The compiler for the WiX Toolset Internet Information Services Extension. | ||
18 | /// </summary> | ||
19 | public sealed class MsmqCompiler : CompilerExtension | ||
20 | { | ||
21 | /// <summary> | ||
22 | /// Instantiate a new MsmqCompiler. | ||
23 | /// </summary> | ||
24 | public MsmqCompiler() | ||
25 | { | ||
26 | this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/msmq"; | ||
27 | } | ||
28 | |||
29 | /// <summary> | ||
30 | /// </summary> | ||
31 | /// <remarks></remarks> | ||
32 | public enum MqiMessageQueueAttributes | ||
33 | { | ||
34 | Authenticate = (1 << 0), | ||
35 | Journal = (1 << 1), | ||
36 | Transactional = (1 << 2) | ||
37 | } | ||
38 | |||
39 | /// <summary> | ||
40 | /// </summary> | ||
41 | /// <remarks></remarks> | ||
42 | public enum MqiMessageQueuePrivacyLevel | ||
43 | { | ||
44 | None = 0, | ||
45 | Optional = 1, | ||
46 | Body = 2 | ||
47 | } | ||
48 | |||
49 | /// <summary> | ||
50 | /// </summary> | ||
51 | /// <remarks></remarks> | ||
52 | public enum MqiMessageQueuePermission | ||
53 | { | ||
54 | DeleteMessage = (1 << 0), | ||
55 | PeekMessage = (1 << 1), | ||
56 | WriteMessage = (1 << 2), | ||
57 | DeleteJournalMessage = (1 << 3), | ||
58 | SetQueueProperties = (1 << 4), | ||
59 | GetQueueProperties = (1 << 5), | ||
60 | DeleteQueue = (1 << 6), | ||
61 | GetQueuePermissions = (1 << 7), | ||
62 | ChangeQueuePermissions = (1 << 8), | ||
63 | TakeQueueOwnership = (1 << 9), | ||
64 | ReceiveMessage = (1 << 10), | ||
65 | ReceiveJournalMessage = (1 << 11), | ||
66 | QueueGenericRead = (1 << 12), | ||
67 | QueueGenericWrite = (1 << 13), | ||
68 | QueueGenericExecute = (1 << 14), | ||
69 | QueueGenericAll = (1 << 15) | ||
70 | } | ||
71 | |||
72 | /// <summary> | ||
73 | /// Processes an element for the Compiler. | ||
74 | /// </summary> | ||
75 | /// <param name="parentElement">Parent element of element to process.</param> | ||
76 | /// <param name="element">Element to process.</param> | ||
77 | /// <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) | ||
79 | { | ||
80 | switch (parentElement.Name.LocalName) | ||
81 | { | ||
82 | case "Component": | ||
83 | string componentId = context["ComponentId"]; | ||
84 | string directoryId = context["DirectoryId"]; | ||
85 | |||
86 | switch (element.Name.LocalName) | ||
87 | { | ||
88 | case "MessageQueue": | ||
89 | this.ParseMessageQueueElement(element, componentId); | ||
90 | break; | ||
91 | case "MessageQueuePermission": | ||
92 | this.ParseMessageQueuePermissionElement(element, componentId, null); | ||
93 | break; | ||
94 | default: | ||
95 | this.Core.UnexpectedElement(parentElement, element); | ||
96 | break; | ||
97 | } | ||
98 | break; | ||
99 | default: | ||
100 | this.Core.UnexpectedElement(parentElement, element); | ||
101 | break; | ||
102 | } | ||
103 | } | ||
104 | |||
105 | /// <summary> | ||
106 | /// Parses an MSMQ message queue element. | ||
107 | /// </summary> | ||
108 | /// <param name="node">Element to parse.</param> | ||
109 | /// <param name="componentKey">Identifier of parent component.</param> | ||
110 | private void ParseMessageQueueElement(XElement node, string componentId) | ||
111 | { | ||
112 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
113 | |||
114 | string id = null; | ||
115 | int basePriority = CompilerConstants.IntegerNotSet; | ||
116 | int journalQuota = CompilerConstants.IntegerNotSet; | ||
117 | string label = null; | ||
118 | string multicastAddress = null; | ||
119 | string pathName = null; | ||
120 | int privLevel = CompilerConstants.IntegerNotSet; | ||
121 | int quota = CompilerConstants.IntegerNotSet; | ||
122 | string serviceTypeGuid = null; | ||
123 | int attributes = 0; | ||
124 | |||
125 | foreach (XAttribute attrib in node.Attributes()) | ||
126 | { | ||
127 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
128 | { | ||
129 | switch (attrib.Name.LocalName) | ||
130 | { | ||
131 | case "Id": | ||
132 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
133 | break; | ||
134 | case "Authenticate": | ||
135 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
136 | { | ||
137 | attributes |= (int)MqiMessageQueueAttributes.Authenticate; | ||
138 | } | ||
139 | else | ||
140 | { | ||
141 | attributes &= ~(int)MqiMessageQueueAttributes.Authenticate; | ||
142 | } | ||
143 | break; | ||
144 | case "BasePriority": | ||
145 | basePriority = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue); | ||
146 | break; | ||
147 | case "Journal": | ||
148 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
149 | { | ||
150 | attributes |= (int)MqiMessageQueueAttributes.Journal; | ||
151 | } | ||
152 | else | ||
153 | { | ||
154 | attributes &= ~(int)MqiMessageQueueAttributes.Journal; | ||
155 | } | ||
156 | break; | ||
157 | case "JournalQuota": | ||
158 | journalQuota = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); | ||
159 | break; | ||
160 | case "Label": | ||
161 | label = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
162 | break; | ||
163 | case "MulticastAddress": | ||
164 | multicastAddress = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
165 | break; | ||
166 | case "PathName": | ||
167 | pathName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
168 | break; | ||
169 | case "PrivLevel": | ||
170 | string privLevelAttr = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
171 | switch (privLevelAttr) | ||
172 | { | ||
173 | case "none": | ||
174 | privLevel = (int)MqiMessageQueuePrivacyLevel.None; | ||
175 | break; | ||
176 | case "optional": | ||
177 | privLevel = (int)MqiMessageQueuePrivacyLevel.Optional; | ||
178 | break; | ||
179 | case "body": | ||
180 | privLevel = (int)MqiMessageQueuePrivacyLevel.Body; | ||
181 | break; | ||
182 | default: | ||
183 | this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, "MessageQueue", "PrivLevel", privLevelAttr, "none", "body", "optional")); | ||
184 | break; | ||
185 | } | ||
186 | break; | ||
187 | case "Quota": | ||
188 | quota = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue); | ||
189 | break; | ||
190 | case "Transactional": | ||
191 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
192 | { | ||
193 | attributes |= (int)MqiMessageQueueAttributes.Transactional; | ||
194 | } | ||
195 | else | ||
196 | { | ||
197 | attributes &= ~(int)MqiMessageQueueAttributes.Transactional; | ||
198 | } | ||
199 | break; | ||
200 | case "ServiceTypeGuid": | ||
201 | serviceTypeGuid = TryFormatGuidValue(this.Core.GetAttributeValue(sourceLineNumbers, attrib)); | ||
202 | break; | ||
203 | default: | ||
204 | this.Core.UnexpectedAttribute(node, attrib); | ||
205 | break; | ||
206 | } | ||
207 | } | ||
208 | else | ||
209 | { | ||
210 | this.Core.ParseExtensionAttribute(node, attrib); | ||
211 | } | ||
212 | } | ||
213 | |||
214 | foreach (XElement child in node.Elements()) | ||
215 | { | ||
216 | if (this.Namespace == child.Name.Namespace) | ||
217 | { | ||
218 | switch (child.Name.LocalName) | ||
219 | { | ||
220 | case "MessageQueuePermission": | ||
221 | this.ParseMessageQueuePermissionElement(child, componentId, id); | ||
222 | break; | ||
223 | default: | ||
224 | this.Core.UnexpectedElement(node, child); | ||
225 | break; | ||
226 | } | ||
227 | } | ||
228 | else | ||
229 | { | ||
230 | this.Core.ParseExtensionElement(node, child); | ||
231 | } | ||
232 | } | ||
233 | |||
234 | Row row = this.Core.CreateRow(sourceLineNumbers, "MessageQueue"); | ||
235 | row[0] = id; | ||
236 | row[1] = componentId; | ||
237 | if (CompilerConstants.IntegerNotSet != basePriority) | ||
238 | { | ||
239 | row[2] = basePriority; | ||
240 | } | ||
241 | if (CompilerConstants.IntegerNotSet != journalQuota) | ||
242 | { | ||
243 | row[3] = journalQuota; | ||
244 | } | ||
245 | row[4] = label; | ||
246 | row[5] = multicastAddress; | ||
247 | row[6] = pathName; | ||
248 | if (CompilerConstants.IntegerNotSet != privLevel) | ||
249 | { | ||
250 | row[7] = privLevel; | ||
251 | } | ||
252 | if (CompilerConstants.IntegerNotSet != quota) | ||
253 | { | ||
254 | row[8] = quota; | ||
255 | } | ||
256 | row[9] = serviceTypeGuid; | ||
257 | row[10] = attributes; | ||
258 | |||
259 | this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "MessageQueuingInstall"); | ||
260 | this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "MessageQueuingUninstall"); | ||
261 | } | ||
262 | |||
263 | /// <summary> | ||
264 | /// Parses an MSMQ message queue permission element. | ||
265 | /// </summary> | ||
266 | /// <param name="node">Element to parse.</param> | ||
267 | /// <param name="componentKey">Identifier of parent component.</param> | ||
268 | /// <param name="applicationKey">Optional identifier of parent message queue.</param> | ||
269 | private void ParseMessageQueuePermissionElement(XElement node, string componentId, string messageQueueId) | ||
270 | { | ||
271 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
272 | |||
273 | string id = null; | ||
274 | string user = null; | ||
275 | string group = null; | ||
276 | int permissions = 0; | ||
277 | |||
278 | foreach (XAttribute attrib in node.Attributes()) | ||
279 | { | ||
280 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
281 | { | ||
282 | switch (attrib.Name.LocalName) | ||
283 | { | ||
284 | case "Id": | ||
285 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
286 | break; | ||
287 | case "MessageQueue": | ||
288 | if (null != messageQueueId) | ||
289 | { | ||
290 | this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); | ||
291 | } | ||
292 | messageQueueId = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
293 | this.Core.CreateSimpleReference(sourceLineNumbers, "MessageQueue", messageQueueId); | ||
294 | break; | ||
295 | case "User": | ||
296 | if (null != group) | ||
297 | { | ||
298 | this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "User", "Group")); | ||
299 | } | ||
300 | user = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
301 | this.Core.CreateSimpleReference(sourceLineNumbers, "User", user); | ||
302 | break; | ||
303 | case "Group": | ||
304 | if (null != user) | ||
305 | { | ||
306 | this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Group", "User")); | ||
307 | } | ||
308 | group = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
309 | this.Core.CreateSimpleReference(sourceLineNumbers, "Group", group); | ||
310 | break; | ||
311 | case "DeleteMessage": | ||
312 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
313 | { | ||
314 | permissions |= (int)MqiMessageQueuePermission.DeleteMessage; | ||
315 | } | ||
316 | else | ||
317 | { | ||
318 | permissions &= ~(int)MqiMessageQueuePermission.DeleteMessage; | ||
319 | } | ||
320 | break; | ||
321 | case "PeekMessage": | ||
322 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
323 | { | ||
324 | permissions |= (int)MqiMessageQueuePermission.PeekMessage; | ||
325 | } | ||
326 | else | ||
327 | { | ||
328 | permissions &= ~(int)MqiMessageQueuePermission.PeekMessage; | ||
329 | } | ||
330 | break; | ||
331 | case "WriteMessage": | ||
332 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
333 | { | ||
334 | permissions |= (int)MqiMessageQueuePermission.WriteMessage; | ||
335 | } | ||
336 | else | ||
337 | { | ||
338 | permissions &= ~(int)MqiMessageQueuePermission.WriteMessage; | ||
339 | } | ||
340 | break; | ||
341 | case "DeleteJournalMessage": | ||
342 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
343 | { | ||
344 | permissions |= (int)MqiMessageQueuePermission.DeleteJournalMessage; | ||
345 | } | ||
346 | else | ||
347 | { | ||
348 | permissions &= ~(int)MqiMessageQueuePermission.DeleteJournalMessage; | ||
349 | } | ||
350 | break; | ||
351 | case "SetQueueProperties": | ||
352 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
353 | { | ||
354 | permissions |= (int)MqiMessageQueuePermission.SetQueueProperties; | ||
355 | } | ||
356 | else | ||
357 | { | ||
358 | permissions &= ~(int)MqiMessageQueuePermission.SetQueueProperties; | ||
359 | } | ||
360 | break; | ||
361 | case "GetQueueProperties": | ||
362 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
363 | { | ||
364 | permissions |= (int)MqiMessageQueuePermission.GetQueueProperties; | ||
365 | } | ||
366 | else | ||
367 | { | ||
368 | permissions &= ~(int)MqiMessageQueuePermission.GetQueueProperties; | ||
369 | } | ||
370 | break; | ||
371 | case "DeleteQueue": | ||
372 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
373 | { | ||
374 | permissions |= (int)MqiMessageQueuePermission.DeleteQueue; | ||
375 | } | ||
376 | else | ||
377 | { | ||
378 | permissions &= ~(int)MqiMessageQueuePermission.DeleteQueue; | ||
379 | } | ||
380 | break; | ||
381 | case "GetQueuePermissions": | ||
382 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
383 | { | ||
384 | permissions |= (int)MqiMessageQueuePermission.GetQueuePermissions; | ||
385 | } | ||
386 | else | ||
387 | { | ||
388 | permissions &= ~(int)MqiMessageQueuePermission.GetQueuePermissions; | ||
389 | } | ||
390 | break; | ||
391 | case "ChangeQueuePermissions": | ||
392 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
393 | { | ||
394 | permissions |= (int)MqiMessageQueuePermission.ChangeQueuePermissions; | ||
395 | } | ||
396 | else | ||
397 | { | ||
398 | permissions &= ~(int)MqiMessageQueuePermission.ChangeQueuePermissions; | ||
399 | } | ||
400 | break; | ||
401 | case "TakeQueueOwnership": | ||
402 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
403 | { | ||
404 | permissions |= (int)MqiMessageQueuePermission.TakeQueueOwnership; | ||
405 | } | ||
406 | else | ||
407 | { | ||
408 | permissions &= ~(int)MqiMessageQueuePermission.TakeQueueOwnership; | ||
409 | } | ||
410 | break; | ||
411 | case "ReceiveMessage": | ||
412 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
413 | { | ||
414 | permissions |= (int)MqiMessageQueuePermission.ReceiveMessage; | ||
415 | } | ||
416 | else | ||
417 | { | ||
418 | permissions &= ~(int)MqiMessageQueuePermission.ReceiveMessage; | ||
419 | } | ||
420 | break; | ||
421 | case "ReceiveJournalMessage": | ||
422 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
423 | { | ||
424 | permissions |= (int)MqiMessageQueuePermission.ReceiveJournalMessage; | ||
425 | } | ||
426 | else | ||
427 | { | ||
428 | permissions &= ~(int)MqiMessageQueuePermission.ReceiveJournalMessage; | ||
429 | } | ||
430 | break; | ||
431 | case "QueueGenericRead": | ||
432 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
433 | { | ||
434 | permissions |= (int)MqiMessageQueuePermission.QueueGenericRead; | ||
435 | } | ||
436 | else | ||
437 | { | ||
438 | permissions &= ~(int)MqiMessageQueuePermission.QueueGenericRead; | ||
439 | } | ||
440 | break; | ||
441 | case "QueueGenericWrite": | ||
442 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
443 | { | ||
444 | permissions |= (int)MqiMessageQueuePermission.QueueGenericWrite; | ||
445 | } | ||
446 | else | ||
447 | { | ||
448 | permissions &= ~(int)MqiMessageQueuePermission.QueueGenericWrite; | ||
449 | } | ||
450 | break; | ||
451 | case "QueueGenericExecute": | ||
452 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
453 | { | ||
454 | permissions |= (int)MqiMessageQueuePermission.QueueGenericExecute; | ||
455 | } | ||
456 | else | ||
457 | { | ||
458 | permissions &= ~(int)MqiMessageQueuePermission.QueueGenericExecute; | ||
459 | } | ||
460 | break; | ||
461 | case "QueueGenericAll": | ||
462 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) | ||
463 | { | ||
464 | permissions |= (int)MqiMessageQueuePermission.QueueGenericAll; | ||
465 | } | ||
466 | else | ||
467 | { | ||
468 | permissions &= ~(int)MqiMessageQueuePermission.QueueGenericAll; | ||
469 | } | ||
470 | break; | ||
471 | default: | ||
472 | this.Core.UnexpectedAttribute(node, attrib); | ||
473 | break; | ||
474 | } | ||
475 | } | ||
476 | else | ||
477 | { | ||
478 | this.Core.ParseExtensionAttribute(node, attrib); | ||
479 | } | ||
480 | } | ||
481 | |||
482 | if (null == messageQueueId) | ||
483 | { | ||
484 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "MessageQueue")); | ||
485 | } | ||
486 | if (null == user && null == group) | ||
487 | { | ||
488 | this.Core.OnMessage(WixErrors.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "User", "Group")); | ||
489 | } | ||
490 | |||
491 | this.Core.ParseForExtensionElements(node); | ||
492 | |||
493 | if (null != user) | ||
494 | { | ||
495 | Row row = this.Core.CreateRow(sourceLineNumbers, "MessageQueueUserPermission"); | ||
496 | row[0] = id; | ||
497 | row[1] = componentId; | ||
498 | row[2] = messageQueueId; | ||
499 | row[3] = user; | ||
500 | row[4] = permissions; | ||
501 | } | ||
502 | if (null != group) | ||
503 | { | ||
504 | Row row = this.Core.CreateRow(sourceLineNumbers, "MessageQueueGroupPermission"); | ||
505 | row[0] = id; | ||
506 | row[1] = componentId; | ||
507 | row[2] = messageQueueId; | ||
508 | row[3] = group; | ||
509 | row[4] = permissions; | ||
510 | } | ||
511 | } | ||
512 | |||
513 | /// <summary> | ||
514 | /// Attempts to parse the input value as a GUID, and in case the value is a valid | ||
515 | /// GUID returnes it in the format "{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}". | ||
516 | /// </summary> | ||
517 | /// <param name="val"></param> | ||
518 | /// <returns></returns> | ||
519 | string TryFormatGuidValue(string val) | ||
520 | { | ||
521 | try | ||
522 | { | ||
523 | Guid guid = new Guid(val); | ||
524 | return guid.ToString("B").ToUpper(); | ||
525 | } | ||
526 | catch (FormatException) | ||
527 | { | ||
528 | return val; | ||
529 | } | ||
530 | catch (OverflowException) | ||
531 | { | ||
532 | return val; | ||
533 | } | ||
534 | } | ||
535 | } | ||
536 | } | ||
diff --git a/src/wixext/MsmqDecompiler.cs b/src/wixext/MsmqDecompiler.cs new file mode 100644 index 00000000..396fc49a --- /dev/null +++ b/src/wixext/MsmqDecompiler.cs | |||
@@ -0,0 +1,303 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensions | ||
4 | { | ||
5 | using System; | ||
6 | using System.Collections; | ||
7 | using System.Globalization; | ||
8 | using WixToolset.Data; | ||
9 | using WixToolset.Extensibility; | ||
10 | using Msmq = WixToolset.Extensions.Serialize.Msmq; | ||
11 | using Wix = WixToolset.Data.Serialize; | ||
12 | |||
13 | /// <summary> | ||
14 | /// The decompiler for the WiX Toolset MSMQ Extension. | ||
15 | /// </summary> | ||
16 | public sealed class MsmqDecompiler : DecompilerExtension | ||
17 | { | ||
18 | /// <summary> | ||
19 | /// Creates a decompiler for MSMQ Extension. | ||
20 | /// </summary> | ||
21 | public MsmqDecompiler() | ||
22 | { | ||
23 | this.TableDefinitions = MsmqExtensionData.GetExtensionTableDefinitions(); | ||
24 | } | ||
25 | |||
26 | /// <summary> | ||
27 | /// Get the extensions library to be removed. | ||
28 | /// </summary> | ||
29 | /// <param name="tableDefinitions">Table definitions for library.</param> | ||
30 | /// <returns>Library to remove from decompiled output.</returns> | ||
31 | public override Library GetLibraryToRemove(TableDefinitionCollection tableDefinitions) | ||
32 | { | ||
33 | return MsmqExtensionData.GetExtensionLibrary(tableDefinitions); | ||
34 | } | ||
35 | |||
36 | /// <summary> | ||
37 | /// Decompiles an extension table. | ||
38 | /// </summary> | ||
39 | /// <param name="table">The table to decompile.</param> | ||
40 | public override void DecompileTable(Table table) | ||
41 | { | ||
42 | switch (table.Name) | ||
43 | { | ||
44 | case "MessageQueue": | ||
45 | this.DecompileMessageQueueTable(table); | ||
46 | break; | ||
47 | case "MessageQueueUserPermission": | ||
48 | this.DecompileMessageQueueUserPermissionTable(table); | ||
49 | break; | ||
50 | case "MessageQueueGroupPermission": | ||
51 | this.DecompileMessageQueueGroupPermissionTable(table); | ||
52 | break; | ||
53 | default: | ||
54 | base.DecompileTable(table); | ||
55 | break; | ||
56 | } | ||
57 | } | ||
58 | |||
59 | /// <summary> | ||
60 | /// Decompile the MessageQueue table. | ||
61 | /// </summary> | ||
62 | /// <param name="table">The table to decompile.</param> | ||
63 | private void DecompileMessageQueueTable(Table table) | ||
64 | { | ||
65 | foreach (Row row in table.Rows) | ||
66 | { | ||
67 | Msmq.MessageQueue queue = new Msmq.MessageQueue(); | ||
68 | |||
69 | queue.Id = (string)row[0]; | ||
70 | |||
71 | if (null != row[2]) | ||
72 | { | ||
73 | queue.BasePriority = (int)row[2]; | ||
74 | } | ||
75 | |||
76 | if (null != row[3]) | ||
77 | { | ||
78 | queue.JournalQuota = (int)row[3]; | ||
79 | } | ||
80 | |||
81 | queue.Label = (string)row[4]; | ||
82 | |||
83 | if (null != row[5]) | ||
84 | { | ||
85 | queue.MulticastAddress = (string)row[5]; | ||
86 | } | ||
87 | |||
88 | queue.PathName = (string)row[6]; | ||
89 | |||
90 | if (null != row[7]) | ||
91 | { | ||
92 | switch ((MsmqCompiler.MqiMessageQueuePrivacyLevel)row[7]) | ||
93 | { | ||
94 | case MsmqCompiler.MqiMessageQueuePrivacyLevel.None: | ||
95 | queue.PrivLevel = Msmq.MessageQueue.PrivLevelType.none; | ||
96 | break; | ||
97 | case MsmqCompiler.MqiMessageQueuePrivacyLevel.Optional: | ||
98 | queue.PrivLevel = Msmq.MessageQueue.PrivLevelType.optional; | ||
99 | break; | ||
100 | case MsmqCompiler.MqiMessageQueuePrivacyLevel.Body: | ||
101 | queue.PrivLevel = Msmq.MessageQueue.PrivLevelType.body; | ||
102 | break; | ||
103 | default: | ||
104 | break; | ||
105 | } | ||
106 | } | ||
107 | |||
108 | if (null != row[8]) | ||
109 | { | ||
110 | queue.Quota = (int)row[8]; | ||
111 | } | ||
112 | |||
113 | if (null != row[9]) | ||
114 | { | ||
115 | queue.ServiceTypeGuid = (string)row[9]; | ||
116 | } | ||
117 | |||
118 | int attributes = (int)row[10]; | ||
119 | |||
120 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Authenticate)) | ||
121 | { | ||
122 | queue.Authenticate = Msmq.YesNoType.yes; | ||
123 | } | ||
124 | |||
125 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Journal)) | ||
126 | { | ||
127 | queue.Journal = Msmq.YesNoType.yes; | ||
128 | } | ||
129 | |||
130 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueueAttributes.Transactional)) | ||
131 | { | ||
132 | queue.Transactional = Msmq.YesNoType.yes; | ||
133 | } | ||
134 | |||
135 | Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]); | ||
136 | if (null != component) | ||
137 | { | ||
138 | component.AddChild(queue); | ||
139 | } | ||
140 | else | ||
141 | { | ||
142 | this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component")); | ||
143 | } | ||
144 | } | ||
145 | } | ||
146 | |||
147 | /// <summary> | ||
148 | /// Decompile the MessageQueueUserPermission table. | ||
149 | /// </summary> | ||
150 | /// <param name="table">The table to decompile.</param> | ||
151 | private void DecompileMessageQueueUserPermissionTable(Table table) | ||
152 | { | ||
153 | foreach (Row row in table.Rows) | ||
154 | { | ||
155 | Msmq.MessageQueuePermission queuePermission = new Msmq.MessageQueuePermission(); | ||
156 | |||
157 | queuePermission.Id = (string)row[0]; | ||
158 | |||
159 | if (null != row[2]) | ||
160 | { | ||
161 | queuePermission.MessageQueue = (string)row[2]; | ||
162 | } | ||
163 | |||
164 | queuePermission.User = (string)row[3]; | ||
165 | |||
166 | DecompileMessageQueuePermissionAttributes(row, queuePermission); | ||
167 | |||
168 | Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]); | ||
169 | if (null != component) | ||
170 | { | ||
171 | component.AddChild(queuePermission); | ||
172 | } | ||
173 | else | ||
174 | { | ||
175 | this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component")); | ||
176 | } | ||
177 | } | ||
178 | } | ||
179 | |||
180 | /// <summary> | ||
181 | /// Decompile the MessageQueueGroupPermission table. | ||
182 | /// </summary> | ||
183 | /// <param name="table">The table to decompile.</param> | ||
184 | private void DecompileMessageQueueGroupPermissionTable(Table table) | ||
185 | { | ||
186 | foreach (Row row in table.Rows) | ||
187 | { | ||
188 | Msmq.MessageQueuePermission queuePermission = new Msmq.MessageQueuePermission(); | ||
189 | |||
190 | queuePermission.Id = (string)row[0]; | ||
191 | |||
192 | if (null != row[2]) | ||
193 | { | ||
194 | queuePermission.MessageQueue = (string)row[2]; | ||
195 | } | ||
196 | |||
197 | queuePermission.Group = (string)row[3]; | ||
198 | |||
199 | DecompileMessageQueuePermissionAttributes(row, queuePermission); | ||
200 | |||
201 | Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]); | ||
202 | if (null != component) | ||
203 | { | ||
204 | component.AddChild(queuePermission); | ||
205 | } | ||
206 | else | ||
207 | { | ||
208 | this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component")); | ||
209 | } | ||
210 | } | ||
211 | } | ||
212 | |||
213 | /// <summary> | ||
214 | /// Decompile row attributes for the MessageQueueUserPermission and MessageQueueGroupPermission tables. | ||
215 | /// </summary> | ||
216 | /// <param name="row">The row to decompile.</param> | ||
217 | /// <param name="table">Target element.</param> | ||
218 | private void DecompileMessageQueuePermissionAttributes(Row row, Msmq.MessageQueuePermission queuePermission) | ||
219 | { | ||
220 | int attributes = (int)row[4]; | ||
221 | |||
222 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.DeleteMessage)) | ||
223 | { | ||
224 | queuePermission.DeleteMessage = Msmq.YesNoType.yes; | ||
225 | } | ||
226 | |||
227 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.PeekMessage)) | ||
228 | { | ||
229 | queuePermission.PeekMessage = Msmq.YesNoType.yes; | ||
230 | } | ||
231 | |||
232 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.WriteMessage)) | ||
233 | { | ||
234 | queuePermission.WriteMessage = Msmq.YesNoType.yes; | ||
235 | } | ||
236 | |||
237 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.DeleteJournalMessage)) | ||
238 | { | ||
239 | queuePermission.DeleteJournalMessage = Msmq.YesNoType.yes; | ||
240 | } | ||
241 | |||
242 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.SetQueueProperties)) | ||
243 | { | ||
244 | queuePermission.SetQueueProperties = Msmq.YesNoType.yes; | ||
245 | } | ||
246 | |||
247 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.GetQueueProperties)) | ||
248 | { | ||
249 | queuePermission.GetQueueProperties = Msmq.YesNoType.yes; | ||
250 | } | ||
251 | |||
252 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.DeleteQueue)) | ||
253 | { | ||
254 | queuePermission.DeleteQueue = Msmq.YesNoType.yes; | ||
255 | } | ||
256 | |||
257 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.GetQueuePermissions)) | ||
258 | { | ||
259 | queuePermission.GetQueuePermissions = Msmq.YesNoType.yes; | ||
260 | } | ||
261 | |||
262 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.ChangeQueuePermissions)) | ||
263 | { | ||
264 | queuePermission.ChangeQueuePermissions = Msmq.YesNoType.yes; | ||
265 | } | ||
266 | |||
267 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.TakeQueueOwnership)) | ||
268 | { | ||
269 | queuePermission.TakeQueueOwnership = Msmq.YesNoType.yes; | ||
270 | } | ||
271 | |||
272 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.ReceiveMessage)) | ||
273 | { | ||
274 | queuePermission.ReceiveMessage = Msmq.YesNoType.yes; | ||
275 | } | ||
276 | |||
277 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.ReceiveJournalMessage)) | ||
278 | { | ||
279 | queuePermission.ReceiveJournalMessage = Msmq.YesNoType.yes; | ||
280 | } | ||
281 | |||
282 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.QueueGenericRead)) | ||
283 | { | ||
284 | queuePermission.QueueGenericRead = Msmq.YesNoType.yes; | ||
285 | } | ||
286 | |||
287 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.QueueGenericWrite)) | ||
288 | { | ||
289 | queuePermission.QueueGenericWrite = Msmq.YesNoType.yes; | ||
290 | } | ||
291 | |||
292 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.QueueGenericExecute)) | ||
293 | { | ||
294 | queuePermission.QueueGenericExecute = Msmq.YesNoType.yes; | ||
295 | } | ||
296 | |||
297 | if (0 != (attributes & (int)MsmqCompiler.MqiMessageQueuePermission.QueueGenericAll)) | ||
298 | { | ||
299 | queuePermission.QueueGenericAll = Msmq.YesNoType.yes; | ||
300 | } | ||
301 | } | ||
302 | } | ||
303 | } | ||
diff --git a/src/wixext/MsmqExtensionData.cs b/src/wixext/MsmqExtensionData.cs new file mode 100644 index 00000000..81d53ce7 --- /dev/null +++ b/src/wixext/MsmqExtensionData.cs | |||
@@ -0,0 +1,64 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensions | ||
4 | { | ||
5 | using System; | ||
6 | using System.Reflection; | ||
7 | using WixToolset.Data; | ||
8 | using WixToolset.Extensibility; | ||
9 | |||
10 | /// <summary> | ||
11 | /// The WiX Toolset MSMQ Extension. | ||
12 | /// </summary> | ||
13 | public sealed class MsmqExtensionData : ExtensionData | ||
14 | { | ||
15 | /// <summary> | ||
16 | /// Gets the default culture. | ||
17 | /// </summary> | ||
18 | /// <value>The default culture.</value> | ||
19 | public override string DefaultCulture | ||
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 | |||
46 | /// <summary> | ||
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 | { | ||
52 | return ExtensionData.LoadTableDefinitionHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.tables.xml"); | ||
53 | } | ||
54 | |||
55 | /// <summary> | ||
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 | { | ||
61 | return ExtensionData.LoadLibraryHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.msmq.wixlib", tableDefinitions); | ||
62 | } | ||
63 | } | ||
64 | } | ||
diff --git a/src/wixext/WixMsmqExtension.csproj b/src/wixext/WixMsmqExtension.csproj new file mode 100644 index 00000000..e37d62a3 --- /dev/null +++ b/src/wixext/WixMsmqExtension.csproj | |||
@@ -0,0 +1,49 @@ | |||
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/messages.xml b/src/wixext/messages.xml new file mode 100644 index 00000000..5ab6417f --- /dev/null +++ b/src/wixext/messages.xml | |||
@@ -0,0 +1,77 @@ | |||
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> | ||
diff --git a/src/wixext/msmq.xsd b/src/wixext/msmq.xsd new file mode 100644 index 00000000..26348330 --- /dev/null +++ b/src/wixext/msmq.xsd | |||
@@ -0,0 +1,121 @@ | |||
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 | <xs:schema xmlns:html="http://www.w3.org/1999/xhtml" | ||
6 | xmlns:wix="http://wixtoolset.org/schemas/v4/wxs" | ||
7 | xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
8 | xmlns:xse=" http://wixtoolset.org/schemas/XmlSchemaExtension" | ||
9 | targetNamespace="http://wixtoolset.org/schemas/v4/wxs/msmq" | ||
10 | xmlns="http://wixtoolset.org/schemas/v4/wxs/msmq"> | ||
11 | <xs:annotation> | ||
12 | <xs:documentation> | ||
13 | The source code schema for the WiX Toolset MSMQ Extension. | ||
14 | </xs:documentation> | ||
15 | </xs:annotation> | ||
16 | |||
17 | <xs:import namespace="http://wixtoolset.org/schemas/v4/wxs" /> | ||
18 | |||
19 | <xs:element name="MessageQueue"> | ||
20 | <xs:annotation><xs:documentation> | ||
21 | </xs:documentation> | ||
22 | <xs:appinfo> | ||
23 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" /> | ||
24 | </xs:appinfo> | ||
25 | </xs:annotation> | ||
26 | <xs:complexType> | ||
27 | <xs:sequence> | ||
28 | <xs:element ref="MessageQueuePermission" minOccurs="0" maxOccurs="unbounded" /> | ||
29 | </xs:sequence> | ||
30 | <xs:attribute name="Id" use="required" type="xs:string"> | ||
31 | <xs:annotation><xs:documentation> | ||
32 | </xs:documentation></xs:annotation> | ||
33 | </xs:attribute> | ||
34 | <xs:attribute name="Authenticate" use="optional" type="YesNoType"> | ||
35 | <xs:annotation><xs:documentation> | ||
36 | Default: No. | ||
37 | </xs:documentation></xs:annotation> | ||
38 | </xs:attribute> | ||
39 | <xs:attribute name="BasePriority" use="optional" type="xs:integer" /> | ||
40 | <xs:attribute name="Journal" use="optional" type="YesNoType"> | ||
41 | <xs:annotation><xs:documentation> | ||
42 | Default: No. | ||
43 | </xs:documentation></xs:annotation> | ||
44 | </xs:attribute> | ||
45 | <xs:attribute name="JournalQuota" use="optional" type="xs:integer" /> | ||
46 | <xs:attribute name="Label" use="required" type="xs:string" /> | ||
47 | <xs:attribute name="MulticastAddress" use="optional" type="xs:string" /> | ||
48 | <xs:attribute name="PathName" use="required" type="xs:string" /> | ||
49 | <xs:attribute name="PrivLevel" use="optional"> | ||
50 | <xs:simpleType> | ||
51 | <xs:restriction base="xs:NMTOKEN"> | ||
52 | <xs:enumeration value="none" /> | ||
53 | <xs:enumeration value="optional" /> | ||
54 | <xs:enumeration value="body" /> | ||
55 | </xs:restriction> | ||
56 | </xs:simpleType> | ||
57 | </xs:attribute> | ||
58 | <xs:attribute name="Quota" use="optional" type="xs:integer" /> | ||
59 | <xs:attribute name="Transactional" use="optional" type="YesNoType"> | ||
60 | <xs:annotation><xs:documentation> | ||
61 | Default: No. | ||
62 | </xs:documentation></xs:annotation> | ||
63 | </xs:attribute> | ||
64 | <xs:attribute name="ServiceTypeGuid" use="optional" type="xs:string" /> | ||
65 | </xs:complexType> | ||
66 | </xs:element> | ||
67 | |||
68 | <xs:element name="MessageQueuePermission"> | ||
69 | <xs:annotation><xs:documentation> | ||
70 | </xs:documentation> | ||
71 | <xs:appinfo> | ||
72 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" /> | ||
73 | </xs:appinfo> | ||
74 | </xs:annotation> | ||
75 | <xs:complexType> | ||
76 | <xs:attribute name="Id" use="required" type="xs:string"> | ||
77 | <xs:annotation><xs:documentation> | ||
78 | </xs:documentation></xs:annotation> | ||
79 | </xs:attribute> | ||
80 | <xs:attribute name="MessageQueue" use="optional" type="xs:string"> | ||
81 | <xs:annotation><xs:documentation> | ||
82 | </xs:documentation></xs:annotation> | ||
83 | </xs:attribute> | ||
84 | <xs:attribute name="User" use="optional" type="xs:string"> | ||
85 | <xs:annotation><xs:documentation> | ||
86 | </xs:documentation></xs:annotation> | ||
87 | </xs:attribute> | ||
88 | <xs:attribute name="Group" use="optional" type="xs:string"> | ||
89 | <xs:annotation><xs:documentation> | ||
90 | </xs:documentation></xs:annotation> | ||
91 | </xs:attribute> | ||
92 | <xs:attribute name="DeleteMessage" use="optional" type="YesNoType" /> | ||
93 | <xs:attribute name="PeekMessage" use="optional" type="YesNoType" /> | ||
94 | <xs:attribute name="WriteMessage" use="optional" type="YesNoType" /> | ||
95 | <xs:attribute name="DeleteJournalMessage" use="optional" type="YesNoType" /> | ||
96 | <xs:attribute name="SetQueueProperties" use="optional" type="YesNoType" /> | ||
97 | <xs:attribute name="GetQueueProperties" use="optional" type="YesNoType" /> | ||
98 | <xs:attribute name="DeleteQueue" use="optional" type="YesNoType" /> | ||
99 | <xs:attribute name="GetQueuePermissions" use="optional" type="YesNoType" /> | ||
100 | <xs:attribute name="ChangeQueuePermissions" use="optional" type="YesNoType" /> | ||
101 | <xs:attribute name="TakeQueueOwnership" use="optional" type="YesNoType" /> | ||
102 | <xs:attribute name="ReceiveMessage" use="optional" type="YesNoType" /> | ||
103 | <xs:attribute name="ReceiveJournalMessage" use="optional" type="YesNoType" /> | ||
104 | <xs:attribute name="QueueGenericRead" use="optional" type="YesNoType" /> | ||
105 | <xs:attribute name="QueueGenericWrite" use="optional" type="YesNoType" /> | ||
106 | <xs:attribute name="QueueGenericExecute" use="optional" type="YesNoType" /> | ||
107 | <xs:attribute name="QueueGenericAll" use="optional" type="YesNoType" /> | ||
108 | </xs:complexType> | ||
109 | </xs:element> | ||
110 | |||
111 | <xs:simpleType name="YesNoType"> | ||
112 | <xs:annotation> | ||
113 | <xs:documentation>Values of this type will either be "yes" or "no".</xs:documentation> | ||
114 | </xs:annotation> | ||
115 | <xs:restriction base="xs:NMTOKEN"> | ||
116 | <xs:enumeration value="no" /> | ||
117 | <xs:enumeration value="yes" /> | ||
118 | </xs:restriction> | ||
119 | </xs:simpleType> | ||
120 | |||
121 | </xs:schema> | ||
diff --git a/src/wixext/tables.xml b/src/wixext/tables.xml new file mode 100644 index 00000000..5fdd1fad --- /dev/null +++ b/src/wixext/tables.xml | |||
@@ -0,0 +1,54 @@ | |||
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 | <tableDefinitions xmlns="http://wixtoolset.org/schemas/v4/wi/tables"> | ||
6 | <tableDefinition name="MessageQueue" createSymbols="yes"> | ||
7 | <columnDefinition name="MessageQueue" type="string" length="72" primaryKey="yes" modularize="column" | ||
8 | category="identifier" description=""/> | ||
9 | <columnDefinition name="Component_" type="string" length="72" modularize="column" | ||
10 | keyTable="Component" keyColumn="1" category="identifier" description=""/> | ||
11 | <columnDefinition name="BasePriority" type="number" length="4" nullable="yes" | ||
12 | description=""/> | ||
13 | <columnDefinition name="JournalQuota" type="number" length="4" nullable="yes" | ||
14 | description=""/> | ||
15 | <columnDefinition name="Label" type="localized" length="255" modularize="property" escapeIdtCharacters="yes" | ||
16 | category="formatted" description=""/> | ||
17 | <columnDefinition name="MulticastAddress" type="string" length="255" nullable="yes" modularize="property" | ||
18 | category="formatted" description=""/> | ||
19 | <columnDefinition name="PathName" type="string" length="255" modularize="property" | ||
20 | category="formatted" description=""/> | ||
21 | <columnDefinition name="PrivLevel" type="number" length="4" nullable="yes" | ||
22 | description=""/> | ||
23 | <columnDefinition name="Quota" type="number" length="4" nullable="yes" | ||
24 | description=""/> | ||
25 | <columnDefinition name="ServiceTypeGuid" type="string" length="72" nullable="yes" modularize="property" | ||
26 | category="formatted" description=""/> | ||
27 | <columnDefinition name="Attributes" type="number" length="4" | ||
28 | description=""/> | ||
29 | </tableDefinition> | ||
30 | <tableDefinition name="MessageQueueUserPermission" createSymbols="yes"> | ||
31 | <columnDefinition name="MessageQueueUserPermission" type="string" length="72" primaryKey="yes" modularize="column" | ||
32 | category="identifier" description=""/> | ||
33 | <columnDefinition name="Component_" type="string" length="72" modularize="column" | ||
34 | keyTable="Component" keyColumn="1" category="identifier" description=""/> | ||
35 | <columnDefinition name="MessageQueue_" type="string" length="72" modularize="column" | ||
36 | keyTable="MessageQueue" keyColumn="1" category="identifier" description=""/> | ||
37 | <columnDefinition name="User_" type="string" length="72" modularize="column" | ||
38 | category="identifier" description=""/> | ||
39 | <columnDefinition name="Permissions" type="number" length="4" | ||
40 | description=""/> | ||
41 | </tableDefinition> | ||
42 | <tableDefinition name="MessageQueueGroupPermission" createSymbols="yes"> | ||
43 | <columnDefinition name="MessageQueueGroupPermission" type="string" length="72" primaryKey="yes" modularize="column" | ||
44 | category="identifier" description=""/> | ||
45 | <columnDefinition name="Component_" type="string" length="72" modularize="column" | ||
46 | keyTable="Component" keyColumn="1" category="identifier" description=""/> | ||
47 | <columnDefinition name="MessageQueue_" type="string" length="72" modularize="column" | ||
48 | keyTable="MessageQueue" keyColumn="1" category="identifier" description=""/> | ||
49 | <columnDefinition name="Group_" type="string" length="72" modularize="column" | ||
50 | category="identifier" description=""/> | ||
51 | <columnDefinition name="Permissions" type="number" length="4" | ||
52 | description=""/> | ||
53 | </tableDefinition> | ||
54 | </tableDefinitions> | ||