aboutsummaryrefslogtreecommitdiff
path: root/src/ext/Iis/wixext
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext/Iis/wixext')
-rw-r--r--src/ext/Iis/wixext/IIsCompiler.cs2620
-rw-r--r--src/ext/Iis/wixext/IIsDecompiler.cs1549
-rw-r--r--src/ext/Iis/wixext/IIsExtensionData.cs30
-rw-r--r--src/ext/Iis/wixext/IisErrors.cs78
-rw-r--r--src/ext/Iis/wixext/IisExtensionFactory.cs18
-rw-r--r--src/ext/Iis/wixext/IisTableDefinitions.cs324
-rw-r--r--src/ext/Iis/wixext/IisWindowsInstallerBackendBinderExtension.cs13
-rw-r--r--src/ext/Iis/wixext/Symbols/CertificateHashSymbol.cs55
-rw-r--r--src/ext/Iis/wixext/Symbols/CertificateSymbol.cs103
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsAppPoolSymbol.cs159
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsFilterSymbol.cs95
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsHttpHeaderSymbol.cs95
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsMimeMapSymbol.cs71
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsPropertySymbol.cs63
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsWebAddressSymbol.cs79
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsWebApplicationExtensionSymbol.cs79
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsWebApplicationSymbol.cs127
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsWebDirPropertiesSymbol.cs151
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsWebDirSymbol.cs79
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsWebErrorSymbol.cs87
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsWebLogSymbol.cs47
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsWebServiceExtensionSymbol.cs79
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsWebSiteCertificatesSymbol.cs55
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsWebSiteSymbol.cs135
-rw-r--r--src/ext/Iis/wixext/Symbols/IIsWebVirtualDirSymbol.cs87
-rw-r--r--src/ext/Iis/wixext/Symbols/IisSymbolDefinitions.cs107
-rw-r--r--src/ext/Iis/wixext/WixToolset.Iis.wixext.csproj31
-rw-r--r--src/ext/Iis/wixext/WixToolset.Iis.wixext.targets11
28 files changed, 6427 insertions, 0 deletions
diff --git a/src/ext/Iis/wixext/IIsCompiler.cs b/src/ext/Iis/wixext/IIsCompiler.cs
new file mode 100644
index 00000000..cb573ad1
--- /dev/null
+++ b/src/ext/Iis/wixext/IIsCompiler.cs
@@ -0,0 +1,2620 @@
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.Iis
4{
5 using System;
6 using System.Collections.Generic;
7 using System.Globalization;
8 using System.Xml.Linq;
9 using WixToolset.Data;
10 using WixToolset.Extensibility;
11 using WixToolset.Extensibility.Data;
12 using WixToolset.Iis.Symbols;
13
14 /// <summary>
15 /// The compiler for the WiX Toolset Internet Information Services Extension.
16 /// </summary>
17 public sealed class IIsCompiler : BaseCompilerExtension
18 {
19 public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/iis";
20
21 /// <summary>
22 /// Types of objects that custom HTTP Headers can be applied to.
23 /// </summary>
24 /// <remarks>Note that this must be kept in sync with the eHttpHeaderParentType in scahttpheader.h.</remarks>
25 private enum HttpHeaderParentType
26 {
27 /// <summary>Custom HTTP Header is to be applied to a Web Virtual Directory.</summary>
28 WebVirtualDir = 1,
29 /// <summary>Custom HTTP Header is to be applied to a Web Site.</summary>
30 WebSite = 2,
31 }
32
33 /// <summary>
34 /// Types of objects that MimeMaps can be applied to.
35 /// </summary>
36 /// <remarks>Note that this must be kept in sync with the eMimeMapParentType in scamimemap.h.</remarks>
37 private enum MimeMapParentType
38 {
39 /// <summary>MimeMap is to be applied to a Web Virtual Directory.</summary>
40 WebVirtualDir = 1,
41 WebSite = 2,
42 }
43
44 /// <summary>
45 /// Types of objects that custom WebErrors can be applied to.
46 /// </summary>
47 /// <remarks>Note that this must be kept in sync with the eWebErrorParentType in scaweberror.h.</remarks>
48 private enum WebErrorParentType
49 {
50 /// <summary>Custom WebError is to be applied to a Web Virtual Directory.</summary>
51 WebVirtualDir = 1,
52
53 /// <summary>Custom WebError is to be applied to a Web Site.</summary>
54 WebSite = 2,
55 }
56
57 /// <summary>
58 /// Processes an element for the Compiler.
59 /// </summary>
60 /// <param name="sourceLineNumbers">Source line number for the parent element.</param>
61 /// <param name="parentElement">Parent element of element to process.</param>
62 /// <param name="element">Element to process.</param>
63 /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param>
64 public override void ParseElement(Intermediate intermediate, IntermediateSection section, XElement parentElement, XElement element, IDictionary<string, string> context)
65 {
66 switch (parentElement.Name.LocalName)
67 {
68 case "Component":
69 var componentId = context["ComponentId"];
70 var directoryId = context["DirectoryId"];
71
72 switch (element.Name.LocalName)
73 {
74 case "Certificate":
75 this.ParseCertificateElement(intermediate, section, element, componentId);
76 break;
77 case "WebAppPool":
78 this.ParseWebAppPoolElement(intermediate, section, element, componentId);
79 break;
80 case "WebDir":
81 this.ParseWebDirElement(intermediate, section, element, componentId, null);
82 break;
83 case "WebFilter":
84 this.ParseWebFilterElement(intermediate, section, element, componentId, null);
85 break;
86 case "WebProperty":
87 this.ParseWebPropertyElement(intermediate, section, element, componentId);
88 break;
89 case "WebServiceExtension":
90 this.ParseWebServiceExtensionElement(intermediate, section, element, componentId);
91 break;
92 case "WebSite":
93 this.ParseWebSiteElement(intermediate, section, element, componentId);
94 break;
95 case "WebVirtualDir":
96 this.ParseWebVirtualDirElement(intermediate, section, element, componentId, null, null);
97 break;
98 default:
99 this.ParseHelper.UnexpectedElement(parentElement, element);
100 break;
101 }
102 break;
103 case "Fragment":
104 case "Module":
105 case "Package":
106 switch (element.Name.LocalName)
107 {
108 case "WebApplication":
109 this.ParseWebApplicationElement(intermediate, section, element);
110 break;
111 case "WebAppPool":
112 this.ParseWebAppPoolElement(intermediate, section, element, null);
113 break;
114 case "WebDirProperties":
115 this.ParseWebDirPropertiesElement(intermediate, section, element, null);
116 break;
117 case "WebLog":
118 this.ParseWebLogElement(intermediate, section, element);
119 break;
120 case "WebSite":
121 this.ParseWebSiteElement(intermediate, section, element, null);
122 break;
123 default:
124 this.ParseHelper.UnexpectedElement(parentElement, element);
125 break;
126 }
127 break;
128 default:
129 this.ParseHelper.UnexpectedElement(parentElement, element);
130 break;
131 }
132 }
133
134 /// <summary>
135 /// Parses a certificate element.
136 /// </summary>
137 /// <param name="element">Element to parse.</param>
138 /// <param name="componentId">Identifier for parent component.</param>
139 private void ParseCertificateElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
140 {
141 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
142 Identifier id = null;
143 int attributes = 8; // SCA_CERT_ATTRIBUTE_VITAL
144 string binaryRef = null;
145 string certificatePath = null;
146 string name = null;
147 string pfxPassword = null;
148 int storeLocation = 0;
149 string storeName = null;
150
151 foreach (var attrib in element.Attributes())
152 {
153 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
154 {
155 switch (attrib.Name.LocalName)
156 {
157 case "Id":
158 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
159 break;
160 case "BinaryRef":
161 attributes |= 2; // SCA_CERT_ATTRIBUTE_BINARYDATA
162 binaryRef = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
163 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.Binary, binaryRef);
164 break;
165 case "CertificatePath":
166 certificatePath = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
167 break;
168 case "Name":
169 name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
170 break;
171 case "Overwrite":
172 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
173 {
174 attributes |= 4; // SCA_CERT_ATTRIBUTE_OVERWRITE
175 }
176 else
177 {
178 attributes &= ~4; // SCA_CERT_ATTRIBUTE_OVERWRITE
179 }
180 break;
181 case "PFXPassword":
182 pfxPassword = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
183 break;
184 case "Request":
185 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
186 {
187 attributes |= 1; // SCA_CERT_ATTRIBUTE_REQUEST
188 }
189 else
190 {
191 attributes &= ~1; // SCA_CERT_ATTRIBUTE_REQUEST
192 }
193 break;
194 case "StoreLocation":
195 var storeLocationValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
196 if (0 < storeLocationValue.Length)
197 {
198 switch (storeLocationValue)
199 {
200 case "currentUser":
201 storeLocation = 1; // SCA_CERTSYSTEMSTORE_CURRENTUSER
202 break;
203 case "localMachine":
204 storeLocation = 2; // SCA_CERTSYSTEMSTORE_LOCALMACHINE
205 break;
206 default:
207 storeLocation = -1;
208 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "StoreLocation", storeLocationValue, "currentUser", "localMachine"));
209 break;
210 }
211 }
212 break;
213 case "StoreName":
214 var storeNameValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
215 if (0 < storeNameValue.Length)
216 {
217 switch (storeNameValue)
218 {
219 case "ca":
220 storeName = "CA";
221 break;
222 case "my":
223 case "personal":
224 storeName = "MY";
225 break;
226 case "request":
227 storeName = "REQUEST";
228 break;
229 case "root":
230 storeName = "Root";
231 break;
232 case "otherPeople":
233 storeName = "AddressBook";
234 break;
235 case "trustedPeople":
236 storeName = "TrustedPeople";
237 break;
238 case "trustedPublisher":
239 storeName = "TrustedPublisher";
240 break;
241 default:
242 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "StoreName", storeNameValue, "ca", "my", "request", "root", "otherPeople", "trustedPeople", "trustedPublisher"));
243 break;
244 }
245 }
246 break;
247 case "Vital":
248 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
249 {
250 attributes |= 8; // SCA_CERT_ATTRIBUTE_VITAL
251 }
252 else
253 {
254 attributes &= ~8; // SCA_CERT_ATTRIBUTE_VITAL
255 }
256 break;
257 default:
258 this.ParseHelper.UnexpectedAttribute(element, attrib);
259 break;
260 }
261 }
262 else
263 {
264 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
265 }
266 }
267
268
269 if (null == id)
270 {
271 id = this.ParseHelper.CreateIdentifier("crt", componentId, binaryRef, certificatePath);
272 }
273
274 if (null == name)
275 {
276 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
277 }
278
279 if (0 == storeLocation)
280 {
281 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "StoreLocation"));
282 }
283
284 if (null == storeName)
285 {
286 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "StoreName"));
287 }
288
289 if (null != binaryRef && null != certificatePath)
290 {
291 this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, "BinaryRef", "CertificatePath", certificatePath));
292 }
293 else if (null == binaryRef && null == certificatePath)
294 {
295 this.Messaging.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, element.Name.LocalName, "BinaryRef", "CertificatePath"));
296 }
297
298 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
299
300 // Reference InstallCertificates and UninstallCertificates since nothing will happen without them
301 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "Wix4InstallCertificates", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM64);
302 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "Wix4UninstallCertificates", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM64);
303 this.ParseHelper.EnsureTable(section, sourceLineNumbers, IisTableDefinitions.CertificateHash); // Certificate CustomActions require the CertificateHash table
304
305 if (!this.Messaging.EncounteredError)
306 {
307 section.AddSymbol(new CertificateSymbol(sourceLineNumbers, id)
308 {
309 ComponentRef = componentId,
310 Name = name,
311 StoreLocation = storeLocation,
312 StoreName = storeName,
313 Attributes = attributes,
314 BinaryRef = binaryRef,
315 CertificatePath = certificatePath,
316 PFXPassword = pfxPassword,
317 });
318 }
319 }
320
321 /// <summary>
322 /// Parses a CertificateRef extension element.
323 /// </summary>
324 /// <param name="element">Element to parse.</param>
325 /// <param name="webId">Identifier for parent web site.</param>
326 private void ParseCertificateRefElement(Intermediate intermediate, IntermediateSection section, XElement element, string webId)
327 {
328 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
329 Identifier id = null;
330
331 foreach (var attrib in element.Attributes())
332 {
333 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
334 {
335 switch (attrib.Name.LocalName)
336 {
337 case "Id":
338 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
339 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.Certificate, id.Id);
340 break;
341 default:
342 this.ParseHelper.UnexpectedAttribute(element, attrib);
343 break;
344 }
345 }
346 else
347 {
348 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
349 }
350 }
351
352 if (null == id)
353 {
354 id = this.ParseHelper.CreateIdentifier("wsc", webId);
355 }
356
357 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
358
359 if (!this.Messaging.EncounteredError)
360 {
361 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.Certificate, id.Id);
362
363 section.AddSymbol(new IIsWebSiteCertificatesSymbol(sourceLineNumbers)
364 {
365 WebRef = webId,
366 CertificateRef = id.Id,
367 });
368 }
369 }
370
371 /// <summary>
372 /// Parses a mime map element.
373 /// </summary>
374 /// <param name="element">Element to parse.</param>
375 /// <param name="parentId">Identifier for parent symbol.</param>
376 /// <param name="parentType">Type that parentId refers to.</param>
377 private void ParseMimeMapElement(Intermediate intermediate, IntermediateSection section, XElement element, string parentId, MimeMapParentType parentType)
378 {
379 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
380 Identifier id = null;
381 string extension = null;
382 string type = null;
383
384 foreach (var attrib in element.Attributes())
385 {
386 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
387 {
388 switch (attrib.Name.LocalName)
389 {
390 case "Id":
391 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
392 break;
393 case "Extension":
394 extension = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
395 break;
396 case "Type":
397 type = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
398 break;
399 default:
400 this.ParseHelper.UnexpectedAttribute(element, attrib);
401 break;
402 }
403 }
404 else
405 {
406 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
407 }
408 }
409
410 if (null == id)
411 {
412 id = this.ParseHelper.CreateIdentifier("imm", parentId, type, extension);
413 }
414
415 if (null == extension)
416 {
417 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Extension"));
418 }
419 else if (0 < extension.Length)
420 {
421 if (!extension.StartsWith(".", StringComparison.Ordinal))
422 {
423 this.Messaging.Write(IIsErrors.MimeMapExtensionMissingPeriod(sourceLineNumbers, element.Name.LocalName, "Extension", extension));
424 }
425 }
426
427 if (null == type)
428 {
429 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Type"));
430 }
431
432 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
433
434 if (!this.Messaging.EncounteredError)
435 {
436 section.AddSymbol(new IIsMimeMapSymbol(sourceLineNumbers, id)
437 {
438 ParentType = (int)parentType,
439 ParentValue = parentId,
440 MimeType = type,
441 Extension = extension,
442 });
443 }
444 }
445
446 /// <summary>
447 /// Parses a recycle time element.
448 /// </summary>
449 /// <param name="element">Element to parse.</param>
450 /// <returns>Recycle time value.</returns>
451 private string ParseRecycleTimeElement(Intermediate intermediate, IntermediateSection section, XElement element)
452 {
453 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
454 string value = null;
455
456 foreach (var attrib in element.Attributes())
457 {
458 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
459 {
460 switch (attrib.Name.LocalName)
461 {
462 case "Value":
463 value = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
464 break;
465 default:
466 this.ParseHelper.UnexpectedAttribute(element, attrib);
467 break;
468 }
469 }
470 else
471 {
472 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
473 }
474 }
475
476 if (null == value)
477 {
478 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Value"));
479 }
480
481 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
482
483 return value;
484 }
485
486 /// <summary>
487 /// Parses a web address element.
488 /// </summary>
489 /// <param name="element">Element to parse.</param>
490 /// <param name="parentWeb">Identifier of parent web site.</param>
491 /// <returns>Identifier for web address.</returns>
492 private string ParseWebAddressElement(Intermediate intermediate, IntermediateSection section, XElement element, string parentWeb)
493 {
494 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
495 Identifier id = null;
496 string header = null;
497 string ip = null;
498 string port = null;
499 var secure = false;
500
501 foreach (var attrib in element.Attributes())
502 {
503 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
504 {
505 switch (attrib.Name.LocalName)
506 {
507 case "Id":
508 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
509 break;
510 case "Header":
511 header = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
512 break;
513 case "IP":
514 ip = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
515 break;
516 case "Port":
517 port = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
518 break;
519 case "Secure":
520 secure = YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
521 break;
522 default:
523 this.ParseHelper.UnexpectedAttribute(element, attrib);
524 break;
525 }
526 }
527 else
528 {
529 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
530 }
531 }
532
533 if (null == id)
534 {
535 id = this.ParseHelper.CreateIdentifier("iwa", parentWeb, ip, port);
536 }
537
538 if (null == port)
539 {
540 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Port"));
541 }
542
543 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
544
545 if (!this.Messaging.EncounteredError)
546 {
547 section.AddSymbol(new IIsWebAddressSymbol(sourceLineNumbers, id)
548 {
549 WebRef = parentWeb,
550 IP = ip,
551 Port = port,
552 Header = header,
553 Secure = secure ? 1 : 0,
554 });
555 }
556
557 return id?.Id;
558 }
559
560 /// <summary>
561 /// Parses a web application element.
562 /// </summary>
563 /// <param name="element">Element to parse.</param>
564 /// <returns>Identifier for web application.</returns>
565 private string ParseWebApplicationElement(Intermediate intermediate, IntermediateSection section, XElement element)
566 {
567 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
568 Identifier id = null;
569 var allowSessions = YesNoDefaultType.Default;
570 string appPool = null;
571 var buffer = YesNoDefaultType.Default;
572 var clientDebugging = YesNoDefaultType.Default;
573 string defaultScript = null;
574 int isolation = 0;
575 string name = null;
576 var parentPaths = YesNoDefaultType.Default;
577 var scriptTimeout = CompilerConstants.IntegerNotSet;
578 var sessionTimeout = CompilerConstants.IntegerNotSet;
579 var serverDebugging = YesNoDefaultType.Default;
580
581 foreach (var attrib in element.Attributes())
582 {
583 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
584 {
585 switch (attrib.Name.LocalName)
586 {
587 case "Id":
588 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
589 break;
590 case "AllowSessions":
591 allowSessions = this.ParseHelper.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib);
592 break;
593 case "Buffer":
594 buffer = this.ParseHelper.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib);
595 break;
596 case "ClientDebugging":
597 clientDebugging = this.ParseHelper.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib);
598 break;
599 case "DefaultScript":
600 defaultScript = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
601 if (0 < defaultScript.Length)
602 {
603 switch (defaultScript)
604 {
605 case "JScript":
606 case "VBScript":
607 // these are valid values
608 break;
609 default:
610 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, defaultScript, "JScript", "VBScript"));
611 break;
612 }
613 }
614 break;
615 case "Isolation":
616 string isolationValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
617 if (0 < isolationValue.Length)
618 {
619 switch (isolationValue)
620 {
621 case "low":
622 isolation = 0;
623 break;
624 case "medium":
625 isolation = 2;
626 break;
627 case "high":
628 isolation = 1;
629 break;
630 default:
631 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, isolationValue, "low", "medium", "high"));
632 break;
633 }
634 }
635 break;
636 case "Name":
637 name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
638 break;
639 case "ParentPaths":
640 parentPaths = this.ParseHelper.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib);
641 break;
642 case "ScriptTimeout":
643 scriptTimeout = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue);
644 break;
645 case "ServerDebugging":
646 serverDebugging = this.ParseHelper.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib);
647 break;
648 case "SessionTimeout":
649 sessionTimeout = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue);
650 break;
651 case "WebAppPool":
652 appPool = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
653 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.IIsAppPool, appPool);
654 break;
655 default:
656 this.ParseHelper.UnexpectedAttribute(element, attrib);
657 break;
658 }
659 }
660 else
661 {
662 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
663 }
664 }
665
666 if (null == id)
667 {
668 id = this.ParseHelper.CreateIdentifier("wap", name, appPool);
669 }
670
671 if (null == name)
672 {
673 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
674 }
675 else if (-1 != name.IndexOf("\\", StringComparison.Ordinal))
676 {
677 this.Messaging.Write(IIsErrors.IllegalCharacterInAttributeValue(sourceLineNumbers, element.Name.LocalName, "Name", name, '\\'));
678 }
679
680 foreach (var child in element.Elements())
681 {
682 if (this.Namespace == child.Name.Namespace)
683 {
684 switch (child.Name.LocalName)
685 {
686 case "WebApplicationExtension":
687 this.ParseWebApplicationExtensionElement(intermediate, section, child, id?.Id);
688 break;
689 default:
690 this.ParseHelper.UnexpectedElement(element, child);
691 break;
692 }
693 }
694 else
695 {
696 this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child);
697 }
698 }
699
700 if (!this.Messaging.EncounteredError)
701 {
702 var symbol = section.AddSymbol(new IIsWebApplicationSymbol(sourceLineNumbers, id)
703 {
704 Name = name,
705 Isolation = isolation,
706 DefaultScript = defaultScript,
707 AppPoolRef = appPool,
708 });
709
710 if (YesNoDefaultType.Default != allowSessions)
711 {
712 symbol.AllowSessions = YesNoDefaultType.Yes == allowSessions ? 1 : 0;
713 }
714
715 if (CompilerConstants.IntegerNotSet != sessionTimeout)
716 {
717 symbol.SessionTimeout = sessionTimeout;
718 }
719
720 if (YesNoDefaultType.Default != buffer)
721 {
722 symbol.Buffer = YesNoDefaultType.Yes == buffer ? 1 : 0;
723 }
724
725 if (YesNoDefaultType.Default != parentPaths)
726 {
727 symbol.ParentPaths = YesNoDefaultType.Yes == parentPaths ? 1 : 0;
728 }
729
730 if (CompilerConstants.IntegerNotSet != scriptTimeout)
731 {
732 symbol.ScriptTimeout = scriptTimeout;
733 }
734
735 if (YesNoDefaultType.Default != serverDebugging)
736 {
737 symbol.ServerDebugging = YesNoDefaultType.Yes == serverDebugging ? 1 : 0;
738 }
739
740 if (YesNoDefaultType.Default != clientDebugging)
741 {
742 symbol.ClientDebugging = YesNoDefaultType.Yes == clientDebugging ? 1 : 0;
743 }
744 }
745
746 return id?.Id;
747 }
748
749 /// <summary>
750 /// Parses a web application extension element.
751 /// </summary>
752 /// <param name="element">Element to parse.</param>
753 /// <param name="application">Identifier for parent web application.</param>
754 private void ParseWebApplicationExtensionElement(Intermediate intermediate, IntermediateSection section, XElement element, string application)
755 {
756 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
757 int attributes = 0;
758 string executable = null;
759 string extension = null;
760 string verbs = null;
761
762 foreach (var attrib in element.Attributes())
763 {
764 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
765 {
766 switch (attrib.Name.LocalName)
767 {
768 case "CheckPath":
769 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
770 {
771 attributes |= 4;
772 }
773 else
774 {
775 attributes &= ~4;
776 }
777 break;
778 case "Executable":
779 executable = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
780 break;
781 case "Extension":
782 extension = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
783 break;
784 case "Script":
785 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
786 {
787 attributes |= 1;
788 }
789 else
790 {
791 attributes &= ~1;
792 }
793 break;
794 case "Verbs":
795 verbs = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
796 break;
797 default:
798 this.ParseHelper.UnexpectedAttribute(element, attrib);
799 break;
800 }
801 }
802 else
803 {
804 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
805 }
806 }
807
808 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
809
810 if (!this.Messaging.EncounteredError)
811 {
812 var symbol = section.AddSymbol(new IIsWebApplicationExtensionSymbol(sourceLineNumbers)
813 {
814 ApplicationRef = application,
815 Extension = extension,
816 Verbs = verbs,
817 Executable = executable,
818 });
819
820 if (0 < attributes)
821 {
822 symbol.Attributes = attributes;
823 }
824 }
825 }
826
827 /// <summary>
828 /// Parses web application pool element.
829 /// </summary>
830 /// <param name="element">Element to parse.</param>
831 /// <param name="componentId">Optional identifier of parent component.</param>
832 private void ParseWebAppPoolElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
833 {
834 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
835 Identifier id = null;
836 int attributes = 0;
837 var cpuAction = CompilerConstants.IntegerNotSet;
838 string cpuMon = null;
839 var idleTimeout = CompilerConstants.IntegerNotSet;
840 int maxCpuUsage = 0;
841 var maxWorkerProcs = CompilerConstants.IntegerNotSet;
842 string managedRuntimeVersion = null;
843 string managedPipelineMode = null;
844 string name = null;
845 var privateMemory = CompilerConstants.IntegerNotSet;
846 var queueLimit = CompilerConstants.IntegerNotSet;
847 var recycleMinutes = CompilerConstants.IntegerNotSet;
848 var recycleRequests = CompilerConstants.IntegerNotSet;
849 string recycleTimes = null;
850 var refreshCpu = CompilerConstants.IntegerNotSet;
851 string user = null;
852 var virtualMemory = CompilerConstants.IntegerNotSet;
853
854 foreach (var attrib in element.Attributes())
855 {
856 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
857 {
858 switch (attrib.Name.LocalName)
859 {
860 case "Id":
861 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
862 break;
863 case "CpuAction":
864 if (null == componentId)
865 {
866 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
867 }
868
869 var cpuActionValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
870 if (0 < cpuActionValue.Length)
871 {
872 switch (cpuActionValue)
873 {
874 case "shutdown":
875 cpuAction = 1;
876 break;
877 case "none":
878 cpuAction = 0;
879 break;
880 default:
881 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, cpuActionValue, "shutdown", "none"));
882 break;
883 }
884 }
885 break;
886 case "Identity":
887 if (null == componentId)
888 {
889 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
890 }
891
892 var identityValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
893 if (0 < identityValue.Length)
894 {
895 switch (identityValue)
896 {
897 case "networkService":
898 attributes |= 1;
899 break;
900 case "localService":
901 attributes |= 2;
902 break;
903 case "localSystem":
904 attributes |= 4;
905 break;
906 case "other":
907 attributes |= 8;
908 break;
909 case "applicationPoolIdentity":
910 attributes |= 0x10;
911 break;
912 default:
913 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, identityValue, "networkService", "localService", "localSystem", "other", "applicationPoolIdentity"));
914 break;
915 }
916 }
917 break;
918 case "IdleTimeout":
919 if (null == componentId)
920 {
921 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
922 }
923
924 idleTimeout = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue);
925 break;
926 case "ManagedPipelineMode":
927 if (null == componentId)
928 {
929 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
930 }
931
932 managedPipelineMode = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
933
934
935 if (!String.IsNullOrEmpty(managedPipelineMode))
936 {
937 switch (managedPipelineMode)
938 {
939 // In 3.5 we allowed lower case values (per camel case enum style), we now use formatted fields,
940 // so the value needs to match exactly what we pass in to IIS which uses pascal case.
941 case "classic":
942 managedPipelineMode = "Classic";
943 break;
944 case "integrated":
945 managedPipelineMode = "Integrated";
946 break;
947 case "Classic":
948 break;
949 case "Integrated":
950 break;
951 default:
952 if (!this.ParseHelper.ContainsProperty(managedPipelineMode))
953 {
954 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName, managedPipelineMode, "Classic", "Integrated"));
955 }
956 break;
957 }
958 }
959
960 break;
961 case "ManagedRuntimeVersion":
962 if (null == componentId)
963 {
964 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
965 }
966
967 managedRuntimeVersion = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
968 break;
969 case "MaxCpuUsage":
970 if (null == componentId)
971 {
972 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
973 }
974
975 maxCpuUsage = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, 100);
976 break;
977 case "MaxWorkerProcesses":
978 if (null == componentId)
979 {
980 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
981 }
982
983 maxWorkerProcs = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue);
984 break;
985 case "Name":
986 name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
987 break;
988 case "PrivateMemory":
989 if (null == componentId)
990 {
991 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
992 }
993
994 privateMemory = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, 4294967);
995 break;
996 case "QueueLimit":
997 if (null == componentId)
998 {
999 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
1000 }
1001
1002 queueLimit = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue);
1003 break;
1004 case "RecycleMinutes":
1005 if (null == componentId)
1006 {
1007 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
1008 }
1009
1010 recycleMinutes = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue);
1011 break;
1012 case "RecycleRequests":
1013 if (null == componentId)
1014 {
1015 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
1016 }
1017
1018 recycleRequests = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue);
1019 break;
1020 case "RefreshCpu":
1021 if (null == componentId)
1022 {
1023 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
1024 }
1025
1026 refreshCpu = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue);
1027 break;
1028 case "User":
1029 if (null == componentId)
1030 {
1031 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
1032 }
1033
1034 user = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1035 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "User", user);
1036 break;
1037 case "VirtualMemory":
1038 if (null == componentId)
1039 {
1040 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
1041 }
1042
1043 virtualMemory = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, 4294967);
1044 break;
1045 default:
1046 this.ParseHelper.UnexpectedAttribute(element, attrib);
1047 break;
1048 }
1049 }
1050 else
1051 {
1052 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1053 }
1054 }
1055
1056 if (null == id)
1057 {
1058 id = this.ParseHelper.CreateIdentifier("iap", name, componentId, user);
1059 }
1060
1061 if (null == name)
1062 {
1063 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
1064 }
1065
1066 if (null == user && 8 == (attributes & 0x1F))
1067 {
1068 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "User", "Identity", "other"));
1069 }
1070
1071 if (null != user && 8 != (attributes & 0x1F))
1072 {
1073 this.Messaging.Write(ErrorMessages.IllegalAttributeValueWithoutOtherAttribute(sourceLineNumbers, element.Name.LocalName, "User", user, "Identity", "other"));
1074 }
1075
1076 cpuMon = maxCpuUsage.ToString(CultureInfo.InvariantCulture.NumberFormat);
1077 if (CompilerConstants.IntegerNotSet != refreshCpu)
1078 {
1079 cpuMon = String.Concat(cpuMon, ",", refreshCpu.ToString(CultureInfo.InvariantCulture.NumberFormat));
1080 if (CompilerConstants.IntegerNotSet != cpuAction)
1081 {
1082 cpuMon = String.Concat(cpuMon, ",", cpuAction.ToString(CultureInfo.InvariantCulture.NumberFormat));
1083 }
1084 }
1085
1086 foreach (var child in element.Elements())
1087 {
1088 if (this.Namespace == child.Name.Namespace)
1089 {
1090 switch (child.Name.LocalName)
1091 {
1092 case "RecycleTime":
1093 if (null == componentId)
1094 {
1095 var childSourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(child);
1096 this.Messaging.Write(IIsErrors.IllegalElementWithoutComponent(childSourceLineNumbers, element.Name.LocalName));
1097 }
1098
1099 if (null == recycleTimes)
1100 {
1101 recycleTimes = this.ParseRecycleTimeElement(intermediate, section, child);
1102 }
1103 else
1104 {
1105 recycleTimes = String.Concat(recycleTimes, ",", this.ParseRecycleTimeElement(intermediate, section, child));
1106 }
1107 break;
1108 default:
1109 this.ParseHelper.UnexpectedElement(element, child);
1110 break;
1111 }
1112 }
1113 else
1114 {
1115 this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child);
1116 }
1117 }
1118
1119 if (null != componentId)
1120 {
1121 // Reference ConfigureIIs since nothing will happen without it
1122 this.AddReferenceToConfigureIIs(section, sourceLineNumbers);
1123 }
1124
1125 if (!this.Messaging.EncounteredError)
1126 {
1127 var symbol = section.AddSymbol(new IIsAppPoolSymbol(sourceLineNumbers, id)
1128 {
1129 Name = name,
1130 ComponentRef = componentId,
1131 Attributes = attributes,
1132 UserRef = user,
1133 RecycleTimes = recycleTimes,
1134 CPUMon = cpuMon,
1135 ManagedRuntimeVersion = managedRuntimeVersion,
1136 ManagedPipelineMode = managedPipelineMode,
1137 });
1138
1139 if (CompilerConstants.IntegerNotSet != recycleMinutes)
1140 {
1141 symbol.RecycleMinutes = recycleMinutes;
1142 }
1143
1144 if (CompilerConstants.IntegerNotSet != recycleRequests)
1145 {
1146 symbol.RecycleRequests = recycleRequests;
1147 }
1148
1149 if (CompilerConstants.IntegerNotSet != idleTimeout)
1150 {
1151 symbol.IdleTimeout = idleTimeout;
1152 }
1153
1154 if (CompilerConstants.IntegerNotSet != queueLimit)
1155 {
1156 symbol.QueueLimit = queueLimit;
1157 }
1158
1159 if (CompilerConstants.IntegerNotSet != maxWorkerProcs)
1160 {
1161 symbol.MaxProc = maxWorkerProcs;
1162 }
1163
1164 if (CompilerConstants.IntegerNotSet != virtualMemory)
1165 {
1166 symbol.VirtualMemory = virtualMemory;
1167 }
1168
1169 if (CompilerConstants.IntegerNotSet != privateMemory)
1170 {
1171 symbol.PrivateMemory = privateMemory;
1172 }
1173 }
1174 }
1175
1176 /// <summary>
1177 /// Parses a web directory element.
1178 /// </summary>
1179 /// <param name="element">Element to parse.</param>
1180 /// <param name="componentId">Identifier for parent component.</param>
1181 /// <param name="parentWeb">Optional identifier for parent web site.</param>
1182 private void ParseWebDirElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string parentWeb)
1183 {
1184 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1185 Identifier id = null;
1186 string dirProperties = null;
1187 string path = null;
1188 string application = null;
1189
1190 foreach (var attrib in element.Attributes())
1191 {
1192 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1193 {
1194 switch (attrib.Name.LocalName)
1195 {
1196 case "Id":
1197 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
1198 break;
1199 case "DirProperties":
1200 dirProperties = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1201 break;
1202 case "Path":
1203 path = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1204 break;
1205 case "WebApplication":
1206 application = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1207 break;
1208 case "WebSite":
1209 if (null != parentWeb)
1210 {
1211 this.Messaging.Write(IIsErrors.WebSiteAttributeUnderWebSite(sourceLineNumbers, element.Name.LocalName));
1212 }
1213
1214 parentWeb = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1215 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.IIsWebSite, parentWeb);
1216 break;
1217 default:
1218 this.ParseHelper.UnexpectedAttribute(element, attrib);
1219 break;
1220 }
1221 }
1222 else
1223 {
1224 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1225 }
1226 }
1227
1228 if (null == id)
1229 {
1230 id = this.ParseHelper.CreateIdentifier("iwd", componentId, parentWeb, dirProperties, application);
1231 }
1232
1233 if (null == path)
1234 {
1235 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Path"));
1236 }
1237
1238 if (null == parentWeb)
1239 {
1240 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "WebSite"));
1241 }
1242
1243 foreach (var child in element.Elements())
1244 {
1245 if (this.Namespace == child.Name.Namespace)
1246 {
1247 var childSourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(child);
1248 switch (child.Name.LocalName)
1249 {
1250 case "WebApplication":
1251 if (null != application)
1252 {
1253 this.Messaging.Write(IIsErrors.WebApplicationAlreadySpecified(childSourceLineNumbers, element.Name.LocalName));
1254 }
1255
1256 application = this.ParseWebApplicationElement(intermediate, section, child);
1257 break;
1258 case "WebDirProperties":
1259 if (null == componentId)
1260 {
1261 this.Messaging.Write(IIsErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName));
1262 }
1263
1264 string childWebDirProperties = this.ParseWebDirPropertiesElement(intermediate, section, child, componentId);
1265 if (null == dirProperties)
1266 {
1267 dirProperties = childWebDirProperties;
1268 }
1269 else
1270 {
1271 this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, child.Name.LocalName, "DirProperties", child.Name.LocalName));
1272 }
1273 break;
1274 default:
1275 this.ParseHelper.UnexpectedElement(element, child);
1276 break;
1277 }
1278 }
1279 else
1280 {
1281 this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child);
1282 }
1283 }
1284
1285 if (null == dirProperties)
1286 {
1287 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "DirProperties"));
1288 }
1289
1290 if (null != application)
1291 {
1292 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.IIsWebApplication, application);
1293 }
1294
1295 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.IIsWebDirProperties, dirProperties);
1296
1297 // Reference ConfigureIIs since nothing will happen without it
1298 this.AddReferenceToConfigureIIs(section, sourceLineNumbers);
1299
1300 if (!this.Messaging.EncounteredError)
1301 {
1302 section.AddSymbol(new IIsWebDirSymbol(sourceLineNumbers, id)
1303 {
1304 ComponentRef = componentId,
1305 WebRef = parentWeb,
1306 Path = path,
1307 DirPropertiesRef = dirProperties,
1308 ApplicationRef = application,
1309 });
1310 }
1311 }
1312
1313 /// <summary>
1314 /// Parses a web directory properties element.
1315 /// </summary>
1316 /// <param name="element">Element to parse.</param>
1317 /// <returns>The identifier for this WebDirProperties.</returns>
1318 private string ParseWebDirPropertiesElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
1319 {
1320 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1321 Identifier id = null;
1322 int access = 0;
1323 var accessSet = false;
1324 int accessSSLFlags = 0;
1325 var accessSSLFlagsSet = false;
1326 string anonymousUser = null;
1327 var aspDetailedError = YesNoType.NotSet;
1328 string authenticationProviders = null;
1329 int authorization = 0;
1330 var authorizationSet = false;
1331 string cacheControlCustom = null;
1332 var cacheControlMaxAge = CompilerConstants.LongNotSet;
1333 string defaultDocuments = null;
1334 string httpExpires = null;
1335 var iisControlledPassword = false;
1336 var index = YesNoType.NotSet;
1337 var logVisits = YesNoType.NotSet;
1338 var notCustomError = YesNoType.NotSet;
1339
1340 foreach (var attrib in element.Attributes())
1341 {
1342 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1343 {
1344 switch (attrib.Name.LocalName)
1345 {
1346 case "Id":
1347 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
1348 break;
1349 case "AnonymousUser":
1350 anonymousUser = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1351 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "User", anonymousUser);
1352 break;
1353 case "AspDetailedError":
1354 aspDetailedError = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1355 break;
1356 case "AuthenticationProviders":
1357 authenticationProviders = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1358 break;
1359 case "CacheControlCustom":
1360 cacheControlCustom = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1361 break;
1362 case "CacheControlMaxAge":
1363 cacheControlMaxAge = this.ParseHelper.GetAttributeLongValue(sourceLineNumbers, attrib, 0, uint.MaxValue); // 4294967295 (uint.MaxValue) represents unlimited
1364 break;
1365 case "ClearCustomError":
1366 notCustomError = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1367 break;
1368 case "DefaultDocuments":
1369 defaultDocuments = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1370 break;
1371 case "HttpExpires":
1372 httpExpires = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1373 break;
1374 case "IIsControlledPassword":
1375 iisControlledPassword = YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1376 break;
1377 case "Index":
1378 index = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1379 break;
1380 case "LogVisits":
1381 logVisits = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1382 break;
1383
1384 // Access attributes
1385 case "Execute":
1386 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1387 {
1388 access |= 4;
1389 }
1390 else
1391 {
1392 access &= ~4;
1393 }
1394 accessSet = true;
1395 break;
1396 case "Read":
1397 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1398 {
1399 access |= 1;
1400 }
1401 else
1402 {
1403 access &= ~1;
1404 }
1405 accessSet = true;
1406 break;
1407 case "Script":
1408 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1409 {
1410 access |= 512;
1411 }
1412 else
1413 {
1414 access &= ~512;
1415 }
1416 accessSet = true;
1417 break;
1418 case "Write":
1419 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1420 {
1421 access |= 2;
1422 }
1423 else
1424 {
1425 access &= ~2;
1426 }
1427 accessSet = true;
1428 break;
1429
1430 // AccessSSL Attributes
1431 case "AccessSSL":
1432 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1433 {
1434 accessSSLFlags |= 8;
1435 }
1436 else
1437 {
1438 accessSSLFlags &= ~8;
1439 }
1440 accessSSLFlagsSet = true;
1441 break;
1442 case "AccessSSL128":
1443 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1444 {
1445 accessSSLFlags |= 256;
1446 }
1447 else
1448 {
1449 accessSSLFlags &= ~256;
1450 }
1451 accessSSLFlagsSet = true;
1452 break;
1453 case "AccessSSLMapCert":
1454 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1455 {
1456 accessSSLFlags |= 128;
1457 }
1458 else
1459 {
1460 accessSSLFlags &= ~128;
1461 }
1462 accessSSLFlagsSet = true;
1463 break;
1464 case "AccessSSLNegotiateCert":
1465 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1466 {
1467 accessSSLFlags |= 32;
1468 }
1469 else
1470 {
1471 accessSSLFlags &= ~32;
1472 }
1473 accessSSLFlagsSet = true;
1474 break;
1475 case "AccessSSLRequireCert":
1476 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1477 {
1478 accessSSLFlags |= 64;
1479 }
1480 else
1481 {
1482 accessSSLFlags &= ~64;
1483 }
1484 accessSSLFlagsSet = true;
1485 break;
1486
1487 // Authorization attributes
1488 case "AnonymousAccess":
1489 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1490 {
1491 authorization |= 1;
1492 }
1493 else
1494 {
1495 authorization &= ~1;
1496 }
1497 authorizationSet = true;
1498 break;
1499 case "BasicAuthentication":
1500 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1501 {
1502 authorization |= 2;
1503 }
1504 else
1505 {
1506 authorization &= ~2;
1507 }
1508 authorizationSet = true;
1509 break;
1510 case "DigestAuthentication":
1511 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1512 {
1513 authorization |= 16;
1514 }
1515 else
1516 {
1517 authorization &= ~16;
1518 }
1519 authorizationSet = true;
1520 break;
1521 case "PassportAuthentication":
1522 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1523 {
1524 authorization |= 64;
1525 }
1526 else
1527 {
1528 authorization &= ~64;
1529 }
1530 authorizationSet = true;
1531 break;
1532 case "WindowsAuthentication":
1533 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1534 {
1535 authorization |= 4;
1536 }
1537 else
1538 {
1539 authorization &= ~4;
1540 }
1541 authorizationSet = true;
1542 break;
1543 default:
1544 this.ParseHelper.UnexpectedAttribute(element, attrib);
1545 break;
1546 }
1547 }
1548 else
1549 {
1550 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1551 }
1552 }
1553
1554 if (null == id)
1555 {
1556 if (null == componentId)
1557 {
1558 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
1559 id = Identifier.Invalid;
1560 }
1561 else
1562 {
1563 id = this.ParseHelper.CreateIdentifier("wdp", componentId);
1564 }
1565 }
1566
1567 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
1568
1569 if (!this.Messaging.EncounteredError)
1570 {
1571 var symbol = section.AddSymbol(new IIsWebDirPropertiesSymbol(sourceLineNumbers, id)
1572 {
1573 AnonymousUserRef = anonymousUser,
1574 IIsControlledPassword = iisControlledPassword ? 1 : 0,
1575 DefaultDoc = defaultDocuments,
1576 HttpExpires = httpExpires,
1577 CacheControlCustom = cacheControlCustom,
1578 });
1579
1580 if (accessSet)
1581 {
1582 symbol.Access = access;
1583 }
1584
1585 if (authorizationSet)
1586 {
1587 symbol.Authorization = authorization;
1588 }
1589
1590 if (YesNoType.NotSet != logVisits)
1591 {
1592 symbol.LogVisits = YesNoType.Yes == logVisits ? 1 : 0;
1593 }
1594
1595 if (YesNoType.NotSet != index)
1596 {
1597 symbol.Index = YesNoType.Yes == index ? 1 : 0;
1598 }
1599
1600 if (YesNoType.NotSet != aspDetailedError)
1601 {
1602 symbol.AspDetailedError = YesNoType.Yes == aspDetailedError ? 1 : 0;
1603 }
1604
1605 if (CompilerConstants.LongNotSet != cacheControlMaxAge)
1606 {
1607 symbol.CacheControlMaxAge = unchecked((int)cacheControlMaxAge);
1608 }
1609
1610 if (YesNoType.NotSet != notCustomError)
1611 {
1612 symbol.NoCustomError = YesNoType.Yes == notCustomError ? 1 : 0;
1613 }
1614
1615 if (accessSSLFlagsSet)
1616 {
1617 symbol.AccessSSLFlags = accessSSLFlags;
1618 }
1619
1620 if (null != authenticationProviders)
1621 {
1622 symbol.AuthenticationProviders = authenticationProviders;
1623 }
1624 }
1625
1626 return id?.Id;
1627 }
1628
1629 /// <summary>
1630 /// Parses a web error element.
1631 /// </summary>
1632 /// <param name="element">Element to parse.</param>
1633 /// <param name="parentType">Type of the parent.</param>
1634 /// <param name="parent">Id of the parent.</param>
1635 private void ParseWebErrorElement(Intermediate intermediate, IntermediateSection section, XElement element, WebErrorParentType parentType, string parent)
1636 {
1637 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1638 var errorCode = CompilerConstants.IntegerNotSet;
1639 string file = null;
1640 string url = null;
1641 var subCode = CompilerConstants.IntegerNotSet;
1642
1643 foreach (var attrib in element.Attributes())
1644 {
1645 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1646 {
1647 switch (attrib.Name.LocalName)
1648 {
1649 case "ErrorCode":
1650 errorCode = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 400, 599);
1651 break;
1652 case "File":
1653 file = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1654 break;
1655 case "SubCode":
1656 subCode = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue);
1657 break;
1658 case "URL":
1659 url = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1660 break;
1661 default:
1662 this.ParseHelper.UnexpectedAttribute(element, attrib);
1663 break;
1664 }
1665 }
1666 else
1667 {
1668 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1669 }
1670 }
1671
1672 if (CompilerConstants.IntegerNotSet == errorCode)
1673 {
1674 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "ErrorCode"));
1675 errorCode = CompilerConstants.IllegalInteger;
1676 }
1677
1678 if (CompilerConstants.IntegerNotSet == subCode)
1679 {
1680 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "SubCode"));
1681 subCode = CompilerConstants.IllegalInteger;
1682 }
1683
1684 if (String.IsNullOrEmpty(file) && String.IsNullOrEmpty(url))
1685 {
1686 this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, "File", "URL"));
1687 }
1688
1689 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
1690
1691 // Reference ConfigureIIs since nothing will happen without it
1692 this.AddReferenceToConfigureIIs(section, sourceLineNumbers);
1693
1694 if (!this.Messaging.EncounteredError)
1695 {
1696 section.AddSymbol(new IIsWebErrorSymbol(sourceLineNumbers)
1697 {
1698 ErrorCode = errorCode,
1699 SubCode = subCode,
1700 ParentType = (int)parentType,
1701 ParentValue = parent,
1702 File = file,
1703 URL = url,
1704 });
1705 }
1706 }
1707
1708 /// <summary>
1709 /// Parses a web filter element.
1710 /// </summary>
1711 /// <param name="element">Element to parse.</param>
1712 /// <param name="componentId">Identifier of parent component.</param>
1713 /// <param name="parentWeb">Optional identifier of parent web site.</param>
1714 private void ParseWebFilterElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string parentWeb)
1715 {
1716 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1717 Identifier id = null;
1718 string description = null;
1719 int flags = 0;
1720 var loadOrder = CompilerConstants.IntegerNotSet;
1721 string name = null;
1722 string path = null;
1723
1724 foreach (var attrib in element.Attributes())
1725 {
1726 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1727 {
1728 switch (attrib.Name.LocalName)
1729 {
1730 case "Id":
1731 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
1732 break;
1733 case "Description":
1734 description = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1735 break;
1736 case "Flags":
1737 flags = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, int.MaxValue);
1738 break;
1739 case "LoadOrder":
1740 string loadOrderValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1741 if (0 < loadOrderValue.Length)
1742 {
1743 switch (loadOrderValue)
1744 {
1745 case "first":
1746 loadOrder = 0;
1747 break;
1748 case "last":
1749 loadOrder = -1;
1750 break;
1751 default:
1752 loadOrder = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, short.MaxValue);
1753 break;
1754 }
1755 }
1756 break;
1757 case "Name":
1758 name = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1759 break;
1760 case "Path":
1761 path = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1762 break;
1763 case "WebSite":
1764 if (null != parentWeb)
1765 {
1766 this.Messaging.Write(IIsErrors.WebSiteAttributeUnderWebSite(sourceLineNumbers, element.Name.LocalName));
1767 }
1768
1769 parentWeb = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
1770 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.IIsWebSite, parentWeb);
1771 break;
1772 default:
1773 this.ParseHelper.UnexpectedAttribute(element, attrib);
1774 break;
1775 }
1776 }
1777 else
1778 {
1779 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1780 }
1781 }
1782
1783 if (null == id)
1784 {
1785 id = this.ParseHelper.CreateIdentifier("ifl", name, componentId, path, parentWeb);
1786 }
1787
1788 if (null == name)
1789 {
1790 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
1791 }
1792
1793 if (null == path)
1794 {
1795 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Path"));
1796 }
1797
1798 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
1799
1800 // Reference ConfigureIIs since nothing will happen without it
1801 this.AddReferenceToConfigureIIs(section, sourceLineNumbers);
1802
1803 if (!this.Messaging.EncounteredError)
1804 {
1805 var symbol = section.AddSymbol(new IIsFilterSymbol(sourceLineNumbers, id)
1806 {
1807 Name = name,
1808 ComponentRef = componentId,
1809 Path = path,
1810 WebRef = parentWeb,
1811 Description = description,
1812 Flags = flags,
1813 });
1814
1815 if (CompilerConstants.IntegerNotSet != loadOrder)
1816 {
1817 symbol.LoadOrder = loadOrder;
1818 }
1819 }
1820 }
1821
1822 /// <summary>
1823 /// Parses web log element.
1824 /// </summary>
1825 /// <param name="element">Node to be parsed.</param>
1826 private void ParseWebLogElement(Intermediate intermediate, IntermediateSection section, XElement element)
1827 {
1828 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1829 Identifier id = null;
1830 string type = null;
1831
1832 foreach (var attrib in element.Attributes())
1833 {
1834 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1835 {
1836 switch (attrib.Name.LocalName)
1837 {
1838 case "Id":
1839 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
1840 break;
1841 case "Type":
1842 var typeValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1843 if (0 < typeValue.Length)
1844 {
1845 switch (typeValue)
1846 {
1847 case "IIS":
1848 type = "Microsoft IIS Log File Format";
1849 break;
1850 case "NCSA":
1851 type = "NCSA Common Log File Format";
1852 break;
1853 case "none":
1854 type = "none";
1855 break;
1856 case "ODBC":
1857 type = "ODBC Logging";
1858 break;
1859 case "W3C":
1860 type = "W3C Extended Log File Format";
1861 break;
1862 default:
1863 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "Type", typeValue, "IIS", "NCSA", "none", "ODBC", "W3C"));
1864 break;
1865 }
1866 }
1867 break;
1868 default:
1869 this.ParseHelper.UnexpectedAttribute(element, attrib);
1870 break;
1871 }
1872 }
1873 else
1874 {
1875 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1876 }
1877 }
1878
1879 if (null == id)
1880 {
1881 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
1882 }
1883
1884 if (null == type)
1885 {
1886 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Type"));
1887 }
1888
1889 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
1890
1891 if (!this.Messaging.EncounteredError)
1892 {
1893 section.AddSymbol(new IIsWebLogSymbol(sourceLineNumbers, id)
1894 {
1895 Format = type,
1896 });
1897 }
1898 }
1899
1900 /// <summary>
1901 /// Parses a web property element.
1902 /// </summary>
1903 /// <param name="element">Element to parse.</param>
1904 /// <param name="componentId">Identifier for parent component.</param>
1905 private void ParseWebPropertyElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
1906 {
1907 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1908 Identifier id = null;
1909 string value = null;
1910
1911 foreach (var attrib in element.Attributes())
1912 {
1913 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1914 {
1915 switch (attrib.Name.LocalName)
1916 {
1917 case "Id":
1918 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
1919 break;
1920 case "Value":
1921 value = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
1922 break;
1923 default:
1924 this.ParseHelper.UnexpectedAttribute(element, attrib);
1925 break;
1926 }
1927 }
1928 else
1929 {
1930 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
1931 }
1932 }
1933
1934 switch (id?.Id)
1935 {
1936 case "ETagChangeNumber":
1937 case "MaxGlobalBandwidth":
1938 // Must specify a value for these
1939 if (null == value)
1940 {
1941 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Value", "Id", id.Id));
1942 }
1943 break;
1944 case "IIs5IsolationMode":
1945 case "LogInUTF8":
1946 // Can't specify a value for these
1947 if (null != value)
1948 {
1949 this.Messaging.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, element.Name.LocalName, "Value", "Id", id.Id));
1950 }
1951 break;
1952 default:
1953 this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "Id", id?.Id, "ETagChangeNumber", "IIs5IsolationMode", "LogInUTF8", "MaxGlobalBandwidth"));
1954 break;
1955 }
1956
1957 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
1958
1959 // Reference ConfigureIIs since nothing will happen without it
1960 this.AddReferenceToConfigureIIs(section, sourceLineNumbers);
1961
1962 if (!this.Messaging.EncounteredError)
1963 {
1964 section.AddSymbol(new IIsPropertySymbol(sourceLineNumbers, id)
1965 {
1966 ComponentRef = componentId,
1967 Attributes = 0,
1968 Value = value,
1969 });
1970 }
1971 }
1972
1973 /// <summary>
1974 /// Parses a web service extension element.
1975 /// </summary>
1976 /// <param name="element">Element to parse.</param>
1977 /// <param name="componentId">Identifier for parent component.</param>
1978 private void ParseWebServiceExtensionElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
1979 {
1980 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
1981 Identifier id = null;
1982 int attributes = 0;
1983 string description = null;
1984 string file = null;
1985 string group = null;
1986
1987 foreach (XAttribute attrib in element.Attributes())
1988 {
1989 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
1990 {
1991 switch (attrib.Name.LocalName)
1992 {
1993 case "Id":
1994 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
1995 break;
1996 case "Allow":
1997 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
1998 {
1999 attributes |= 1;
2000 }
2001 else
2002 {
2003 attributes &= ~1;
2004 }
2005 break;
2006 case "Description":
2007 description = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2008 break;
2009 case "File":
2010 file = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2011 break;
2012 case "Group":
2013 group = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2014 break;
2015 case "UIDeletable":
2016 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
2017 {
2018 attributes |= 2;
2019 }
2020 else
2021 {
2022 attributes &= ~2;
2023 }
2024 break;
2025 default:
2026 this.ParseHelper.UnexpectedAttribute(element, attrib);
2027 break;
2028 }
2029 }
2030 else
2031 {
2032 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2033 }
2034 }
2035
2036 if (null == id)
2037 {
2038 id = this.ParseHelper.CreateIdentifier("iwe", componentId, file);
2039 }
2040
2041 if (null == file)
2042 {
2043 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "File"));
2044 }
2045
2046 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
2047
2048 // Reference ConfigureIIs since nothing will happen without it
2049 this.AddReferenceToConfigureIIs(section, sourceLineNumbers);
2050
2051 if (!this.Messaging.EncounteredError)
2052 {
2053 section.AddSymbol(new IIsWebServiceExtensionSymbol(sourceLineNumbers, id)
2054 {
2055 ComponentRef = componentId,
2056 File = file,
2057 Description = description,
2058 Group = group,
2059 Attributes = attributes,
2060 });
2061 }
2062 }
2063
2064 /// <summary>
2065 /// Parses a web site element.
2066 /// </summary>
2067 /// <param name="element">Element to parse.</param>
2068 /// <param name="componentId">Optional identifier of parent component.</param>
2069 private void ParseWebSiteElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId)
2070 {
2071 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2072 Identifier id = null;
2073 string application = null;
2074 int attributes = 0;
2075 var connectionTimeout = CompilerConstants.IntegerNotSet;
2076 string description = null;
2077 string directory = null;
2078 string dirProperties = null;
2079 string keyAddress = null;
2080 string log = null;
2081 string siteId = null;
2082 var sequence = CompilerConstants.IntegerNotSet;
2083 var state = CompilerConstants.IntegerNotSet;
2084
2085 foreach (var attrib in element.Attributes())
2086 {
2087 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2088 {
2089 switch (attrib.Name.LocalName)
2090 {
2091 case "Id":
2092 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
2093 break;
2094 case "AutoStart":
2095 if (null == componentId)
2096 {
2097 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
2098 }
2099
2100 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
2101 {
2102 state = 2;
2103 }
2104 else if (state != 1)
2105 {
2106 state = 0;
2107 }
2108 break;
2109 case "ConfigureIfExists":
2110 if (null == componentId)
2111 {
2112 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
2113 }
2114
2115 if (YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
2116 {
2117 attributes &= ~2;
2118 }
2119 else
2120 {
2121 attributes |= 2;
2122 }
2123 break;
2124 case "ConnectionTimeout":
2125 connectionTimeout = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue);
2126 break;
2127 case "Description":
2128 description = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2129 break;
2130 case "Directory":
2131 directory = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
2132 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.Directory, directory);
2133 break;
2134 case "DirProperties":
2135 if (null == componentId)
2136 {
2137 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
2138 }
2139
2140 dirProperties = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2141 break;
2142 case "SiteId":
2143 siteId = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2144 if ("*" == siteId)
2145 {
2146 siteId = "-1";
2147 }
2148 break;
2149 case "Sequence":
2150 sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, short.MaxValue);
2151 break;
2152 case "StartOnInstall":
2153 if (null == componentId)
2154 {
2155 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
2156 }
2157
2158 // when state is set to 2 it implies 1, so don't set it to 1
2159 if (2 != state && YesNoType.Yes == this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib))
2160 {
2161 state = 1;
2162 }
2163 else if (2 != state)
2164 {
2165 state = 0;
2166 }
2167 break;
2168 case "WebApplication":
2169 if (null == componentId)
2170 {
2171 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
2172 }
2173
2174 application = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2175 break;
2176 case "WebLog":
2177 if (null == componentId)
2178 {
2179 this.Messaging.Write(IIsErrors.IllegalAttributeWithoutComponent(sourceLineNumbers, element.Name.LocalName, attrib.Name.LocalName));
2180 }
2181
2182 log = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
2183 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.IIsWebLog, log);
2184 break;
2185 default:
2186 this.ParseHelper.UnexpectedAttribute(element, attrib);
2187 break;
2188 }
2189 }
2190 else
2191 {
2192 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2193 }
2194 }
2195
2196 if (null == id)
2197 {
2198 id = this.ParseHelper.CreateIdentifier("iws", description, componentId, siteId, application);
2199 }
2200
2201 if (null == description)
2202 {
2203 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Description"));
2204 }
2205
2206 if (null == directory && null != componentId)
2207 {
2208 this.Messaging.Write(IIsErrors.RequiredAttributeUnderComponent(sourceLineNumbers, element.Name.LocalName, "Directory"));
2209 }
2210
2211 foreach (var child in element.Elements())
2212 {
2213 if (this.Namespace == child.Name.Namespace)
2214 {
2215 var childSourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(child);
2216 switch (child.Name.LocalName)
2217 {
2218 case "CertificateRef":
2219 if (null == componentId)
2220 {
2221 this.Messaging.Write(IIsErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName));
2222 }
2223
2224 this.ParseCertificateRefElement(intermediate, section, child, id?.Id);
2225 break;
2226 case "HttpHeader":
2227 if (null == componentId)
2228 {
2229 this.Messaging.Write(IIsErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName));
2230 }
2231
2232 this.ParseHttpHeaderElement(intermediate, section, child, HttpHeaderParentType.WebSite, id?.Id);
2233 break;
2234 case "WebAddress":
2235 string address = this.ParseWebAddressElement(intermediate, section, child, id?.Id);
2236 if (null == keyAddress)
2237 {
2238 keyAddress = address;
2239 }
2240 break;
2241 case "WebApplication":
2242 if (null == componentId)
2243 {
2244 this.Messaging.Write(IIsErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName));
2245 }
2246
2247 if (null != application)
2248 {
2249 this.Messaging.Write(IIsErrors.WebApplicationAlreadySpecified(childSourceLineNumbers, element.Name.LocalName));
2250 }
2251
2252 application = this.ParseWebApplicationElement(intermediate, section, child);
2253 break;
2254 case "WebDir":
2255 if (null == componentId)
2256 {
2257 this.Messaging.Write(IIsErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName));
2258 }
2259
2260 this.ParseWebDirElement(intermediate, section, child, componentId, id?.Id);
2261 break;
2262 case "WebDirProperties":
2263 if (null == componentId)
2264 {
2265 this.Messaging.Write(IIsErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName));
2266 }
2267
2268 string childWebDirProperties = this.ParseWebDirPropertiesElement(intermediate, section, child, componentId);
2269 if (null == dirProperties)
2270 {
2271 dirProperties = childWebDirProperties;
2272 }
2273 else
2274 {
2275 this.Messaging.Write(ErrorMessages.IllegalParentAttributeWhenNested(sourceLineNumbers, "WebSite", "DirProperties", child.Name.LocalName));
2276 }
2277 break;
2278 case "WebError":
2279 if (null == componentId)
2280 {
2281 this.Messaging.Write(IIsErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName));
2282 }
2283
2284 this.ParseWebErrorElement(intermediate, section, child, WebErrorParentType.WebSite, id?.Id);
2285 break;
2286 case "WebFilter":
2287 if (null == componentId)
2288 {
2289 this.Messaging.Write(IIsErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName));
2290 }
2291
2292 this.ParseWebFilterElement(intermediate, section, child, componentId, id?.Id);
2293 break;
2294 case "WebVirtualDir":
2295 if (null == componentId)
2296 {
2297 this.Messaging.Write(IIsErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName));
2298 }
2299
2300 this.ParseWebVirtualDirElement(intermediate, section, child, componentId, id?.Id, null);
2301 break;
2302 case "MimeMap":
2303 this.ParseMimeMapElement(intermediate, section, child, id?.Id, MimeMapParentType.WebSite);
2304 break;
2305 default:
2306 this.ParseHelper.UnexpectedElement(element, child);
2307 break;
2308 }
2309 }
2310 else
2311 {
2312 this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child);
2313 }
2314 }
2315
2316
2317 if (null == keyAddress)
2318 {
2319 this.Messaging.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, element.Name.LocalName, "WebAddress"));
2320 }
2321
2322 if (null != application)
2323 {
2324 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.IIsWebApplication, application);
2325 }
2326
2327 if (null != dirProperties)
2328 {
2329 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.IIsWebDirProperties, dirProperties);
2330 }
2331
2332 if (null != componentId)
2333 {
2334 // Reference ConfigureIIs since nothing will happen without it
2335 this.AddReferenceToConfigureIIs(section, sourceLineNumbers);
2336 }
2337
2338 if (!this.Messaging.EncounteredError)
2339 {
2340 var symbol = section.AddSymbol(new IIsWebSiteSymbol(sourceLineNumbers, id)
2341 {
2342 ComponentRef = componentId,
2343 Description = description,
2344 DirectoryRef = directory,
2345 KeyAddressRef = keyAddress,
2346 DirPropertiesRef = dirProperties,
2347 ApplicationRef = application,
2348 LogRef = log,
2349 WebsiteId = siteId,
2350 });
2351
2352 if (CompilerConstants.IntegerNotSet != connectionTimeout)
2353 {
2354 symbol.ConnectionTimeout = connectionTimeout;
2355 }
2356
2357 if (CompilerConstants.IntegerNotSet != state)
2358 {
2359 symbol.State = state;
2360 }
2361
2362 if (0 != attributes)
2363 {
2364 symbol.Attributes = attributes;
2365 }
2366
2367 if (CompilerConstants.IntegerNotSet != sequence)
2368 {
2369 symbol.Sequence = sequence;
2370 }
2371 }
2372 }
2373
2374 /// <summary>
2375 /// Parses a HTTP Header element.
2376 /// </summary>
2377 /// <param name="element">Element to parse.</param>
2378 /// <param name="parentType">Type of the parent.</param>
2379 /// <param name="parent">Id of the parent.</param>
2380 private void ParseHttpHeaderElement(Intermediate intermediate, IntermediateSection section, XElement element, HttpHeaderParentType parentType, string parent)
2381 {
2382 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2383 Identifier id = null;
2384 string headerName = null;
2385 string headerValue = null;
2386
2387 foreach (var attrib in element.Attributes())
2388 {
2389 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2390 {
2391 switch (attrib.Name.LocalName)
2392 {
2393 case "Id":
2394 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
2395 break;
2396 case "Name":
2397 headerName = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2398 break;
2399 case "Value":
2400 headerValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2401 break;
2402 default:
2403 this.ParseHelper.UnexpectedAttribute(element, attrib);
2404 break;
2405 }
2406 }
2407 else
2408 {
2409 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2410 }
2411 }
2412
2413 if (null == headerName)
2414 {
2415 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
2416 }
2417 else if (null == id)
2418 {
2419 id = this.ParseHelper.CreateIdentifierFromFilename(headerName);
2420 }
2421
2422 this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
2423
2424 // Reference ConfigureIIs since nothing will happen without it
2425 this.AddReferenceToConfigureIIs(section, sourceLineNumbers);
2426
2427 if (!this.Messaging.EncounteredError)
2428 {
2429 section.AddSymbol(new IIsHttpHeaderSymbol(sourceLineNumbers, id)
2430 {
2431 HttpHeader = id.Id,
2432 ParentType = (int)parentType,
2433 ParentValue = parent,
2434 Name = headerName,
2435 Value = headerValue,
2436 Attributes = 0,
2437 });
2438 }
2439 }
2440
2441 /// <summary>
2442 /// Parses a virtual directory element.
2443 /// </summary>
2444 /// <param name="element">Element to parse.</param>
2445 /// <param name="componentId">Identifier of parent component.</param>
2446 /// <param name="parentWeb">Identifier of parent web site.</param>
2447 /// <param name="parentAlias">Alias of the parent web site.</param>
2448 private void ParseWebVirtualDirElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string parentWeb, string parentAlias)
2449 {
2450 var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
2451 Identifier id = null;
2452 string alias = null;
2453 string application = null;
2454 string directory = null;
2455 string dirProperties = null;
2456
2457 foreach (var attrib in element.Attributes())
2458 {
2459 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
2460 {
2461 switch (attrib.Name.LocalName)
2462 {
2463 case "Id":
2464 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
2465 break;
2466 case "Alias":
2467 alias = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2468 break;
2469 case "Directory":
2470 directory = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
2471 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.Directory, directory);
2472 break;
2473 case "DirProperties":
2474 dirProperties = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2475 break;
2476 case "WebApplication":
2477 application = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
2478 break;
2479 case "WebSite":
2480 if (null != parentWeb)
2481 {
2482 this.Messaging.Write(IIsErrors.WebSiteAttributeUnderWebSite(sourceLineNumbers, element.Name.LocalName));
2483 }
2484
2485 parentWeb = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
2486 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.IIsWebSite, parentWeb);
2487 break;
2488 default:
2489 this.ParseHelper.UnexpectedAttribute(element, attrib);
2490 break;
2491 }
2492 }
2493 else
2494 {
2495 this.ParseHelper.ParseExtensionAttribute(this.Context.Extensions, intermediate, section, element, attrib);
2496 }
2497 }
2498
2499 if (null == id)
2500 {
2501 id = this.ParseHelper.CreateIdentifier("wvd", alias, directory, dirProperties, application, parentWeb);
2502 }
2503
2504 if (null == alias)
2505 {
2506 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Alias"));
2507 }
2508 else if (-1 != alias.IndexOf("\\", StringComparison.Ordinal))
2509 {
2510 this.Messaging.Write(IIsErrors.IllegalCharacterInAttributeValue(sourceLineNumbers, element.Name.LocalName, "Alias", alias, '\\'));
2511 }
2512
2513 if (null == directory)
2514 {
2515 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Directory"));
2516 }
2517
2518 if (null == parentWeb)
2519 {
2520 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "WebSite"));
2521 }
2522
2523 if (null == componentId)
2524 {
2525 this.Messaging.Write(IIsErrors.IllegalElementWithoutComponent(sourceLineNumbers, element.Name.LocalName));
2526 }
2527
2528 if (null != parentAlias)
2529 {
2530 alias = String.Concat(parentAlias, "/", alias);
2531 }
2532
2533 foreach (var child in element.Elements())
2534 {
2535 if (this.Namespace == child.Name.Namespace)
2536 {
2537 var childSourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(child);
2538 switch (child.Name.LocalName)
2539 {
2540 case "WebApplication":
2541 if (null != application)
2542 {
2543 this.Messaging.Write(IIsErrors.WebApplicationAlreadySpecified(childSourceLineNumbers, element.Name.LocalName));
2544 }
2545
2546 application = this.ParseWebApplicationElement(intermediate, section, child);
2547 break;
2548 case "WebDirProperties":
2549 if (null == componentId)
2550 {
2551 this.Messaging.Write(IIsErrors.IllegalElementWithoutComponent(childSourceLineNumbers, child.Name.LocalName));
2552 }
2553
2554 string childWebDirProperties = this.ParseWebDirPropertiesElement(intermediate, section, child, componentId);
2555 if (null == dirProperties)
2556 {
2557 dirProperties = childWebDirProperties;
2558 }
2559 else
2560 {
2561 this.Messaging.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, child.Name.LocalName, "DirProperties", child.Name.LocalName));
2562 }
2563 break;
2564
2565 case "WebError":
2566 this.ParseWebErrorElement(intermediate, section, child, WebErrorParentType.WebVirtualDir, id?.Id);
2567 break;
2568 case "WebVirtualDir":
2569 this.ParseWebVirtualDirElement(intermediate, section, child, componentId, parentWeb, alias);
2570 break;
2571 case "HttpHeader":
2572 this.ParseHttpHeaderElement(intermediate, section, child, HttpHeaderParentType.WebVirtualDir, id?.Id);
2573 break;
2574 case "MimeMap":
2575 this.ParseMimeMapElement(intermediate, section, child, id?.Id, MimeMapParentType.WebVirtualDir);
2576 break;
2577 default:
2578 this.ParseHelper.UnexpectedElement(element, child);
2579 break;
2580 }
2581 }
2582 else
2583 {
2584 this.ParseHelper.ParseExtensionElement(this.Context.Extensions, intermediate, section, element, child);
2585 }
2586 }
2587
2588 if (null != dirProperties)
2589 {
2590 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.IIsWebDirProperties, dirProperties);
2591 }
2592
2593 if (null != application)
2594 {
2595 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, IisSymbolDefinitions.IIsWebApplication, application);
2596 }
2597
2598 // Reference ConfigureIIs since nothing will happen without it
2599 this.AddReferenceToConfigureIIs(section, sourceLineNumbers);
2600
2601 if (!this.Messaging.EncounteredError)
2602 {
2603 section.AddSymbol(new IIsWebVirtualDirSymbol(sourceLineNumbers, id)
2604 {
2605 ComponentRef = componentId,
2606 WebRef = parentWeb,
2607 Alias = alias,
2608 DirectoryRef = directory,
2609 DirPropertiesRef = dirProperties,
2610 ApplicationRef = application,
2611 });
2612 }
2613 }
2614
2615 private void AddReferenceToConfigureIIs(IntermediateSection section, SourceLineNumber sourceLineNumbers)
2616 {
2617 this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "Wix4ConfigureIIs", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM64);
2618 }
2619 }
2620}
diff --git a/src/ext/Iis/wixext/IIsDecompiler.cs b/src/ext/Iis/wixext/IIsDecompiler.cs
new file mode 100644
index 00000000..17e15348
--- /dev/null
+++ b/src/ext/Iis/wixext/IIsDecompiler.cs
@@ -0,0 +1,1549 @@
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.Iis
4{
5#if TODO_CONSIDER_DECOMPILER
6 using System;
7 using System.Collections;
8 using System.Globalization;
9 using WixToolset.Data;
10 using WixToolset.Extensibility;
11 using IIs = WixToolset.Extensions.Serialize.IIs;
12 using Wix = WixToolset.Data.Serialize;
13
14 /// <summary>
15 /// The decompiler for the WiX Toolset Internet Information Services Extension.
16 /// </summary>
17 public sealed class IIsDecompiler : DecompilerExtension
18 {
19 /// <summary>
20 /// Creates a decompiler for IIs Extension.
21 /// </summary>
22 public IIsDecompiler()
23 {
24 this.TableDefinitions = IIsExtensionData.GetExtensionTableDefinitions();
25 }
26
27 /// <summary>
28 /// Get the extensions library to be removed.
29 /// </summary>
30 /// <param name="tableDefinitions">Table definitions for library.</param>
31 /// <returns>Library to remove from decompiled output.</returns>
32 public override Library GetLibraryToRemove(TableDefinitionCollection tableDefinitions)
33 {
34 return IIsExtensionData.GetExtensionLibrary(tableDefinitions);
35 }
36
37 /// <summary>
38 /// Decompiles an extension table.
39 /// </summary>
40 /// <param name="table">The table to decompile.</param>
41 public override void DecompileTable(Table table)
42 {
43 switch (table.Name)
44 {
45 case "Certificate":
46 this.DecompileCertificateTable(table);
47 break;
48 case "CertificateHash":
49 // There is nothing to do for this table, it contains no authored data
50 // to be decompiled.
51 break;
52 case "IIsAppPool":
53 this.DecompileIIsAppPoolTable(table);
54 break;
55 case "IIsFilter":
56 this.DecompileIIsFilterTable(table);
57 break;
58 case "IIsProperty":
59 this.DecompileIIsPropertyTable(table);
60 break;
61 case "IIsHttpHeader":
62 this.DecompileIIsHttpHeaderTable(table);
63 break;
64 case "IIsMimeMap":
65 this.DecompileIIsMimeMapTable(table);
66 break;
67 case "IIsWebAddress":
68 this.DecompileIIsWebAddressTable(table);
69 break;
70 case "IIsWebApplication":
71 this.DecompileIIsWebApplicationTable(table);
72 break;
73 case "IIsWebDirProperties":
74 this.DecompileIIsWebDirPropertiesTable(table);
75 break;
76 case "IIsWebError":
77 this.DecompileIIsWebErrorTable(table);
78 break;
79 case "IIsWebLog":
80 this.DecompileIIsWebLogTable(table);
81 break;
82 case "IIsWebServiceExtension":
83 this.DecompileIIsWebServiceExtensionTable(table);
84 break;
85 case "IIsWebSite":
86 this.DecompileIIsWebSiteTable(table);
87 break;
88 case "IIsWebVirtualDir":
89 this.DecompileIIsWebVirtualDirTable(table);
90 break;
91 case "IIsWebSiteCertificates":
92 this.DecompileIIsWebSiteCertificatesTable(table);
93 break;
94 default:
95 base.DecompileTable(table);
96 break;
97 }
98 }
99
100 /// <summary>
101 /// Finalize decompilation.
102 /// </summary>
103 /// <param name="tables">The collection of all tables.</param>
104 public override void Finish(TableIndexedCollection tables)
105 {
106 this.FinalizeIIsMimeMapTable(tables);
107 this.FinalizeIIsHttpHeaderTable(tables);
108 this.FinalizeIIsWebApplicationTable(tables);
109 this.FinalizeIIsWebErrorTable(tables);
110 this.FinalizeIIsWebVirtualDirTable(tables);
111 this.FinalizeIIsWebSiteCertificatesTable(tables);
112 this.FinalizeWebAddressTable(tables);
113 }
114
115 /// <summary>
116 /// Decompile the Certificate table.
117 /// </summary>
118 /// <param name="table">The table to decompile.</param>
119 private void DecompileCertificateTable(Table table)
120 {
121 foreach (Row row in table.Rows)
122 {
123 IIs.Certificate certificate = new IIs.Certificate();
124
125 certificate.Id = (string)row[0];
126 certificate.Name = (string)row[2];
127
128 switch ((int)row[3])
129 {
130 case 1:
131 certificate.StoreLocation = IIs.Certificate.StoreLocationType.currentUser;
132 break;
133 case 2:
134 certificate.StoreLocation = IIs.Certificate.StoreLocationType.localMachine;
135 break;
136 default:
137 // TODO: warn
138 break;
139 }
140
141 switch ((string)row[4])
142 {
143 case "CA":
144 certificate.StoreName = IIs.Certificate.StoreNameType.ca;
145 break;
146 case "MY":
147 certificate.StoreName = IIs.Certificate.StoreNameType.my;
148 break;
149 case "REQUEST":
150 certificate.StoreName = IIs.Certificate.StoreNameType.request;
151 break;
152 case "Root":
153 certificate.StoreName = IIs.Certificate.StoreNameType.root;
154 break;
155 case "AddressBook":
156 certificate.StoreName = IIs.Certificate.StoreNameType.otherPeople;
157 break;
158 case "TrustedPeople":
159 certificate.StoreName = IIs.Certificate.StoreNameType.trustedPeople;
160 break;
161 case "TrustedPublisher":
162 certificate.StoreName = IIs.Certificate.StoreNameType.trustedPublisher;
163 break;
164 default:
165 // TODO: warn
166 break;
167 }
168
169 int attribute = (int)row[5];
170
171 if (0x1 == (attribute & 0x1))
172 {
173 certificate.Request = IIs.YesNoType.yes;
174 }
175
176 if (0x2 == (attribute & 0x2))
177 {
178 if (null != row[6])
179 {
180 certificate.BinaryKey = (string)row[6];
181 }
182 else
183 {
184 // TODO: warn about expected value in row 5
185 }
186 }
187 else if (null != row[7])
188 {
189 certificate.CertificatePath = (string)row[7];
190 }
191
192 if (0x4 == (attribute & 0x4))
193 {
194 certificate.Overwrite = IIs.YesNoType.yes;
195 }
196
197 if (null != row[8])
198 {
199 certificate.PFXPassword = (string)row[8];
200 }
201
202 Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]);
203 if (null != component)
204 {
205 component.AddChild(certificate);
206 }
207 else
208 {
209 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component"));
210 }
211 }
212 }
213
214 /// <summary>
215 /// Decompile the IIsAppPool table.
216 /// </summary>
217 /// <param name="table">The table to decompile.</param>
218 private void DecompileIIsAppPoolTable(Table table)
219 {
220 foreach (Row row in table.Rows)
221 {
222 IIs.WebAppPool webAppPool = new IIs.WebAppPool();
223
224 webAppPool.Id = (string)row[0];
225
226 webAppPool.Name = (string)row[1];
227
228 switch ((int)row[3] & 0x1F)
229 {
230 case 1:
231 webAppPool.Identity = IIs.WebAppPool.IdentityType.networkService;
232 break;
233 case 2:
234 webAppPool.Identity = IIs.WebAppPool.IdentityType.localService;
235 break;
236 case 4:
237 webAppPool.Identity = IIs.WebAppPool.IdentityType.localSystem;
238 break;
239 case 8:
240 webAppPool.Identity = IIs.WebAppPool.IdentityType.other;
241 break;
242 case 0x10:
243 webAppPool.Identity = IIs.WebAppPool.IdentityType.applicationPoolIdentity;
244 break;
245 default:
246 // TODO: warn
247 break;
248 }
249
250 if (null != row[4])
251 {
252 webAppPool.User = (string)row[4];
253 }
254
255 if (null != row[5])
256 {
257 webAppPool.RecycleMinutes = (int)row[5];
258 }
259
260 if (null != row[6])
261 {
262 webAppPool.RecycleRequests = (int)row[6];
263 }
264
265 if (null != row[7])
266 {
267 string[] recycleTimeValues = ((string)row[7]).Split(',');
268
269 foreach (string recycleTimeValue in recycleTimeValues)
270 {
271 IIs.RecycleTime recycleTime = new IIs.RecycleTime();
272
273 recycleTime.Value = recycleTimeValue;
274
275 webAppPool.AddChild(recycleTime);
276 }
277 }
278
279 if (null != row[8])
280 {
281 webAppPool.IdleTimeout = (int)row[8];
282 }
283
284 if (null != row[9])
285 {
286 webAppPool.QueueLimit = (int)row[9];
287 }
288
289 if (null != row[10])
290 {
291 string[] cpuMon = ((string)row[10]).Split(',');
292
293 if (0 < cpuMon.Length && "0" != cpuMon[0])
294 {
295 webAppPool.MaxCpuUsage = Convert.ToInt32(cpuMon[0], CultureInfo.InvariantCulture);
296 }
297
298 if (1 < cpuMon.Length)
299 {
300 webAppPool.RefreshCpu = Convert.ToInt32(cpuMon[1], CultureInfo.InvariantCulture);
301 }
302
303 if (2 < cpuMon.Length)
304 {
305 switch (Convert.ToInt32(cpuMon[2], CultureInfo.InvariantCulture))
306 {
307 case 0:
308 webAppPool.CpuAction = IIs.WebAppPool.CpuActionType.none;
309 break;
310 case 1:
311 webAppPool.CpuAction = IIs.WebAppPool.CpuActionType.shutdown;
312 break;
313 default:
314 // TODO: warn
315 break;
316 }
317 }
318
319 if (3 < cpuMon.Length)
320 {
321 // TODO: warn
322 }
323 }
324
325 if (null != row[11])
326 {
327 webAppPool.MaxWorkerProcesses = (int)row[11];
328 }
329
330 if (null != row[12])
331 {
332 webAppPool.VirtualMemory = (int)row[12];
333 }
334
335 if (null != row[13])
336 {
337 webAppPool.PrivateMemory = (int)row[13];
338 }
339
340 if (null != row[14])
341 {
342 webAppPool.ManagedRuntimeVersion = (string)row[14];
343 }
344
345 if (null != row[15])
346 {
347 webAppPool.ManagedPipelineMode = (string)row[15];
348 }
349
350 if (null != row[2])
351 {
352 Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[2]);
353
354 if (null != component)
355 {
356 component.AddChild(webAppPool);
357 }
358 else
359 {
360 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[2], "Component"));
361 }
362 }
363 else
364 {
365 this.Core.RootElement.AddChild(webAppPool);
366 }
367 }
368 }
369
370 /// <summary>
371 /// Decompile the IIsProperty table.
372 /// </summary>
373 /// <param name="table">The table to decompile.</param>
374 private void DecompileIIsPropertyTable(Table table)
375 {
376 foreach (Row row in table.Rows)
377 {
378 IIs.WebProperty webProperty = new IIs.WebProperty();
379
380 switch ((string)row[0])
381 {
382 case "ETagChangeNumber":
383 webProperty.Id = IIs.WebProperty.IdType.ETagChangeNumber;
384 break;
385 case "IIs5IsolationMode":
386 webProperty.Id = IIs.WebProperty.IdType.IIs5IsolationMode;
387 break;
388 case "LogInUTF8":
389 webProperty.Id = IIs.WebProperty.IdType.LogInUTF8;
390 break;
391 case "MaxGlobalBandwidth":
392 webProperty.Id = IIs.WebProperty.IdType.MaxGlobalBandwidth;
393 break;
394 }
395
396 if (0 != (int)row[2])
397 {
398 // TODO: warn about value in unused column
399 }
400
401 if (null != row[3])
402 {
403 webProperty.Value = (string)row[3];
404 }
405
406 Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]);
407 if (null != component)
408 {
409 component.AddChild(webProperty);
410 }
411 else
412 {
413 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component"));
414 }
415 }
416 }
417
418 /// <summary>
419 /// Decompile the IIsHttpHeader table.
420 /// </summary>
421 /// <param name="table">The table to decompile.</param>
422 private void DecompileIIsHttpHeaderTable(Table table)
423 {
424 foreach (Row row in table.Rows)
425 {
426 IIs.HttpHeader httpHeader = new IIs.HttpHeader();
427
428 httpHeader.Name = (string)row[3];
429
430 // the ParentType and Parent columns are handled in FinalizeIIsHttpHeaderTable
431
432 httpHeader.Value = (string)row[4];
433
434 this.Core.IndexElement(row, httpHeader);
435 }
436 }
437
438 /// <summary>
439 /// Decompile the IIsMimeMap table.
440 /// </summary>
441 /// <param name="table">The table to decompile.</param>
442 private void DecompileIIsMimeMapTable(Table table)
443 {
444 foreach (Row row in table.Rows)
445 {
446 IIs.MimeMap mimeMap = new IIs.MimeMap();
447
448 mimeMap.Id = (string)row[0];
449
450 // the ParentType and ParentValue columns are handled in FinalizeIIsMimeMapTable
451
452 mimeMap.Type = (string)row[3];
453
454 mimeMap.Extension = (string)row[4];
455
456 this.Core.IndexElement(row, mimeMap);
457 }
458 }
459
460 /// <summary>
461 /// Decompile the IIsWebAddress table.
462 /// </summary>
463 /// <param name="table">The table to decompile.</param>
464 private void DecompileIIsWebAddressTable(Table table)
465 {
466 foreach (Row row in table.Rows)
467 {
468 IIs.WebAddress webAddress = new IIs.WebAddress();
469
470 webAddress.Id = (string)row[0];
471
472 if (null != row[2])
473 {
474 webAddress.IP = (string)row[2];
475 }
476
477 webAddress.Port = (string)row[3];
478
479 if (null != row[4])
480 {
481 webAddress.Header = (string)row[4];
482 }
483
484 if (null != row[5] && 1 == (int)row[5])
485 {
486 webAddress.Secure = IIs.YesNoType.yes;
487 }
488
489 this.Core.IndexElement(row, webAddress);
490 }
491 }
492
493 /// <summary>
494 /// Decompile the IIsWebApplication table.
495 /// </summary>
496 /// <param name="table">The table to decompile.</param>
497 private void DecompileIIsWebApplicationTable(Table table)
498 {
499 foreach (Row row in table.Rows)
500 {
501 IIs.WebApplication webApplication = new IIs.WebApplication();
502
503 webApplication.Id = (string)row[0];
504
505 webApplication.Name = (string)row[1];
506
507 // these are not listed incorrectly - the order is low, high, medium
508 switch ((int)row[2])
509 {
510 case 0:
511 webApplication.Isolation = IIs.WebApplication.IsolationType.low;
512 break;
513 case 1:
514 webApplication.Isolation = IIs.WebApplication.IsolationType.high;
515 break;
516 case 2:
517 webApplication.Isolation = IIs.WebApplication.IsolationType.medium;
518 break;
519 default:
520 // TODO: warn
521 break;
522 }
523
524 if (null != row[3])
525 {
526 switch ((int)row[3])
527 {
528 case 0:
529 webApplication.AllowSessions = IIs.YesNoDefaultType.no;
530 break;
531 case 1:
532 webApplication.AllowSessions = IIs.YesNoDefaultType.yes;
533 break;
534 default:
535 // TODO: warn
536 break;
537 }
538 }
539
540 if (null != row[4])
541 {
542 webApplication.SessionTimeout = (int)row[4];
543 }
544
545 if (null != row[5])
546 {
547 switch ((int)row[5])
548 {
549 case 0:
550 webApplication.Buffer = IIs.YesNoDefaultType.no;
551 break;
552 case 1:
553 webApplication.Buffer = IIs.YesNoDefaultType.yes;
554 break;
555 default:
556 // TODO: warn
557 break;
558 }
559 }
560
561 if (null != row[6])
562 {
563 switch ((int)row[6])
564 {
565 case 0:
566 webApplication.ParentPaths = IIs.YesNoDefaultType.no;
567 break;
568 case 1:
569 webApplication.ParentPaths = IIs.YesNoDefaultType.yes;
570 break;
571 default:
572 // TODO: warn
573 break;
574 }
575 }
576
577 if (null != row[7])
578 {
579 switch ((string)row[7])
580 {
581 case "JScript":
582 webApplication.DefaultScript = IIs.WebApplication.DefaultScriptType.JScript;
583 break;
584 case "VBScript":
585 webApplication.DefaultScript = IIs.WebApplication.DefaultScriptType.VBScript;
586 break;
587 default:
588 // TODO: warn
589 break;
590 }
591 }
592
593 if (null != row[8])
594 {
595 webApplication.ScriptTimeout = (int)row[8];
596 }
597
598 if (null != row[9])
599 {
600 switch ((int)row[9])
601 {
602 case 0:
603 webApplication.ServerDebugging = IIs.YesNoDefaultType.no;
604 break;
605 case 1:
606 webApplication.ServerDebugging = IIs.YesNoDefaultType.yes;
607 break;
608 default:
609 // TODO: warn
610 break;
611 }
612 }
613
614 if (null != row[10])
615 {
616 switch ((int)row[10])
617 {
618 case 0:
619 webApplication.ClientDebugging = IIs.YesNoDefaultType.no;
620 break;
621 case 1:
622 webApplication.ClientDebugging = IIs.YesNoDefaultType.yes;
623 break;
624 default:
625 // TODO: warn
626 break;
627 }
628 }
629
630 if (null != row[11])
631 {
632 webApplication.WebAppPool = (string)row[11];
633 }
634
635 this.Core.IndexElement(row, webApplication);
636 }
637 }
638
639 /// <summary>
640 /// Decompile the IIsWebDirProperties table.
641 /// </summary>
642 /// <param name="table">The table to decompile.</param>
643 private void DecompileIIsWebDirPropertiesTable(Table table)
644 {
645 foreach (Row row in table.Rows)
646 {
647 IIs.WebDirProperties webDirProperties = new IIs.WebDirProperties();
648
649 webDirProperties.Id = (string)row[0];
650
651 if (null != row[1])
652 {
653 int access = (int)row[1];
654
655 if (0x1 == (access & 0x1))
656 {
657 webDirProperties.Read = IIs.YesNoType.yes;
658 }
659
660 if (0x2 == (access & 0x2))
661 {
662 webDirProperties.Write = IIs.YesNoType.yes;
663 }
664
665 if (0x4 == (access & 0x4))
666 {
667 webDirProperties.Execute = IIs.YesNoType.yes;
668 }
669
670 if (0x200 == (access & 0x200))
671 {
672 webDirProperties.Script = IIs.YesNoType.yes;
673 }
674 }
675
676 if (null != row[2])
677 {
678 int authorization = (int)row[2];
679
680 if (0x1 == (authorization & 0x1))
681 {
682 webDirProperties.AnonymousAccess = IIs.YesNoType.yes;
683 }
684 else // set one of the properties to 'no' to force the output value to be '0' if not other attributes are set
685 {
686 webDirProperties.AnonymousAccess = IIs.YesNoType.no;
687 }
688
689 if (0x2 == (authorization & 0x2))
690 {
691 webDirProperties.BasicAuthentication = IIs.YesNoType.yes;
692 }
693
694 if (0x4 == (authorization & 0x4))
695 {
696 webDirProperties.WindowsAuthentication = IIs.YesNoType.yes;
697 }
698
699 if (0x10 == (authorization & 0x10))
700 {
701 webDirProperties.DigestAuthentication = IIs.YesNoType.yes;
702 }
703
704 if (0x40 == (authorization & 0x40))
705 {
706 webDirProperties.PassportAuthentication = IIs.YesNoType.yes;
707 }
708 }
709
710 if (null != row[3])
711 {
712 webDirProperties.AnonymousUser = (string)row[3];
713 }
714
715 if (null != row[4] && 1 == (int)row[4])
716 {
717 webDirProperties.IIsControlledPassword = IIs.YesNoType.yes;
718 }
719
720 if (null != row[5])
721 {
722 switch ((int)row[5])
723 {
724 case 0:
725 webDirProperties.LogVisits = IIs.YesNoType.no;
726 break;
727 case 1:
728 webDirProperties.LogVisits = IIs.YesNoType.yes;
729 break;
730 default:
731 // TODO: warn
732 break;
733 }
734 }
735
736 if (null != row[6])
737 {
738 switch ((int)row[6])
739 {
740 case 0:
741 webDirProperties.Index = IIs.YesNoType.no;
742 break;
743 case 1:
744 webDirProperties.Index = IIs.YesNoType.yes;
745 break;
746 default:
747 // TODO: warn
748 break;
749 }
750 }
751
752 if (null != row[7])
753 {
754 webDirProperties.DefaultDocuments = (string)row[7];
755 }
756
757 if (null != row[8])
758 {
759 switch ((int)row[8])
760 {
761 case 0:
762 webDirProperties.AspDetailedError = IIs.YesNoType.no;
763 break;
764 case 1:
765 webDirProperties.AspDetailedError = IIs.YesNoType.yes;
766 break;
767 default:
768 // TODO: warn
769 break;
770 }
771 }
772
773 if (null != row[9])
774 {
775 webDirProperties.HttpExpires = (string)row[9];
776 }
777
778 if (null != row[10])
779 {
780 // force the value to be a positive number
781 webDirProperties.CacheControlMaxAge = unchecked((uint)(int)row[10]);
782 }
783
784 if (null != row[11])
785 {
786 webDirProperties.CacheControlCustom = (string)row[11];
787 }
788
789 if (null != row[12])
790 {
791 switch ((int)row[8])
792 {
793 case 0:
794 webDirProperties.ClearCustomError = IIs.YesNoType.no;
795 break;
796 case 1:
797 webDirProperties.ClearCustomError = IIs.YesNoType.yes;
798 break;
799 default:
800 // TODO: warn
801 break;
802 }
803 }
804
805 if (null != row[13])
806 {
807 int accessSSLFlags = (int)row[13];
808
809 if (0x8 == (accessSSLFlags & 0x8))
810 {
811 webDirProperties.AccessSSL = IIs.YesNoType.yes;
812 }
813
814 if (0x20 == (accessSSLFlags & 0x20))
815 {
816 webDirProperties.AccessSSLNegotiateCert = IIs.YesNoType.yes;
817 }
818
819 if (0x40 == (accessSSLFlags & 0x40))
820 {
821 webDirProperties.AccessSSLRequireCert = IIs.YesNoType.yes;
822 }
823
824 if (0x80 == (accessSSLFlags & 0x80))
825 {
826 webDirProperties.AccessSSLMapCert = IIs.YesNoType.yes;
827 }
828
829 if (0x100 == (accessSSLFlags & 0x100))
830 {
831 webDirProperties.AccessSSL128 = IIs.YesNoType.yes;
832 }
833 }
834
835 if (null != row[14])
836 {
837 webDirProperties.AuthenticationProviders = (string)row[14];
838 }
839
840 this.Core.RootElement.AddChild(webDirProperties);
841 }
842 }
843
844 /// <summary>
845 /// Decompile the IIsWebError table.
846 /// </summary>
847 /// <param name="table">The table to decompile.</param>
848 private void DecompileIIsWebErrorTable(Table table)
849 {
850 foreach (Row row in table.Rows)
851 {
852 IIs.WebError webError = new IIs.WebError();
853
854 webError.ErrorCode = (int)row[0];
855
856 webError.SubCode = (int)row[1];
857
858 // the ParentType and ParentValue columns are handled in FinalizeIIsWebErrorTable
859
860 if (null != row[4])
861 {
862 webError.File = (string)row[4];
863 }
864
865 if (null != row[5])
866 {
867 webError.URL = (string)row[5];
868 }
869
870 this.Core.IndexElement(row, webError);
871 }
872 }
873
874 /// <summary>
875 /// Decompile the IIsFilter table.
876 /// </summary>
877 /// <param name="table">The table to decompile.</param>
878 private void DecompileIIsFilterTable(Table table)
879 {
880 foreach (Row row in table.Rows)
881 {
882 IIs.WebFilter webFilter = new IIs.WebFilter();
883
884 webFilter.Id = (string)row[0];
885
886 webFilter.Name = (string)row[1];
887
888 if (null != row[3])
889 {
890 webFilter.Path = (string)row[3];
891 }
892
893 if (null != row[5])
894 {
895 webFilter.Description = (string)row[5];
896 }
897
898 webFilter.Flags = (int)row[6];
899
900 if (null != row[7])
901 {
902 switch ((int)row[7])
903 {
904 case (-1):
905 webFilter.LoadOrder = "last";
906 break;
907 case 0:
908 webFilter.LoadOrder = "first";
909 break;
910 default:
911 webFilter.LoadOrder = Convert.ToString((int)row[7], CultureInfo.InvariantCulture);
912 break;
913 }
914 }
915
916 if (null != row[4])
917 {
918 IIs.WebSite webSite = (IIs.WebSite)this.Core.GetIndexedElement("IIsWebSite", (string)row[4]);
919
920 if (null != webSite)
921 {
922 webSite.AddChild(webFilter);
923 }
924 else
925 {
926 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Web_", (string)row[4], "IIsWebSite"));
927 }
928 }
929 else // Component parent
930 {
931 Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[2]);
932
933 if (null != component)
934 {
935 component.AddChild(webFilter);
936 }
937 else
938 {
939 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[2], "Component"));
940 }
941 }
942 }
943 }
944
945 /// <summary>
946 /// Decompile the IIsWebLog table.
947 /// </summary>
948 /// <param name="table">The table to decompile.</param>
949 private void DecompileIIsWebLogTable(Table table)
950 {
951 foreach (Row row in table.Rows)
952 {
953 IIs.WebLog webLog = new IIs.WebLog();
954
955 webLog.Id = (string)row[0];
956
957 switch ((string)row[1])
958 {
959 case "Microsoft IIS Log File Format":
960 webLog.Type = IIs.WebLog.TypeType.IIS;
961 break;
962 case "NCSA Common Log File Format":
963 webLog.Type = IIs.WebLog.TypeType.NCSA;
964 break;
965 case "none":
966 webLog.Type = IIs.WebLog.TypeType.none;
967 break;
968 case "ODBC Logging":
969 webLog.Type = IIs.WebLog.TypeType.ODBC;
970 break;
971 case "W3C Extended Log File Format":
972 webLog.Type = IIs.WebLog.TypeType.W3C;
973 break;
974 default:
975 // TODO: warn
976 break;
977 }
978
979 this.Core.RootElement.AddChild(webLog);
980 }
981 }
982
983 /// <summary>
984 /// Decompile the IIsWebServiceExtension table.
985 /// </summary>
986 /// <param name="table">The table to decompile.</param>
987 private void DecompileIIsWebServiceExtensionTable(Table table)
988 {
989 foreach (Row row in table.Rows)
990 {
991 IIs.WebServiceExtension webServiceExtension = new IIs.WebServiceExtension();
992
993 webServiceExtension.Id = (string)row[0];
994
995 webServiceExtension.File = (string)row[2];
996
997 if (null != row[3])
998 {
999 webServiceExtension.Description = (string)row[3];
1000 }
1001
1002 if (null != row[4])
1003 {
1004 webServiceExtension.Group = (string)row[4];
1005 }
1006
1007 int attributes = (int)row[5];
1008
1009 if (0x1 == (attributes & 0x1))
1010 {
1011 webServiceExtension.Allow = IIs.YesNoType.yes;
1012 }
1013 else
1014 {
1015 webServiceExtension.Allow = IIs.YesNoType.no;
1016 }
1017
1018 if (0x2 == (attributes & 0x2))
1019 {
1020 webServiceExtension.UIDeletable = IIs.YesNoType.yes;
1021 }
1022
1023 Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]);
1024 if (null != component)
1025 {
1026 component.AddChild(webServiceExtension);
1027 }
1028 else
1029 {
1030 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component"));
1031 }
1032 }
1033 }
1034
1035 /// <summary>
1036 /// Decompile the IIsWebSite table.
1037 /// </summary>
1038 /// <param name="table">The table to decompile.</param>
1039 private void DecompileIIsWebSiteTable(Table table)
1040 {
1041 foreach (Row row in table.Rows)
1042 {
1043 IIs.WebSite webSite = new IIs.WebSite();
1044
1045 webSite.Id = (string)row[0];
1046
1047 if (null != row[2])
1048 {
1049 webSite.Description = (string)row[2];
1050 }
1051
1052 if (null != row[3])
1053 {
1054 webSite.ConnectionTimeout = (int)row[3];
1055 }
1056
1057 if (null != row[4])
1058 {
1059 webSite.Directory = (string)row[4];
1060 }
1061
1062 if (null != row[5])
1063 {
1064 switch ((int)row[5])
1065 {
1066 case 0:
1067 // this is the default
1068 break;
1069 case 1:
1070 webSite.StartOnInstall = IIs.YesNoType.yes;
1071 break;
1072 case 2:
1073 webSite.AutoStart = IIs.YesNoType.yes;
1074 break;
1075 default:
1076 // TODO: warn
1077 break;
1078 }
1079 }
1080
1081 if (null != row[6])
1082 {
1083 int attributes = (int)row[6];
1084
1085 if (0x2 == (attributes & 0x2))
1086 {
1087 webSite.ConfigureIfExists = IIs.YesNoType.no;
1088 }
1089 }
1090
1091 // the KeyAddress_ column is handled in FinalizeWebAddressTable
1092
1093 if (null != row[8])
1094 {
1095 webSite.DirProperties = (string)row[8];
1096 }
1097
1098 // the Application_ column is handled in FinalizeIIsWebApplicationTable
1099
1100 if (null != row[10])
1101 {
1102 if (-1 != (int)row[10])
1103 {
1104 webSite.Sequence = (int)row[10];
1105 }
1106 }
1107
1108 if (null != row[11])
1109 {
1110 webSite.WebLog = (string)row[11];
1111 }
1112
1113 if (null != row[12])
1114 {
1115 webSite.SiteId = (string)row[12];
1116 }
1117
1118 if (null != row[1])
1119 {
1120 Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]);
1121
1122 if (null != component)
1123 {
1124 component.AddChild(webSite);
1125 }
1126 else
1127 {
1128 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component"));
1129 }
1130 }
1131 else
1132 {
1133 this.Core.RootElement.AddChild(webSite);
1134 }
1135 this.Core.IndexElement(row, webSite);
1136 }
1137 }
1138
1139 /// <summary>
1140 /// Decompile the IIsWebVirtualDir table.
1141 /// </summary>
1142 /// <param name="table">The table to decompile.</param>
1143 private void DecompileIIsWebVirtualDirTable(Table table)
1144 {
1145 foreach (Row row in table.Rows)
1146 {
1147 IIs.WebVirtualDir webVirtualDir = new IIs.WebVirtualDir();
1148
1149 webVirtualDir.Id = (string)row[0];
1150
1151 // the Component_ and Web_ columns are handled in FinalizeIIsWebVirtualDirTable
1152
1153 webVirtualDir.Alias = (string)row[3];
1154
1155 webVirtualDir.Directory = (string)row[4];
1156
1157 if (null != row[5])
1158 {
1159 webVirtualDir.DirProperties = (string)row[5];
1160 }
1161
1162 // the Application_ column is handled in FinalizeIIsWebApplicationTable
1163
1164 this.Core.IndexElement(row, webVirtualDir);
1165 }
1166 }
1167
1168 /// <summary>
1169 /// Decompile the IIsWebSiteCertificates table.
1170 /// </summary>
1171 /// <param name="table">The table to decompile.</param>
1172 private void DecompileIIsWebSiteCertificatesTable(Table table)
1173 {
1174 foreach (Row row in table.Rows)
1175 {
1176 IIs.CertificateRef certificateRef = new IIs.CertificateRef();
1177
1178 certificateRef.Id = (string)row[1];
1179
1180 this.Core.IndexElement(row, certificateRef);
1181 }
1182 }
1183
1184 /// <summary>
1185 /// Finalize the IIsHttpHeader table.
1186 /// </summary>
1187 /// <param name="tables">The collection of all tables.</param>
1188 /// <remarks>
1189 /// The IIsHttpHeader table supports multiple parent types so no foreign key
1190 /// is declared and thus nesting must be done late.
1191 /// </remarks>
1192 private void FinalizeIIsHttpHeaderTable(TableIndexedCollection tables)
1193 {
1194 Table iisHttpHeaderTable = tables["IIsHttpHeader"];
1195
1196 if (null != iisHttpHeaderTable)
1197 {
1198 foreach (Row row in iisHttpHeaderTable.Rows)
1199 {
1200 IIs.HttpHeader httpHeader = (IIs.HttpHeader)this.Core.GetIndexedElement(row);
1201
1202 if (1 == (int)row[1])
1203 {
1204 IIs.WebVirtualDir webVirtualDir = (IIs.WebVirtualDir)this.Core.GetIndexedElement("IIsWebVirtualDir", (string)row[2]);
1205 if (null != webVirtualDir)
1206 {
1207 webVirtualDir.AddChild(httpHeader);
1208 }
1209 else
1210 {
1211 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, iisHttpHeaderTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "ParentValue", (string)row[2], "IIsWebVirtualDir"));
1212 }
1213 }
1214 else if (2 == (int)row[1])
1215 {
1216 IIs.WebSite webSite = (IIs.WebSite)this.Core.GetIndexedElement("IIsWebSite", (string)row[2]);
1217 if (null != webSite)
1218 {
1219 webSite.AddChild(httpHeader);
1220 }
1221 else
1222 {
1223 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, iisHttpHeaderTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "ParentValue", (string)row[2], "IIsWebSite"));
1224 }
1225 }
1226 }
1227 }
1228 }
1229
1230 /// <summary>
1231 /// Finalize the IIsMimeMap table.
1232 /// </summary>
1233 /// <param name="tables">The collection of all tables.</param>
1234 /// <remarks>
1235 /// The IIsMimeMap table supports multiple parent types so no foreign key
1236 /// is declared and thus nesting must be done late.
1237 /// </remarks>
1238 private void FinalizeIIsMimeMapTable(TableIndexedCollection tables)
1239 {
1240 Table iisMimeMapTable = tables["IIsMimeMap"];
1241
1242 if (null != iisMimeMapTable)
1243 {
1244 foreach (Row row in iisMimeMapTable.Rows)
1245 {
1246 IIs.MimeMap mimeMap = (IIs.MimeMap)this.Core.GetIndexedElement(row);
1247
1248 if (2 < (int)row[1] || 0 >= (int)row[1])
1249 {
1250 // TODO: warn about unknown parent type
1251 }
1252
1253 IIs.WebVirtualDir webVirtualDir = (IIs.WebVirtualDir)this.Core.GetIndexedElement("IIsWebVirtualDir", (string)row[2]);
1254 IIs.WebSite webSite = (IIs.WebSite)this.Core.GetIndexedElement("IIsWebSite", (string)row[2]);
1255 if (null != webVirtualDir)
1256 {
1257 webVirtualDir.AddChild(mimeMap);
1258 }
1259 else if (null != webSite)
1260 {
1261 webSite.AddChild(mimeMap);
1262 }
1263 else
1264 {
1265 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, iisMimeMapTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "ParentValue", (string)row[2], "IIsWebVirtualDir"));
1266 }
1267 }
1268 }
1269 }
1270
1271 /// <summary>
1272 /// Finalize the IIsWebApplication table.
1273 /// </summary>
1274 /// <param name="tables">The collection of all tables.</param>
1275 /// <remarks>
1276 /// Since WebApplication elements may nest under a specific WebSite or
1277 /// WebVirtualDir (or just the root element), the nesting must be done late.
1278 /// </remarks>
1279 private void FinalizeIIsWebApplicationTable(TableIndexedCollection tables)
1280 {
1281 Table iisWebApplicationTable = tables["IIsWebApplication"];
1282 Table iisWebSiteTable = tables["IIsWebSite"];
1283 Table iisWebVirtualDirTable = tables["IIsWebVirtualDir"];
1284
1285 Hashtable addedWebApplications = new Hashtable();
1286
1287 if (null != iisWebSiteTable)
1288 {
1289 foreach (Row row in iisWebSiteTable.Rows)
1290 {
1291 if (null != row[9])
1292 {
1293 IIs.WebSite webSite = (IIs.WebSite)this.Core.GetIndexedElement(row);
1294
1295 IIs.WebApplication webApplication = (IIs.WebApplication)this.Core.GetIndexedElement("IIsWebApplication", (string)row[9]);
1296 if (null != webApplication)
1297 {
1298 webSite.AddChild(webApplication);
1299 addedWebApplications[webApplication] = null;
1300 }
1301 else
1302 {
1303 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, iisWebSiteTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Application_", (string)row[9], "IIsWebApplication"));
1304 }
1305 }
1306 }
1307 }
1308
1309 if (null != iisWebVirtualDirTable)
1310 {
1311 foreach (Row row in iisWebVirtualDirTable.Rows)
1312 {
1313 if (null != row[6])
1314 {
1315 IIs.WebVirtualDir webVirtualDir = (IIs.WebVirtualDir)this.Core.GetIndexedElement(row);
1316
1317 IIs.WebApplication webApplication = (IIs.WebApplication)this.Core.GetIndexedElement("IIsWebApplication", (string)row[6]);
1318 if (null != webApplication)
1319 {
1320 webVirtualDir.AddChild(webApplication);
1321 addedWebApplications[webApplication] = null;
1322 }
1323 else
1324 {
1325 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, iisWebVirtualDirTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Application_", (string)row[6], "IIsWebApplication"));
1326 }
1327 }
1328 }
1329 }
1330
1331 if (null != iisWebApplicationTable)
1332 {
1333 foreach (Row row in iisWebApplicationTable.Rows)
1334 {
1335 IIs.WebApplication webApplication = (IIs.WebApplication)this.Core.GetIndexedElement(row);
1336
1337 if (!addedWebApplications.Contains(webApplication))
1338 {
1339 this.Core.RootElement.AddChild(webApplication);
1340 }
1341 }
1342 }
1343 }
1344
1345 /// <summary>
1346 /// Finalize the IIsWebError table.
1347 /// </summary>
1348 /// <param name="tables">The collection of all tables.</param>
1349 /// <remarks>
1350 /// Since there is no foreign key relationship declared for this table
1351 /// (because it takes various parent types), it must be nested late.
1352 /// </remarks>
1353 private void FinalizeIIsWebErrorTable(TableIndexedCollection tables)
1354 {
1355 Table iisWebErrorTable = tables["IIsWebError"];
1356
1357 if (null != iisWebErrorTable)
1358 {
1359 foreach (Row row in iisWebErrorTable.Rows)
1360 {
1361 IIs.WebError webError = (IIs.WebError)this.Core.GetIndexedElement(row);
1362
1363 if (1 == (int)row[2]) // WebVirtualDir parent
1364 {
1365 IIs.WebVirtualDir webVirtualDir = (IIs.WebVirtualDir)this.Core.GetIndexedElement("IIsWebVirtualDir", (string)row[3]);
1366
1367 if (null != webVirtualDir)
1368 {
1369 webVirtualDir.AddChild(webError);
1370 }
1371 else
1372 {
1373 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, iisWebErrorTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "ParentValue", (string)row[3], "IIsWebVirtualDir"));
1374 }
1375 }
1376 else if (2 == (int)row[2]) // WebSite parent
1377 {
1378 IIs.WebSite webSite = (IIs.WebSite)this.Core.GetIndexedElement("IIsWebSite", (string)row[3]);
1379
1380 if (null != webSite)
1381 {
1382 webSite.AddChild(webError);
1383 }
1384 else
1385 {
1386 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, iisWebErrorTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "ParentValue", (string)row[3], "IIsWebSite"));
1387 }
1388 }
1389 else
1390 {
1391 // TODO: warn unknown parent type
1392 }
1393 }
1394 }
1395 }
1396
1397 /// <summary>
1398 /// Finalize the IIsWebVirtualDir table.
1399 /// </summary>
1400 /// <param name="tables">The collection of all tables.</param>
1401 /// <remarks>
1402 /// WebVirtualDir elements nest under either a WebSite or component
1403 /// depending upon whether the component in the IIsWebVirtualDir row
1404 /// is the same as the one in the parent IIsWebSite row.
1405 /// </remarks>
1406 private void FinalizeIIsWebVirtualDirTable(TableIndexedCollection tables)
1407 {
1408 Table iisWebSiteTable = tables["IIsWebSite"];
1409 Table iisWebVirtualDirTable = tables["IIsWebVirtualDir"];
1410
1411 Hashtable iisWebSiteRows = new Hashtable();
1412
1413 // index the IIsWebSite rows by their primary keys
1414 if (null != iisWebSiteTable)
1415 {
1416 foreach (Row row in iisWebSiteTable.Rows)
1417 {
1418 iisWebSiteRows.Add(row[0], row);
1419 }
1420 }
1421
1422 if (null != iisWebVirtualDirTable)
1423 {
1424 foreach (Row row in iisWebVirtualDirTable.Rows)
1425 {
1426 IIs.WebVirtualDir webVirtualDir = (IIs.WebVirtualDir)this.Core.GetIndexedElement(row);
1427 Row iisWebSiteRow = (Row)iisWebSiteRows[row[2]];
1428
1429 if (null != iisWebSiteRow)
1430 {
1431 if ((string)iisWebSiteRow[1] == (string)row[1])
1432 {
1433 IIs.WebSite webSite = (IIs.WebSite)this.Core.GetIndexedElement(iisWebSiteRow);
1434
1435 webSite.AddChild(webVirtualDir);
1436 }
1437 else
1438 {
1439 Wix.Component component = (Wix.Component)this.Core.GetIndexedElement("Component", (string)row[1]);
1440
1441 if (null != component)
1442 {
1443 webVirtualDir.WebSite = (string)row[2];
1444 component.AddChild(webVirtualDir);
1445 }
1446 else
1447 {
1448 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, iisWebVirtualDirTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Component_", (string)row[1], "Component"));
1449 }
1450 }
1451 }
1452 else
1453 {
1454 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, iisWebVirtualDirTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Web_", (string)row[2], "IIsWebSite"));
1455 }
1456 }
1457 }
1458 }
1459
1460 /// <summary>
1461 /// Finalize the IIsWebSiteCertificates table.
1462 /// </summary>
1463 /// <param name="tables">The collection of all tables.</param>
1464 /// <remarks>
1465 /// This table creates CertificateRef elements which nest under WebSite
1466 /// elements.
1467 /// </remarks>
1468 private void FinalizeIIsWebSiteCertificatesTable(TableIndexedCollection tables)
1469 {
1470 Table IIsWebSiteCertificatesTable = tables["IIsWebSiteCertificates"];
1471
1472 if (null != IIsWebSiteCertificatesTable)
1473 {
1474 foreach (Row row in IIsWebSiteCertificatesTable.Rows)
1475 {
1476 IIs.CertificateRef certificateRef = (IIs.CertificateRef)this.Core.GetIndexedElement(row);
1477 IIs.WebSite webSite = (IIs.WebSite)this.Core.GetIndexedElement("IIsWebSite", (string)row[0]);
1478
1479 if (null != webSite)
1480 {
1481 webSite.AddChild(certificateRef);
1482 }
1483 else
1484 {
1485 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, IIsWebSiteCertificatesTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Web_", (string)row[0], "IIsWebSite"));
1486 }
1487 }
1488 }
1489 }
1490
1491 /// <summary>
1492 /// Finalize the WebAddress table.
1493 /// </summary>
1494 /// <param name="tables">The collection of all tables.</param>
1495 /// <remarks>
1496 /// There is a circular dependency between the WebAddress and WebSite
1497 /// tables, so nesting must be handled here.
1498 /// </remarks>
1499 private void FinalizeWebAddressTable(TableIndexedCollection tables)
1500 {
1501 Table iisWebAddressTable = tables["IIsWebAddress"];
1502 Table iisWebSiteTable = tables["IIsWebSite"];
1503
1504 Hashtable addedWebAddresses = new Hashtable();
1505
1506 if (null != iisWebSiteTable)
1507 {
1508 foreach (Row row in iisWebSiteTable.Rows)
1509 {
1510 IIs.WebSite webSite = (IIs.WebSite)this.Core.GetIndexedElement(row);
1511
1512 IIs.WebAddress webAddress = (IIs.WebAddress)this.Core.GetIndexedElement("IIsWebAddress", (string)row[7]);
1513 if (null != webAddress)
1514 {
1515 webSite.AddChild(webAddress);
1516 addedWebAddresses[webAddress] = null;
1517 }
1518 else
1519 {
1520 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, iisWebSiteTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "KeyAddress_", (string)row[7], "IIsWebAddress"));
1521 }
1522 }
1523 }
1524
1525 if (null != iisWebAddressTable)
1526 {
1527 foreach (Row row in iisWebAddressTable.Rows)
1528 {
1529 IIs.WebAddress webAddress = (IIs.WebAddress)this.Core.GetIndexedElement(row);
1530
1531 if (!addedWebAddresses.Contains(webAddress))
1532 {
1533 IIs.WebSite webSite = (IIs.WebSite)this.Core.GetIndexedElement("IIsWebSite", (string)row[1]);
1534
1535 if (null != webSite)
1536 {
1537 webSite.AddChild(webAddress);
1538 }
1539 else
1540 {
1541 this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, iisWebAddressTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Web_", (string)row[1], "IIsWebSite"));
1542 }
1543 }
1544 }
1545 }
1546 }
1547 }
1548#endif
1549}
diff --git a/src/ext/Iis/wixext/IIsExtensionData.cs b/src/ext/Iis/wixext/IIsExtensionData.cs
new file mode 100644
index 00000000..6a0e1f09
--- /dev/null
+++ b/src/ext/Iis/wixext/IIsExtensionData.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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Extensibility;
7
8 /// <summary>
9 /// The WiX Toolset Internet Information Services Extension.
10 /// </summary>
11 public sealed class IIsExtensionData : BaseExtensionData
12 {
13 /// <summary>
14 /// Gets the default culture.
15 /// </summary>
16 /// <value>The default culture.</value>
17 public override string DefaultCulture => "en-US";
18
19 public override bool TryGetSymbolDefinitionByName(string name, out IntermediateSymbolDefinition symbolDefinition)
20 {
21 symbolDefinition = IisSymbolDefinitions.ByName(name);
22 return symbolDefinition != null;
23 }
24
25 public override Intermediate GetLibrary(ISymbolDefinitionCreator symbolDefinitions)
26 {
27 return Intermediate.Load(typeof(IIsExtensionData).Assembly, "WixToolset.Iis.iis.wixlib", symbolDefinitions);
28 }
29 }
30}
diff --git a/src/ext/Iis/wixext/IisErrors.cs b/src/ext/Iis/wixext/IisErrors.cs
new file mode 100644
index 00000000..2f226217
--- /dev/null
+++ b/src/ext/Iis/wixext/IisErrors.cs
@@ -0,0 +1,78 @@
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 IIsErrors
9 {
10 public static Message DeprecatedBinaryChildElement(SourceLineNumber sourceLineNumbers, string elementName)
11 {
12 return Message(sourceLineNumbers, Ids.DeprecatedBinaryChildElement, "The {0} element contains a deprecated child Binary element. Please move the Binary element under a Fragment, Module, or Product element and set the {0}/@BinaryKey attribute to the value of the Binary/@Id attribute.", elementName);
13 }
14
15 public static Message IllegalAttributeWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName)
16 {
17 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);
18 }
19
20 public static Message IllegalCharacterInAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, Char illegalCharacter)
21 {
22 return Message(sourceLineNumbers, Ids.IllegalCharacterInAttributeValue, "The {0}/@{1} attribute's value, '{2}', is invalid. It cannot contain the character '{3}'.", elementName, attributeName, value, illegalCharacter);
23 }
24
25 public static Message IllegalElementWithoutComponent(SourceLineNumber sourceLineNumbers, string elementName)
26 {
27 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);
28 }
29
30 public static Message MimeMapExtensionMissingPeriod(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue)
31 {
32 return Message(sourceLineNumbers, Ids.MimeMapExtensionMissingPeriod, "The {0}/@{1} attribute's value, '{2}', is not a valid mime map extension. It must begin with a period.", elementName, attributeName, attributeValue);
33 }
34
35 public static Message OneOfAttributesRequiredUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string attributeName3, string attributeName4)
36 {
37 return Message(sourceLineNumbers, Ids.OneOfAttributesRequiredUnderComponent, "When nested under a Component, the {0} element must have one of the following attributes specified: {1}, {2}, {3} or {4}.", elementName, attributeName1, attributeName2, attributeName3, attributeName4);
38 }
39
40 public static Message RequiredAttributeUnderComponent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName)
41 {
42 return Message(sourceLineNumbers, Ids.RequiredAttributeUnderComponent, "The {0}/@{1} attribute must be specified when the element has a Component as an ancestor.", elementName, attributeName);
43 }
44
45 public static Message WebApplicationAlreadySpecified(SourceLineNumber sourceLineNumbers, string elementName)
46 {
47 return Message(sourceLineNumbers, Ids.WebApplicationAlreadySpecified, "The {0} element can have at most a single WebApplication specified. This can be either through the WebApplication attribute, or through a nested WebApplication element, but not both.", elementName);
48 }
49
50 public static Message WebSiteAttributeUnderWebSite(SourceLineNumber sourceLineNumbers, string elementName)
51 {
52 return Message(sourceLineNumbers, Ids.WebSiteAttributeUnderWebSite, "The {0}/@WebSite attribute cannot be specified when the {0} element is nested under a WebSite element.", elementName);
53 }
54
55 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args)
56 {
57 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args);
58 }
59
60 private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args)
61 {
62 return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args);
63 }
64
65 public enum Ids
66 {
67 MimeMapExtensionMissingPeriod = 5150,
68 IllegalAttributeWithoutComponent = 5151,
69 IllegalElementWithoutComponent = 5152,
70 OneOfAttributesRequiredUnderComponent = 5153,
71 WebSiteAttributeUnderWebSite = 5154,
72 WebApplicationAlreadySpecified = 5155,
73 IllegalCharacterInAttributeValue = 5156,
74 DeprecatedBinaryChildElement = 5157,
75 RequiredAttributeUnderComponent = 5161,
76 }
77 }
78}
diff --git a/src/ext/Iis/wixext/IisExtensionFactory.cs b/src/ext/Iis/wixext/IisExtensionFactory.cs
new file mode 100644
index 00000000..2fb7e682
--- /dev/null
+++ b/src/ext/Iis/wixext/IisExtensionFactory.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.Iis
4{
5 using System;
6 using System.Collections.Generic;
7 using WixToolset.Extensibility;
8
9 public class IisExtensionFactory : BaseExtensionFactory
10 {
11 protected override IReadOnlyCollection<Type> ExtensionTypes => new[]
12 {
13 typeof(IIsCompiler),
14 typeof(IIsExtensionData),
15 typeof(IisWindowsInstallerBackendBinderExtension),
16 };
17 }
18}
diff --git a/src/ext/Iis/wixext/IisTableDefinitions.cs b/src/ext/Iis/wixext/IisTableDefinitions.cs
new file mode 100644
index 00000000..f513152e
--- /dev/null
+++ b/src/ext/Iis/wixext/IisTableDefinitions.cs
@@ -0,0 +1,324 @@
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.Iis
4{
5 using WixToolset.Data.WindowsInstaller;
6
7 public static class IisTableDefinitions
8 {
9 public static readonly TableDefinition Certificate = new TableDefinition(
10 "Certificate",
11 IisSymbolDefinitions.Certificate,
12 new[]
13 {
14 new ColumnDefinition("Certificate", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyColumn: 1, description: "Identifier for the certificate in the package.", modularizeType: ColumnModularizeType.Column),
15 new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, description: "Foreign key into the Component table used to determine install state", modularizeType: ColumnModularizeType.Column),
16 new ColumnDefinition("Name", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name to be used for the Certificate."),
17 new ColumnDefinition("StoreLocation", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 1, maxValue: 2, description: "Location of the target certificate store (CurrentUser == 1, LocalMachine == 2)"),
18 new ColumnDefinition("StoreName", ColumnType.String, 64, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name of the target certificate store"),
19 new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "Attributes of the certificate"),
20 new ColumnDefinition("Binary_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "Binary", keyColumn: 1, description: "Identifier to Binary table containing certificate.", modularizeType: ColumnModularizeType.Column),
21 new ColumnDefinition("CertificatePath", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Property to path of certificate.", modularizeType: ColumnModularizeType.Property),
22 new ColumnDefinition("PFXPassword", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Hidden property to a pfx password", modularizeType: ColumnModularizeType.Property),
23 },
24 symbolIdIsPrimaryKey: true
25 );
26
27 public static readonly TableDefinition CertificateHash = new TableDefinition(
28 "CertificateHash",
29 IisSymbolDefinitions.CertificateHash,
30 new[]
31 {
32 new ColumnDefinition("Certificate_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyColumn: 1, description: "Foreign key to certificate in Certificate table.", modularizeType: ColumnModularizeType.Column),
33 new ColumnDefinition("Hash", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Base64 encoded SHA1 hash of certificate populated at run-time."),
34 },
35 symbolIdIsPrimaryKey: false
36 );
37
38 public static readonly TableDefinition IIsWebSiteCertificates = new TableDefinition(
39 "IIsWebSiteCertificates",
40 IisSymbolDefinitions.IIsWebSiteCertificates,
41 new[]
42 {
43 new ColumnDefinition("Web_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "IIsWebSite", keyColumn: 1, description: "The index into the IIsWebSite table.", modularizeType: ColumnModularizeType.Column),
44 new ColumnDefinition("Certificate_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Text, keyTable: "Certificate", keyColumn: 1, description: "The index into the Certificate table.", modularizeType: ColumnModularizeType.Column),
45 },
46 symbolIdIsPrimaryKey: false
47 );
48
49 public static readonly TableDefinition IIsAppPool = new TableDefinition(
50 "IIsAppPool",
51 IisSymbolDefinitions.IIsAppPool,
52 new[]
53 {
54 new ColumnDefinition("AppPool", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token for apppool", modularizeType: ColumnModularizeType.Column),
55 new ColumnDefinition("Name", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name to be used for the IIs AppPool.", modularizeType: ColumnModularizeType.Property),
56 new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key referencing Component that controls the app pool", modularizeType: ColumnModularizeType.Column),
57 new ColumnDefinition("Attributes", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, description: "Attributes of the AppPool"),
58 new ColumnDefinition("User_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "User", keyColumn: 1, description: "User account to run the app pool as", modularizeType: ColumnModularizeType.Column),
59 new ColumnDefinition("RecycleMinutes", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Number of minutes between recycling app pool"),
60 new ColumnDefinition("RecycleRequests", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Number of requests between recycling app pool"),
61 new ColumnDefinition("RecycleTimes", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Times to recycle app pool (comma delimited - i.e. 1:45,13:30)"),
62 new ColumnDefinition("IdleTimeout", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Amount of idle time before shutting down"),
63 new ColumnDefinition("QueueLimit", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Reject requests after queue gets how large"),
64 new ColumnDefinition("CPUMon", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "CPUMon is a comma delimeted list of the following format: <percent CPU usage>,<refress minutes>,<Action>. The values for Action are 1 (Shutdown) and 0 (No Action)."),
65 new ColumnDefinition("MaxProc", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Maximum number of processes to use"),
66 new ColumnDefinition("VirtualMemory", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Amount of virtual memory (in KB) that a worker process can use before the worker process recycles. The maximum value supported for this field is 4,294,967 KB."),
67 new ColumnDefinition("PrivateMemory", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Amount of private memory (in KB) that a worker process can use before the worker process recycles. The maximum value supported for this field is 4,294,967 KB."),
68 new ColumnDefinition("ManagedRuntimeVersion", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Specifies the .NET Framework version to be used by the application pool."),
69 new ColumnDefinition("ManagedPipelineMode", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Specifies the request-processing mode that is used to process requests for managed content."),
70 },
71 symbolIdIsPrimaryKey: true
72 );
73
74 public static readonly TableDefinition IIsMimeMap = new TableDefinition(
75 "IIsMimeMap",
76 IisSymbolDefinitions.IIsMimeMap,
77 new[]
78 {
79 new ColumnDefinition("MimeMap", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token for Mime Map definitions", modularizeType: ColumnModularizeType.Column),
80 new ColumnDefinition("ParentType", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, possibilities: "1;2", description: "Type of parent: 1=vdir 2=website"),
81 new ColumnDefinition("ParentValue", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, description: "Name of the parent value.", modularizeType: ColumnModularizeType.Column),
82 new ColumnDefinition("MimeType", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Mime-type covered by the MimeMap."),
83 new ColumnDefinition("Extension", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Extension covered by the MimeMap."),
84 },
85 symbolIdIsPrimaryKey: true
86 );
87
88 public static readonly TableDefinition IIsProperty = new TableDefinition(
89 "IIsProperty",
90 IisSymbolDefinitions.IIsProperty,
91 new[]
92 {
93 new ColumnDefinition("Property", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Unique name of the IIsProperty"),
94 new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Component that the property is linked to", modularizeType: ColumnModularizeType.Column),
95 new ColumnDefinition("Attributes", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, description: "Attributes of the IIsProperty (unused)"),
96 new ColumnDefinition("Value", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Value of the IIsProperty"),
97 },
98 symbolIdIsPrimaryKey: true
99 );
100
101 public static readonly TableDefinition IIsWebDirProperties = new TableDefinition(
102 "IIsWebDirProperties",
103 IisSymbolDefinitions.IIsWebDirProperties,
104 new[]
105 {
106 new ColumnDefinition("DirProperties", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token for Web Properties", modularizeType: ColumnModularizeType.Column),
107 new ColumnDefinition("Access", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Access rights to the web server"),
108 new ColumnDefinition("Authorization", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Authorization policy to web server (anonymous access, NTLM, etc)"),
109 new ColumnDefinition("AnonymousUser_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "User", keyColumn: 1, description: "Foreign key, User used to log into database", modularizeType: ColumnModularizeType.Column),
110 new ColumnDefinition("IIsControlledPassword", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1", description: "Specifies whether IIs is allowed to set the AnonymousUser_ password"),
111 new ColumnDefinition("LogVisits", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1", description: "Specifies whether IIs tracks all access to the directory"),
112 new ColumnDefinition("Index", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1", description: "Specifies whether IIs searches the directory"),
113 new ColumnDefinition("DefaultDoc", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Comma delimited list of file names to act as a default document"),
114 new ColumnDefinition("AspDetailedError", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1", description: "Specifies whether detailed ASP errors are sent to browser"),
115 new ColumnDefinition("HttpExpires", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Value to set the HttpExpires attribute to for a Web Dir in the metabase"),
116 new ColumnDefinition("CacheControlMaxAge", ColumnType.Number, 4, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Integer value specifying the cache control maximum age value."),
117 new ColumnDefinition("CacheControlCustom", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Custom HTTP 1.1 cache control directives."),
118 new ColumnDefinition("NoCustomError", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1", description: "Specifies whether IIs will return custom errors for this directory."),
119 new ColumnDefinition("AccessSSLFlags", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Specifies AccessSSLFlags IIS metabase property."),
120 new ColumnDefinition("AuthenticationProviders", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Comma delimited list, in order of precedence, of Windows authentication providers that IIS will attempt to use: NTLM, Kerberos, Negotiate, and others."),
121 },
122 symbolIdIsPrimaryKey: true
123 );
124
125 public static readonly TableDefinition IIsWebAddress = new TableDefinition(
126 "IIsWebAddress",
127 IisSymbolDefinitions.IIsWebAddress,
128 new[]
129 {
130 new ColumnDefinition("Address", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token", modularizeType: ColumnModularizeType.Column),
131 new ColumnDefinition("Web_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "IIsWebSite", keyColumn: 1, description: "Foreign key referencing Web that uses the address.", modularizeType: ColumnModularizeType.Column),
132 new ColumnDefinition("IP", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "String representing IP address (#.#.#.#) or NT machine name (fooserver)", modularizeType: ColumnModularizeType.Property),
133 new ColumnDefinition("Port", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Port web site listens on", modularizeType: ColumnModularizeType.Property),
134 new ColumnDefinition("Header", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Special header information for the web site"),
135 new ColumnDefinition("Secure", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1", description: "Specifies whether SSL is used to communicate with web site"),
136 },
137 symbolIdIsPrimaryKey: true
138 );
139
140 public static readonly TableDefinition IIsWebSite = new TableDefinition(
141 "IIsWebSite",
142 IisSymbolDefinitions.IIsWebSite,
143 new[]
144 {
145 new ColumnDefinition("Web", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token", modularizeType: ColumnModularizeType.Column),
146 new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key referencing Component that controls the web site", modularizeType: ColumnModularizeType.Column),
147 new ColumnDefinition("Description", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Description displayed in IIS MMC applet"),
148 new ColumnDefinition("ConnectionTimeout", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Time connection is maintained without activity (in seconds)"),
149 new ColumnDefinition("Directory_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "Directory", keyColumn: 1, description: "Foreign key referencing directory that the web site points at", modularizeType: ColumnModularizeType.Column),
150 new ColumnDefinition("State", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1;2", description: "Sets intial state of web site"),
151 new ColumnDefinition("Attributes", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "2", description: "Control the install behavior of web site"),
152 new ColumnDefinition("KeyAddress_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "IIsWebAddress", keyColumn: 1, description: "Foreign key referencing primary address for the web site", modularizeType: ColumnModularizeType.Column),
153 new ColumnDefinition("DirProperties_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "IIsWebDirProperties", keyColumn: 1, description: "Foreign key referencing possible security information for the web site", modularizeType: ColumnModularizeType.Column),
154 new ColumnDefinition("Application_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "IIsWebApplication", keyColumn: 1, description: "Foreign key referencing possible ASP application for the web site.", modularizeType: ColumnModularizeType.Column),
155 new ColumnDefinition("Sequence", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Allows ordering of web site install"),
156 new ColumnDefinition("Log_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Unknown, keyTable: "IIsWebLog", keyColumn: 1, description: "Foreign key reference to IIsWebLog data", modularizeType: ColumnModularizeType.Column),
157 new ColumnDefinition("Id", ColumnType.String, 74, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Optional number or formatted value that resolves to number that acts as the WebSite Id."),
158 },
159 symbolIdIsPrimaryKey: true
160 );
161
162 public static readonly TableDefinition IIsWebApplication = new TableDefinition(
163 "IIsWebApplication",
164 IisSymbolDefinitions.IIsWebApplication,
165 new[]
166 {
167 new ColumnDefinition("Application", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token for ASP Application", modularizeType: ColumnModularizeType.Column),
168 new ColumnDefinition("Name", ColumnType.Localized, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name of application in IIS MMC applet", modularizeType: ColumnModularizeType.Property),
169 new ColumnDefinition("Isolation", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, possibilities: "0;1;2", description: "Isolation level for ASP Application: 0 == Low, 2 == Medium, 1 == High"),
170 new ColumnDefinition("AllowSessions", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1", description: "Specifies whether application may maintain session state"),
171 new ColumnDefinition("SessionTimeout", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Time session state is maintained without user interaction"),
172 new ColumnDefinition("Buffer", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1", description: "Specifies whether application buffers its output"),
173 new ColumnDefinition("ParentPaths", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1", description: "What is this for anyway?"),
174 new ColumnDefinition("DefaultScript", ColumnType.String, 26, primaryKey: false, nullable: true, ColumnCategory.Text, possibilities: "VBScript;JScript", description: "Default scripting language for ASP applications"),
175 new ColumnDefinition("ScriptTimeout", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Time ASP application page is permitted to process"),
176 new ColumnDefinition("ServerDebugging", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1", description: "Specifies whether to allow ASP server-side script debugging"),
177 new ColumnDefinition("ClientDebugging", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "0;1", description: "Specifies whether to allow ASP client-side script debugging"),
178 new ColumnDefinition("AppPool_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "IIsAppPool", keyColumn: 1, description: "App Pool this application should run under", modularizeType: ColumnModularizeType.Column),
179 },
180 symbolIdIsPrimaryKey: true
181 );
182
183 public static readonly TableDefinition IIsWebApplicationExtension = new TableDefinition(
184 "IIsWebApplicationExtension",
185 IisSymbolDefinitions.IIsWebApplicationExtension,
186 new[]
187 {
188 new ColumnDefinition("Application_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "IIsWebApplication", keyColumn: 1, description: "Foreign key referencing possible ASP application for the web site", modularizeType: ColumnModularizeType.Column),
189 new ColumnDefinition("Extension", ColumnType.String, 255, primaryKey: true, nullable: true, ColumnCategory.Text, description: "Primary key, Extension that should be registered for this ASP application"),
190 new ColumnDefinition("Verbs", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Comma delimited list of HTTP verbs the extension should be registered with"),
191 new ColumnDefinition("Executable", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Path to extension (usually file property: [#file])", modularizeType: ColumnModularizeType.Property),
192 new ColumnDefinition("Attributes", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, possibilities: "1;4;5", description: "Attributes for extension: 1 == Script, 4 == Check Path Info"),
193 },
194 symbolIdIsPrimaryKey: false
195 );
196
197 public static readonly TableDefinition IIsFilter = new TableDefinition(
198 "IIsFilter",
199 IisSymbolDefinitions.IIsFilter,
200 new[]
201 {
202 new ColumnDefinition("Filter", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token", modularizeType: ColumnModularizeType.Column),
203 new ColumnDefinition("Name", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Unknown, description: "Name of the ISAPI Filter in IIS"),
204 new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key referencing Component that controls the filter", modularizeType: ColumnModularizeType.Column),
205 new ColumnDefinition("Path", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Path to filter (usually file property: [#file])", modularizeType: ColumnModularizeType.Property),
206 new ColumnDefinition("Web_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "IIsWebSite", keyColumn: 1, description: "Foreign key referencing web site that loads the filter (NULL == global filter", modularizeType: ColumnModularizeType.Column),
207 new ColumnDefinition("Description", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Description displayed in IIS MMC applet"),
208 new ColumnDefinition("Flags", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "What do all these numbers mean?"),
209 new ColumnDefinition("LoadOrder", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "-1 == last in order, 0 == first in order, # == place in order"),
210 },
211 symbolIdIsPrimaryKey: true
212 );
213
214 public static readonly TableDefinition IIsWebDir = new TableDefinition(
215 "IIsWebDir",
216 IisSymbolDefinitions.IIsWebDir,
217 new[]
218 {
219 new ColumnDefinition("WebDir", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token", modularizeType: ColumnModularizeType.Column),
220 new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key referencing Component that controls the virtual directory", modularizeType: ColumnModularizeType.Column),
221 new ColumnDefinition("Web_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "IIsWebSite", keyColumn: 1, description: "Foreign key referencing web site that controls the virtual directory", modularizeType: ColumnModularizeType.Column),
222 new ColumnDefinition("Path", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name of web directory displayed in IIS MMC applet", modularizeType: ColumnModularizeType.Property),
223 new ColumnDefinition("DirProperties_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "IIsWebDirProperties", keyColumn: 1, description: "Foreign key referencing possible security information for the virtual directory", modularizeType: ColumnModularizeType.Column),
224 new ColumnDefinition("Application_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "IIsWebApplication", keyColumn: 1, description: "Foreign key referencing possible ASP application for the virtual directory. This column is currently unused, but maintained for compatibility reasons.", modularizeType: ColumnModularizeType.Column),
225 },
226 symbolIdIsPrimaryKey: true
227 );
228
229 public static readonly TableDefinition IIsWebError = new TableDefinition(
230 "IIsWebError",
231 IisSymbolDefinitions.IIsWebError,
232 new[]
233 {
234 new ColumnDefinition("ErrorCode", ColumnType.Number, 2, primaryKey: true, nullable: false, ColumnCategory.Unknown, minValue: 400, maxValue: 599, description: "HTTP status code indicating error."),
235 new ColumnDefinition("SubCode", ColumnType.Number, 4, primaryKey: true, nullable: false, ColumnCategory.Unknown, description: "HTTP sub-status code indicating error."),
236 new ColumnDefinition("ParentType", ColumnType.Number, 2, primaryKey: true, nullable: false, ColumnCategory.Unknown, possibilities: "1;2", description: "Type of parent: 1=vdir, 2=web"),
237 new ColumnDefinition("ParentValue", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Name of the parent value.", modularizeType: ColumnModularizeType.Column),
238 new ColumnDefinition("File", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Path to file for this custom error (usually file property: [#file]). Must be null if URL is not null."),
239 new ColumnDefinition("URL", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "URL for this custom error. Must be null if File is not null."),
240 },
241 symbolIdIsPrimaryKey: false
242 );
243
244 public static readonly TableDefinition IIsHttpHeader = new TableDefinition(
245 "IIsHttpHeader",
246 IisSymbolDefinitions.IIsHttpHeader,
247 new[]
248 {
249 new ColumnDefinition("HttpHeader", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token", modularizeType: ColumnModularizeType.Column),
250 new ColumnDefinition("ParentType", ColumnType.Number, 2, primaryKey: true, nullable: false, ColumnCategory.Unknown, possibilities: "1;2", description: "Type of parent: 1=vdir, 2=web"),
251 new ColumnDefinition("ParentValue", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Name of the parent value.", modularizeType: ColumnModularizeType.Column),
252 new ColumnDefinition("Name", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Name of the HTTP Header"),
253 new ColumnDefinition("Value", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "URL for this custom error. Must be null if File is not null."),
254 new ColumnDefinition("Attributes", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 0, description: "Attributes for HTTP Header: none"),
255 new ColumnDefinition("Sequence", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Unknown, description: "Order to add the HTTP Headers."),
256 },
257 symbolIdIsPrimaryKey: false
258 );
259
260 public static readonly TableDefinition IIsWebServiceExtension = new TableDefinition(
261 "IIsWebServiceExtension",
262 IisSymbolDefinitions.IIsWebServiceExtension,
263 new[]
264 {
265 new ColumnDefinition("WebServiceExtension", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token", modularizeType: ColumnModularizeType.Column),
266 new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key referencing Component that controls the WebServiceExtension handler", modularizeType: ColumnModularizeType.Column),
267 new ColumnDefinition("File", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Path to handler (usually file property: [#file])", modularizeType: ColumnModularizeType.Property),
268 new ColumnDefinition("Description", ColumnType.Localized, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Description displayed in WebServiceExtension Wizard", modularizeType: ColumnModularizeType.Property),
269 new ColumnDefinition("Group", ColumnType.String, 255, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "String used to identify groups of extensions.", modularizeType: ColumnModularizeType.Property),
270 new ColumnDefinition("Attributes", ColumnType.Number, 1, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 3, description: "Attributes for WebServiceExtension: 1 = Allow, 2 = UIDeletable"),
271 },
272 symbolIdIsPrimaryKey: true
273 );
274
275 public static readonly TableDefinition IIsWebVirtualDir = new TableDefinition(
276 "IIsWebVirtualDir",
277 IisSymbolDefinitions.IIsWebVirtualDir,
278 new[]
279 {
280 new ColumnDefinition("VirtualDir", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token", modularizeType: ColumnModularizeType.Column),
281 new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Component", keyColumn: 1, description: "Foreign key referencing Component that controls the virtual directory", modularizeType: ColumnModularizeType.Column),
282 new ColumnDefinition("Web_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "IIsWebSite", keyColumn: 1, description: "Foreign key referencing web site that controls the virtual directory", modularizeType: ColumnModularizeType.Column),
283 new ColumnDefinition("Alias", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name of virtual directory displayed in IIS MMC applet", modularizeType: ColumnModularizeType.Property),
284 new ColumnDefinition("Directory_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "Directory", keyColumn: 1, description: "Foreign key referencing directory that the virtual directory points at", modularizeType: ColumnModularizeType.Column),
285 new ColumnDefinition("DirProperties_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "IIsWebDirProperties", keyColumn: 1, description: "Foreign key referencing possible security information for the virtual directory", modularizeType: ColumnModularizeType.Column),
286 new ColumnDefinition("Application_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "IIsWebApplication", keyColumn: 1, description: "Foreign key referencing possible ASP application for the virtual directory", modularizeType: ColumnModularizeType.Column),
287 },
288 symbolIdIsPrimaryKey: true
289 );
290
291 public static readonly TableDefinition IIsWebLog = new TableDefinition(
292 "IIsWebLog",
293 IisSymbolDefinitions.IIsWebLog,
294 new[]
295 {
296 new ColumnDefinition("Log", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary key, non-localized token", modularizeType: ColumnModularizeType.Column),
297 new ColumnDefinition("Format", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Type of log format"),
298 },
299 symbolIdIsPrimaryKey: true
300 );
301
302 public static readonly TableDefinition[] All = new[]
303 {
304 Certificate,
305 CertificateHash,
306 IIsWebSiteCertificates,
307 IIsAppPool,
308 IIsMimeMap,
309 IIsProperty,
310 IIsWebDirProperties,
311 IIsWebAddress,
312 IIsWebSite,
313 IIsWebApplication,
314 IIsWebApplicationExtension,
315 IIsFilter,
316 IIsWebDir,
317 IIsWebError,
318 IIsHttpHeader,
319 IIsWebServiceExtension,
320 IIsWebVirtualDir,
321 IIsWebLog,
322 };
323 }
324}
diff --git a/src/ext/Iis/wixext/IisWindowsInstallerBackendBinderExtension.cs b/src/ext/Iis/wixext/IisWindowsInstallerBackendBinderExtension.cs
new file mode 100644
index 00000000..a61cbad6
--- /dev/null
+++ b/src/ext/Iis/wixext/IisWindowsInstallerBackendBinderExtension.cs
@@ -0,0 +1,13 @@
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.Iis
4{
5 using System.Collections.Generic;
6 using WixToolset.Data.WindowsInstaller;
7 using WixToolset.Extensibility;
8
9 public class IisWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension
10 {
11 public override IReadOnlyCollection<TableDefinition> TableDefinitions => IisTableDefinitions.All;
12 }
13}
diff --git a/src/ext/Iis/wixext/Symbols/CertificateHashSymbol.cs b/src/ext/Iis/wixext/Symbols/CertificateHashSymbol.cs
new file mode 100644
index 00000000..866d474c
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/CertificateHashSymbol.cs
@@ -0,0 +1,55 @@
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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition CertificateHash = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.CertificateHash.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(CertificateHashSymbolFields.CertificateRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(CertificateHashSymbolFields.Hash), IntermediateFieldType.String),
16 },
17 typeof(CertificateHashSymbol));
18 }
19}
20
21namespace WixToolset.Iis.Symbols
22{
23 using WixToolset.Data;
24
25 public enum CertificateHashSymbolFields
26 {
27 CertificateRef,
28 Hash,
29 }
30
31 public class CertificateHashSymbol : IntermediateSymbol
32 {
33 public CertificateHashSymbol() : base(IisSymbolDefinitions.CertificateHash, null, null)
34 {
35 }
36
37 public CertificateHashSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.CertificateHash, sourceLineNumber, id)
38 {
39 }
40
41 public IntermediateField this[CertificateHashSymbolFields index] => this.Fields[(int)index];
42
43 public string CertificateRef
44 {
45 get => this.Fields[(int)CertificateHashSymbolFields.CertificateRef].AsString();
46 set => this.Set((int)CertificateHashSymbolFields.CertificateRef, value);
47 }
48
49 public string Hash
50 {
51 get => this.Fields[(int)CertificateHashSymbolFields.Hash].AsString();
52 set => this.Set((int)CertificateHashSymbolFields.Hash, value);
53 }
54 }
55} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/CertificateSymbol.cs b/src/ext/Iis/wixext/Symbols/CertificateSymbol.cs
new file mode 100644
index 00000000..b80b6ba4
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/CertificateSymbol.cs
@@ -0,0 +1,103 @@
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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition Certificate = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.Certificate.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(CertificateSymbolFields.ComponentRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(CertificateSymbolFields.Name), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(CertificateSymbolFields.StoreLocation), IntermediateFieldType.Number),
17 new IntermediateFieldDefinition(nameof(CertificateSymbolFields.StoreName), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(CertificateSymbolFields.Attributes), IntermediateFieldType.Number),
19 new IntermediateFieldDefinition(nameof(CertificateSymbolFields.BinaryRef), IntermediateFieldType.String),
20 new IntermediateFieldDefinition(nameof(CertificateSymbolFields.CertificatePath), IntermediateFieldType.String),
21 new IntermediateFieldDefinition(nameof(CertificateSymbolFields.PFXPassword), IntermediateFieldType.String),
22 },
23 typeof(CertificateSymbol));
24 }
25}
26
27namespace WixToolset.Iis.Symbols
28{
29 using WixToolset.Data;
30
31 public enum CertificateSymbolFields
32 {
33 ComponentRef,
34 Name,
35 StoreLocation,
36 StoreName,
37 Attributes,
38 BinaryRef,
39 CertificatePath,
40 PFXPassword,
41 }
42
43 public class CertificateSymbol : IntermediateSymbol
44 {
45 public CertificateSymbol() : base(IisSymbolDefinitions.Certificate, null, null)
46 {
47 }
48
49 public CertificateSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.Certificate, sourceLineNumber, id)
50 {
51 }
52
53 public IntermediateField this[CertificateSymbolFields index] => this.Fields[(int)index];
54
55 public string ComponentRef
56 {
57 get => this.Fields[(int)CertificateSymbolFields.ComponentRef].AsString();
58 set => this.Set((int)CertificateSymbolFields.ComponentRef, value);
59 }
60
61 public string Name
62 {
63 get => this.Fields[(int)CertificateSymbolFields.Name].AsString();
64 set => this.Set((int)CertificateSymbolFields.Name, value);
65 }
66
67 public int StoreLocation
68 {
69 get => this.Fields[(int)CertificateSymbolFields.StoreLocation].AsNumber();
70 set => this.Set((int)CertificateSymbolFields.StoreLocation, value);
71 }
72
73 public string StoreName
74 {
75 get => this.Fields[(int)CertificateSymbolFields.StoreName].AsString();
76 set => this.Set((int)CertificateSymbolFields.StoreName, value);
77 }
78
79 public int Attributes
80 {
81 get => this.Fields[(int)CertificateSymbolFields.Attributes].AsNumber();
82 set => this.Set((int)CertificateSymbolFields.Attributes, value);
83 }
84
85 public string BinaryRef
86 {
87 get => this.Fields[(int)CertificateSymbolFields.BinaryRef].AsString();
88 set => this.Set((int)CertificateSymbolFields.BinaryRef, value);
89 }
90
91 public string CertificatePath
92 {
93 get => this.Fields[(int)CertificateSymbolFields.CertificatePath].AsString();
94 set => this.Set((int)CertificateSymbolFields.CertificatePath, value);
95 }
96
97 public string PFXPassword
98 {
99 get => this.Fields[(int)CertificateSymbolFields.PFXPassword].AsString();
100 set => this.Set((int)CertificateSymbolFields.PFXPassword, value);
101 }
102 }
103} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsAppPoolSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsAppPoolSymbol.cs
new file mode 100644
index 00000000..a6fab136
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsAppPoolSymbol.cs
@@ -0,0 +1,159 @@
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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsAppPool = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsAppPool.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.Name), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.ComponentRef), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.Attributes), IntermediateFieldType.Number),
17 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.UserRef), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.RecycleMinutes), IntermediateFieldType.Number),
19 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.RecycleRequests), IntermediateFieldType.Number),
20 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.RecycleTimes), IntermediateFieldType.String),
21 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.IdleTimeout), IntermediateFieldType.Number),
22 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.QueueLimit), IntermediateFieldType.Number),
23 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.CPUMon), IntermediateFieldType.String),
24 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.MaxProc), IntermediateFieldType.Number),
25 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.VirtualMemory), IntermediateFieldType.Number),
26 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.PrivateMemory), IntermediateFieldType.Number),
27 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.ManagedRuntimeVersion), IntermediateFieldType.String),
28 new IntermediateFieldDefinition(nameof(IIsAppPoolSymbolFields.ManagedPipelineMode), IntermediateFieldType.String),
29 },
30 typeof(IIsAppPoolSymbol));
31 }
32}
33
34namespace WixToolset.Iis.Symbols
35{
36 using WixToolset.Data;
37
38 public enum IIsAppPoolSymbolFields
39 {
40 Name,
41 ComponentRef,
42 Attributes,
43 UserRef,
44 RecycleMinutes,
45 RecycleRequests,
46 RecycleTimes,
47 IdleTimeout,
48 QueueLimit,
49 CPUMon,
50 MaxProc,
51 VirtualMemory,
52 PrivateMemory,
53 ManagedRuntimeVersion,
54 ManagedPipelineMode,
55 }
56
57 public class IIsAppPoolSymbol : IntermediateSymbol
58 {
59 public IIsAppPoolSymbol() : base(IisSymbolDefinitions.IIsAppPool, null, null)
60 {
61 }
62
63 public IIsAppPoolSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsAppPool, sourceLineNumber, id)
64 {
65 }
66
67 public IntermediateField this[IIsAppPoolSymbolFields index] => this.Fields[(int)index];
68
69 public string Name
70 {
71 get => this.Fields[(int)IIsAppPoolSymbolFields.Name].AsString();
72 set => this.Set((int)IIsAppPoolSymbolFields.Name, value);
73 }
74
75 public string ComponentRef
76 {
77 get => this.Fields[(int)IIsAppPoolSymbolFields.ComponentRef].AsString();
78 set => this.Set((int)IIsAppPoolSymbolFields.ComponentRef, value);
79 }
80
81 public int Attributes
82 {
83 get => this.Fields[(int)IIsAppPoolSymbolFields.Attributes].AsNumber();
84 set => this.Set((int)IIsAppPoolSymbolFields.Attributes, value);
85 }
86
87 public string UserRef
88 {
89 get => this.Fields[(int)IIsAppPoolSymbolFields.UserRef].AsString();
90 set => this.Set((int)IIsAppPoolSymbolFields.UserRef, value);
91 }
92
93 public int? RecycleMinutes
94 {
95 get => this.Fields[(int)IIsAppPoolSymbolFields.RecycleMinutes].AsNullableNumber();
96 set => this.Set((int)IIsAppPoolSymbolFields.RecycleMinutes, value);
97 }
98
99 public int? RecycleRequests
100 {
101 get => this.Fields[(int)IIsAppPoolSymbolFields.RecycleRequests].AsNullableNumber();
102 set => this.Set((int)IIsAppPoolSymbolFields.RecycleRequests, value);
103 }
104
105 public string RecycleTimes
106 {
107 get => this.Fields[(int)IIsAppPoolSymbolFields.RecycleTimes].AsString();
108 set => this.Set((int)IIsAppPoolSymbolFields.RecycleTimes, value);
109 }
110
111 public int? IdleTimeout
112 {
113 get => this.Fields[(int)IIsAppPoolSymbolFields.IdleTimeout].AsNullableNumber();
114 set => this.Set((int)IIsAppPoolSymbolFields.IdleTimeout, value);
115 }
116
117 public int? QueueLimit
118 {
119 get => this.Fields[(int)IIsAppPoolSymbolFields.QueueLimit].AsNullableNumber();
120 set => this.Set((int)IIsAppPoolSymbolFields.QueueLimit, value);
121 }
122
123 public string CPUMon
124 {
125 get => this.Fields[(int)IIsAppPoolSymbolFields.CPUMon].AsString();
126 set => this.Set((int)IIsAppPoolSymbolFields.CPUMon, value);
127 }
128
129 public int? MaxProc
130 {
131 get => this.Fields[(int)IIsAppPoolSymbolFields.MaxProc].AsNullableNumber();
132 set => this.Set((int)IIsAppPoolSymbolFields.MaxProc, value);
133 }
134
135 public int? VirtualMemory
136 {
137 get => this.Fields[(int)IIsAppPoolSymbolFields.VirtualMemory].AsNullableNumber();
138 set => this.Set((int)IIsAppPoolSymbolFields.VirtualMemory, value);
139 }
140
141 public int? PrivateMemory
142 {
143 get => this.Fields[(int)IIsAppPoolSymbolFields.PrivateMemory].AsNullableNumber();
144 set => this.Set((int)IIsAppPoolSymbolFields.PrivateMemory, value);
145 }
146
147 public string ManagedRuntimeVersion
148 {
149 get => this.Fields[(int)IIsAppPoolSymbolFields.ManagedRuntimeVersion].AsString();
150 set => this.Set((int)IIsAppPoolSymbolFields.ManagedRuntimeVersion, value);
151 }
152
153 public string ManagedPipelineMode
154 {
155 get => this.Fields[(int)IIsAppPoolSymbolFields.ManagedPipelineMode].AsString();
156 set => this.Set((int)IIsAppPoolSymbolFields.ManagedPipelineMode, value);
157 }
158 }
159} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsFilterSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsFilterSymbol.cs
new file mode 100644
index 00000000..618730bf
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsFilterSymbol.cs
@@ -0,0 +1,95 @@
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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsFilter = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsFilter.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsFilterSymbolFields.Name), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IIsFilterSymbolFields.ComponentRef), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(IIsFilterSymbolFields.Path), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(IIsFilterSymbolFields.WebRef), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(IIsFilterSymbolFields.Description), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(IIsFilterSymbolFields.Flags), IntermediateFieldType.Number),
20 new IntermediateFieldDefinition(nameof(IIsFilterSymbolFields.LoadOrder), IntermediateFieldType.Number),
21 },
22 typeof(IIsFilterSymbol));
23 }
24}
25
26namespace WixToolset.Iis.Symbols
27{
28 using WixToolset.Data;
29
30 public enum IIsFilterSymbolFields
31 {
32 Name,
33 ComponentRef,
34 Path,
35 WebRef,
36 Description,
37 Flags,
38 LoadOrder,
39 }
40
41 public class IIsFilterSymbol : IntermediateSymbol
42 {
43 public IIsFilterSymbol() : base(IisSymbolDefinitions.IIsFilter, null, null)
44 {
45 }
46
47 public IIsFilterSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsFilter, sourceLineNumber, id)
48 {
49 }
50
51 public IntermediateField this[IIsFilterSymbolFields index] => this.Fields[(int)index];
52
53 public string Name
54 {
55 get => this.Fields[(int)IIsFilterSymbolFields.Name].AsString();
56 set => this.Set((int)IIsFilterSymbolFields.Name, value);
57 }
58
59 public string ComponentRef
60 {
61 get => this.Fields[(int)IIsFilterSymbolFields.ComponentRef].AsString();
62 set => this.Set((int)IIsFilterSymbolFields.ComponentRef, value);
63 }
64
65 public string Path
66 {
67 get => this.Fields[(int)IIsFilterSymbolFields.Path].AsString();
68 set => this.Set((int)IIsFilterSymbolFields.Path, value);
69 }
70
71 public string WebRef
72 {
73 get => this.Fields[(int)IIsFilterSymbolFields.WebRef].AsString();
74 set => this.Set((int)IIsFilterSymbolFields.WebRef, value);
75 }
76
77 public string Description
78 {
79 get => this.Fields[(int)IIsFilterSymbolFields.Description].AsString();
80 set => this.Set((int)IIsFilterSymbolFields.Description, value);
81 }
82
83 public int Flags
84 {
85 get => this.Fields[(int)IIsFilterSymbolFields.Flags].AsNumber();
86 set => this.Set((int)IIsFilterSymbolFields.Flags, value);
87 }
88
89 public int? LoadOrder
90 {
91 get => this.Fields[(int)IIsFilterSymbolFields.LoadOrder].AsNullableNumber();
92 set => this.Set((int)IIsFilterSymbolFields.LoadOrder, value);
93 }
94 }
95} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsHttpHeaderSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsHttpHeaderSymbol.cs
new file mode 100644
index 00000000..3ab2bf59
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsHttpHeaderSymbol.cs
@@ -0,0 +1,95 @@
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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsHttpHeader = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsHttpHeader.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsHttpHeaderSymbolFields.HttpHeader), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IIsHttpHeaderSymbolFields.ParentType), IntermediateFieldType.Number),
16 new IntermediateFieldDefinition(nameof(IIsHttpHeaderSymbolFields.ParentValue), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(IIsHttpHeaderSymbolFields.Name), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(IIsHttpHeaderSymbolFields.Value), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(IIsHttpHeaderSymbolFields.Attributes), IntermediateFieldType.Number),
20 new IntermediateFieldDefinition(nameof(IIsHttpHeaderSymbolFields.Sequence), IntermediateFieldType.Number),
21 },
22 typeof(IIsHttpHeaderSymbol));
23 }
24}
25
26namespace WixToolset.Iis.Symbols
27{
28 using WixToolset.Data;
29
30 public enum IIsHttpHeaderSymbolFields
31 {
32 HttpHeader,
33 ParentType,
34 ParentValue,
35 Name,
36 Value,
37 Attributes,
38 Sequence,
39 }
40
41 public class IIsHttpHeaderSymbol : IntermediateSymbol
42 {
43 public IIsHttpHeaderSymbol() : base(IisSymbolDefinitions.IIsHttpHeader, null, null)
44 {
45 }
46
47 public IIsHttpHeaderSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsHttpHeader, sourceLineNumber, id)
48 {
49 }
50
51 public IntermediateField this[IIsHttpHeaderSymbolFields index] => this.Fields[(int)index];
52
53 public string HttpHeader
54 {
55 get => this.Fields[(int)IIsHttpHeaderSymbolFields.HttpHeader].AsString();
56 set => this.Set((int)IIsHttpHeaderSymbolFields.HttpHeader, value);
57 }
58
59 public int ParentType
60 {
61 get => this.Fields[(int)IIsHttpHeaderSymbolFields.ParentType].AsNumber();
62 set => this.Set((int)IIsHttpHeaderSymbolFields.ParentType, value);
63 }
64
65 public string ParentValue
66 {
67 get => this.Fields[(int)IIsHttpHeaderSymbolFields.ParentValue].AsString();
68 set => this.Set((int)IIsHttpHeaderSymbolFields.ParentValue, value);
69 }
70
71 public string Name
72 {
73 get => this.Fields[(int)IIsHttpHeaderSymbolFields.Name].AsString();
74 set => this.Set((int)IIsHttpHeaderSymbolFields.Name, value);
75 }
76
77 public string Value
78 {
79 get => this.Fields[(int)IIsHttpHeaderSymbolFields.Value].AsString();
80 set => this.Set((int)IIsHttpHeaderSymbolFields.Value, value);
81 }
82
83 public int Attributes
84 {
85 get => this.Fields[(int)IIsHttpHeaderSymbolFields.Attributes].AsNumber();
86 set => this.Set((int)IIsHttpHeaderSymbolFields.Attributes, value);
87 }
88
89 public int? Sequence
90 {
91 get => this.Fields[(int)IIsHttpHeaderSymbolFields.Sequence].AsNullableNumber();
92 set => this.Set((int)IIsHttpHeaderSymbolFields.Sequence, value);
93 }
94 }
95} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsMimeMapSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsMimeMapSymbol.cs
new file mode 100644
index 00000000..4af6f81c
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsMimeMapSymbol.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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsMimeMap = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsMimeMap.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsMimeMapSymbolFields.ParentType), IntermediateFieldType.Number),
15 new IntermediateFieldDefinition(nameof(IIsMimeMapSymbolFields.ParentValue), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(IIsMimeMapSymbolFields.MimeType), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(IIsMimeMapSymbolFields.Extension), IntermediateFieldType.String),
18 },
19 typeof(IIsMimeMapSymbol));
20 }
21}
22
23namespace WixToolset.Iis.Symbols
24{
25 using WixToolset.Data;
26
27 public enum IIsMimeMapSymbolFields
28 {
29 ParentType,
30 ParentValue,
31 MimeType,
32 Extension,
33 }
34
35 public class IIsMimeMapSymbol : IntermediateSymbol
36 {
37 public IIsMimeMapSymbol() : base(IisSymbolDefinitions.IIsMimeMap, null, null)
38 {
39 }
40
41 public IIsMimeMapSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsMimeMap, sourceLineNumber, id)
42 {
43 }
44
45 public IntermediateField this[IIsMimeMapSymbolFields index] => this.Fields[(int)index];
46
47 public int ParentType
48 {
49 get => this.Fields[(int)IIsMimeMapSymbolFields.ParentType].AsNumber();
50 set => this.Set((int)IIsMimeMapSymbolFields.ParentType, value);
51 }
52
53 public string ParentValue
54 {
55 get => this.Fields[(int)IIsMimeMapSymbolFields.ParentValue].AsString();
56 set => this.Set((int)IIsMimeMapSymbolFields.ParentValue, value);
57 }
58
59 public string MimeType
60 {
61 get => this.Fields[(int)IIsMimeMapSymbolFields.MimeType].AsString();
62 set => this.Set((int)IIsMimeMapSymbolFields.MimeType, value);
63 }
64
65 public string Extension
66 {
67 get => this.Fields[(int)IIsMimeMapSymbolFields.Extension].AsString();
68 set => this.Set((int)IIsMimeMapSymbolFields.Extension, value);
69 }
70 }
71} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsPropertySymbol.cs b/src/ext/Iis/wixext/Symbols/IIsPropertySymbol.cs
new file mode 100644
index 00000000..9cf67014
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsPropertySymbol.cs
@@ -0,0 +1,63 @@
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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsProperty = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsProperty.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsPropertySymbolFields.ComponentRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IIsPropertySymbolFields.Attributes), IntermediateFieldType.Number),
16 new IntermediateFieldDefinition(nameof(IIsPropertySymbolFields.Value), IntermediateFieldType.String),
17 },
18 typeof(IIsPropertySymbol));
19 }
20}
21
22namespace WixToolset.Iis.Symbols
23{
24 using WixToolset.Data;
25
26 public enum IIsPropertySymbolFields
27 {
28 ComponentRef,
29 Attributes,
30 Value,
31 }
32
33 public class IIsPropertySymbol : IntermediateSymbol
34 {
35 public IIsPropertySymbol() : base(IisSymbolDefinitions.IIsProperty, null, null)
36 {
37 }
38
39 public IIsPropertySymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsProperty, sourceLineNumber, id)
40 {
41 }
42
43 public IntermediateField this[IIsPropertySymbolFields index] => this.Fields[(int)index];
44
45 public string ComponentRef
46 {
47 get => this.Fields[(int)IIsPropertySymbolFields.ComponentRef].AsString();
48 set => this.Set((int)IIsPropertySymbolFields.ComponentRef, value);
49 }
50
51 public int Attributes
52 {
53 get => this.Fields[(int)IIsPropertySymbolFields.Attributes].AsNumber();
54 set => this.Set((int)IIsPropertySymbolFields.Attributes, value);
55 }
56
57 public string Value
58 {
59 get => this.Fields[(int)IIsPropertySymbolFields.Value].AsString();
60 set => this.Set((int)IIsPropertySymbolFields.Value, value);
61 }
62 }
63} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsWebAddressSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsWebAddressSymbol.cs
new file mode 100644
index 00000000..7111718a
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsWebAddressSymbol.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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsWebAddress = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsWebAddress.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsWebAddressSymbolFields.WebRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IIsWebAddressSymbolFields.IP), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(IIsWebAddressSymbolFields.Port), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(IIsWebAddressSymbolFields.Header), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(IIsWebAddressSymbolFields.Secure), IntermediateFieldType.Number),
19 },
20 typeof(IIsWebAddressSymbol));
21 }
22}
23
24namespace WixToolset.Iis.Symbols
25{
26 using WixToolset.Data;
27
28 public enum IIsWebAddressSymbolFields
29 {
30 WebRef,
31 IP,
32 Port,
33 Header,
34 Secure,
35 }
36
37 public class IIsWebAddressSymbol : IntermediateSymbol
38 {
39 public IIsWebAddressSymbol() : base(IisSymbolDefinitions.IIsWebAddress, null, null)
40 {
41 }
42
43 public IIsWebAddressSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsWebAddress, sourceLineNumber, id)
44 {
45 }
46
47 public IntermediateField this[IIsWebAddressSymbolFields index] => this.Fields[(int)index];
48
49 public string WebRef
50 {
51 get => this.Fields[(int)IIsWebAddressSymbolFields.WebRef].AsString();
52 set => this.Set((int)IIsWebAddressSymbolFields.WebRef, value);
53 }
54
55 public string IP
56 {
57 get => this.Fields[(int)IIsWebAddressSymbolFields.IP].AsString();
58 set => this.Set((int)IIsWebAddressSymbolFields.IP, value);
59 }
60
61 public string Port
62 {
63 get => this.Fields[(int)IIsWebAddressSymbolFields.Port].AsString();
64 set => this.Set((int)IIsWebAddressSymbolFields.Port, value);
65 }
66
67 public string Header
68 {
69 get => this.Fields[(int)IIsWebAddressSymbolFields.Header].AsString();
70 set => this.Set((int)IIsWebAddressSymbolFields.Header, value);
71 }
72
73 public int? Secure
74 {
75 get => this.Fields[(int)IIsWebAddressSymbolFields.Secure].AsNullableNumber();
76 set => this.Set((int)IIsWebAddressSymbolFields.Secure, value);
77 }
78 }
79} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsWebApplicationExtensionSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsWebApplicationExtensionSymbol.cs
new file mode 100644
index 00000000..4283d702
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsWebApplicationExtensionSymbol.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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsWebApplicationExtension = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsWebApplicationExtension.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsWebApplicationExtensionSymbolFields.ApplicationRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IIsWebApplicationExtensionSymbolFields.Extension), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(IIsWebApplicationExtensionSymbolFields.Verbs), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(IIsWebApplicationExtensionSymbolFields.Executable), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(IIsWebApplicationExtensionSymbolFields.Attributes), IntermediateFieldType.Number),
19 },
20 typeof(IIsWebApplicationExtensionSymbol));
21 }
22}
23
24namespace WixToolset.Iis.Symbols
25{
26 using WixToolset.Data;
27
28 public enum IIsWebApplicationExtensionSymbolFields
29 {
30 ApplicationRef,
31 Extension,
32 Verbs,
33 Executable,
34 Attributes,
35 }
36
37 public class IIsWebApplicationExtensionSymbol : IntermediateSymbol
38 {
39 public IIsWebApplicationExtensionSymbol() : base(IisSymbolDefinitions.IIsWebApplicationExtension, null, null)
40 {
41 }
42
43 public IIsWebApplicationExtensionSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsWebApplicationExtension, sourceLineNumber, id)
44 {
45 }
46
47 public IntermediateField this[IIsWebApplicationExtensionSymbolFields index] => this.Fields[(int)index];
48
49 public string ApplicationRef
50 {
51 get => this.Fields[(int)IIsWebApplicationExtensionSymbolFields.ApplicationRef].AsString();
52 set => this.Set((int)IIsWebApplicationExtensionSymbolFields.ApplicationRef, value);
53 }
54
55 public string Extension
56 {
57 get => this.Fields[(int)IIsWebApplicationExtensionSymbolFields.Extension].AsString();
58 set => this.Set((int)IIsWebApplicationExtensionSymbolFields.Extension, value);
59 }
60
61 public string Verbs
62 {
63 get => this.Fields[(int)IIsWebApplicationExtensionSymbolFields.Verbs].AsString();
64 set => this.Set((int)IIsWebApplicationExtensionSymbolFields.Verbs, value);
65 }
66
67 public string Executable
68 {
69 get => this.Fields[(int)IIsWebApplicationExtensionSymbolFields.Executable].AsString();
70 set => this.Set((int)IIsWebApplicationExtensionSymbolFields.Executable, value);
71 }
72
73 public int Attributes
74 {
75 get => this.Fields[(int)IIsWebApplicationExtensionSymbolFields.Attributes].AsNumber();
76 set => this.Set((int)IIsWebApplicationExtensionSymbolFields.Attributes, value);
77 }
78 }
79} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsWebApplicationSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsWebApplicationSymbol.cs
new file mode 100644
index 00000000..2f6f87de
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsWebApplicationSymbol.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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsWebApplication = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsWebApplication.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsWebApplicationSymbolFields.Name), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IIsWebApplicationSymbolFields.Isolation), IntermediateFieldType.Number),
16 new IntermediateFieldDefinition(nameof(IIsWebApplicationSymbolFields.AllowSessions), IntermediateFieldType.Number),
17 new IntermediateFieldDefinition(nameof(IIsWebApplicationSymbolFields.SessionTimeout), IntermediateFieldType.Number),
18 new IntermediateFieldDefinition(nameof(IIsWebApplicationSymbolFields.Buffer), IntermediateFieldType.Number),
19 new IntermediateFieldDefinition(nameof(IIsWebApplicationSymbolFields.ParentPaths), IntermediateFieldType.Number),
20 new IntermediateFieldDefinition(nameof(IIsWebApplicationSymbolFields.DefaultScript), IntermediateFieldType.String),
21 new IntermediateFieldDefinition(nameof(IIsWebApplicationSymbolFields.ScriptTimeout), IntermediateFieldType.Number),
22 new IntermediateFieldDefinition(nameof(IIsWebApplicationSymbolFields.ServerDebugging), IntermediateFieldType.Number),
23 new IntermediateFieldDefinition(nameof(IIsWebApplicationSymbolFields.ClientDebugging), IntermediateFieldType.Number),
24 new IntermediateFieldDefinition(nameof(IIsWebApplicationSymbolFields.AppPoolRef), IntermediateFieldType.String),
25 },
26 typeof(IIsWebApplicationSymbol));
27 }
28}
29
30namespace WixToolset.Iis.Symbols
31{
32 using WixToolset.Data;
33
34 public enum IIsWebApplicationSymbolFields
35 {
36 Name,
37 Isolation,
38 AllowSessions,
39 SessionTimeout,
40 Buffer,
41 ParentPaths,
42 DefaultScript,
43 ScriptTimeout,
44 ServerDebugging,
45 ClientDebugging,
46 AppPoolRef,
47 }
48
49 public class IIsWebApplicationSymbol : IntermediateSymbol
50 {
51 public IIsWebApplicationSymbol() : base(IisSymbolDefinitions.IIsWebApplication, null, null)
52 {
53 }
54
55 public IIsWebApplicationSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsWebApplication, sourceLineNumber, id)
56 {
57 }
58
59 public IntermediateField this[IIsWebApplicationSymbolFields index] => this.Fields[(int)index];
60
61 public string Name
62 {
63 get => this.Fields[(int)IIsWebApplicationSymbolFields.Name].AsString();
64 set => this.Set((int)IIsWebApplicationSymbolFields.Name, value);
65 }
66
67 public int Isolation
68 {
69 get => this.Fields[(int)IIsWebApplicationSymbolFields.Isolation].AsNumber();
70 set => this.Set((int)IIsWebApplicationSymbolFields.Isolation, value);
71 }
72
73 public int? AllowSessions
74 {
75 get => this.Fields[(int)IIsWebApplicationSymbolFields.AllowSessions].AsNullableNumber();
76 set => this.Set((int)IIsWebApplicationSymbolFields.AllowSessions, value);
77 }
78
79 public int? SessionTimeout
80 {
81 get => this.Fields[(int)IIsWebApplicationSymbolFields.SessionTimeout].AsNullableNumber();
82 set => this.Set((int)IIsWebApplicationSymbolFields.SessionTimeout, value);
83 }
84
85 public int? Buffer
86 {
87 get => this.Fields[(int)IIsWebApplicationSymbolFields.Buffer].AsNullableNumber();
88 set => this.Set((int)IIsWebApplicationSymbolFields.Buffer, value);
89 }
90
91 public int? ParentPaths
92 {
93 get => this.Fields[(int)IIsWebApplicationSymbolFields.ParentPaths].AsNullableNumber();
94 set => this.Set((int)IIsWebApplicationSymbolFields.ParentPaths, value);
95 }
96
97 public string DefaultScript
98 {
99 get => this.Fields[(int)IIsWebApplicationSymbolFields.DefaultScript].AsString();
100 set => this.Set((int)IIsWebApplicationSymbolFields.DefaultScript, value);
101 }
102
103 public int? ScriptTimeout
104 {
105 get => this.Fields[(int)IIsWebApplicationSymbolFields.ScriptTimeout].AsNullableNumber();
106 set => this.Set((int)IIsWebApplicationSymbolFields.ScriptTimeout, value);
107 }
108
109 public int? ServerDebugging
110 {
111 get => this.Fields[(int)IIsWebApplicationSymbolFields.ServerDebugging].AsNullableNumber();
112 set => this.Set((int)IIsWebApplicationSymbolFields.ServerDebugging, value);
113 }
114
115 public int? ClientDebugging
116 {
117 get => this.Fields[(int)IIsWebApplicationSymbolFields.ClientDebugging].AsNullableNumber();
118 set => this.Set((int)IIsWebApplicationSymbolFields.ClientDebugging, value);
119 }
120
121 public string AppPoolRef
122 {
123 get => this.Fields[(int)IIsWebApplicationSymbolFields.AppPoolRef].AsString();
124 set => this.Set((int)IIsWebApplicationSymbolFields.AppPoolRef, value);
125 }
126 }
127} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsWebDirPropertiesSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsWebDirPropertiesSymbol.cs
new file mode 100644
index 00000000..42d2dead
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsWebDirPropertiesSymbol.cs
@@ -0,0 +1,151 @@
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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsWebDirProperties = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsWebDirProperties.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.Access), IntermediateFieldType.Number),
15 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.Authorization), IntermediateFieldType.Number),
16 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.AnonymousUserRef), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.IIsControlledPassword), IntermediateFieldType.Number),
18 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.LogVisits), IntermediateFieldType.Number),
19 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.Index), IntermediateFieldType.Number),
20 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.DefaultDoc), IntermediateFieldType.String),
21 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.AspDetailedError), IntermediateFieldType.Number),
22 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.HttpExpires), IntermediateFieldType.String),
23 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.CacheControlMaxAge), IntermediateFieldType.Number),
24 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.CacheControlCustom), IntermediateFieldType.String),
25 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.NoCustomError), IntermediateFieldType.Number),
26 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.AccessSSLFlags), IntermediateFieldType.Number),
27 new IntermediateFieldDefinition(nameof(IIsWebDirPropertiesSymbolFields.AuthenticationProviders), IntermediateFieldType.String),
28 },
29 typeof(IIsWebDirPropertiesSymbol));
30 }
31}
32
33namespace WixToolset.Iis.Symbols
34{
35 using WixToolset.Data;
36
37 public enum IIsWebDirPropertiesSymbolFields
38 {
39 Access,
40 Authorization,
41 AnonymousUserRef,
42 IIsControlledPassword,
43 LogVisits,
44 Index,
45 DefaultDoc,
46 AspDetailedError,
47 HttpExpires,
48 CacheControlMaxAge,
49 CacheControlCustom,
50 NoCustomError,
51 AccessSSLFlags,
52 AuthenticationProviders,
53 }
54
55 public class IIsWebDirPropertiesSymbol : IntermediateSymbol
56 {
57 public IIsWebDirPropertiesSymbol() : base(IisSymbolDefinitions.IIsWebDirProperties, null, null)
58 {
59 }
60
61 public IIsWebDirPropertiesSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsWebDirProperties, sourceLineNumber, id)
62 {
63 }
64
65 public IntermediateField this[IIsWebDirPropertiesSymbolFields index] => this.Fields[(int)index];
66
67 public int? Access
68 {
69 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.Access].AsNullableNumber();
70 set => this.Set((int)IIsWebDirPropertiesSymbolFields.Access, value);
71 }
72
73 public int? Authorization
74 {
75 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.Authorization].AsNullableNumber();
76 set => this.Set((int)IIsWebDirPropertiesSymbolFields.Authorization, value);
77 }
78
79 public string AnonymousUserRef
80 {
81 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.AnonymousUserRef].AsString();
82 set => this.Set((int)IIsWebDirPropertiesSymbolFields.AnonymousUserRef, value);
83 }
84
85 public int? IIsControlledPassword
86 {
87 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.IIsControlledPassword].AsNullableNumber();
88 set => this.Set((int)IIsWebDirPropertiesSymbolFields.IIsControlledPassword, value);
89 }
90
91 public int? LogVisits
92 {
93 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.LogVisits].AsNullableNumber();
94 set => this.Set((int)IIsWebDirPropertiesSymbolFields.LogVisits, value);
95 }
96
97 public int? Index
98 {
99 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.Index].AsNullableNumber();
100 set => this.Set((int)IIsWebDirPropertiesSymbolFields.Index, value);
101 }
102
103 public string DefaultDoc
104 {
105 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.DefaultDoc].AsString();
106 set => this.Set((int)IIsWebDirPropertiesSymbolFields.DefaultDoc, value);
107 }
108
109 public int? AspDetailedError
110 {
111 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.AspDetailedError].AsNullableNumber();
112 set => this.Set((int)IIsWebDirPropertiesSymbolFields.AspDetailedError, value);
113 }
114
115 public string HttpExpires
116 {
117 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.HttpExpires].AsString();
118 set => this.Set((int)IIsWebDirPropertiesSymbolFields.HttpExpires, value);
119 }
120
121 public int? CacheControlMaxAge
122 {
123 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.CacheControlMaxAge].AsNullableNumber();
124 set => this.Set((int)IIsWebDirPropertiesSymbolFields.CacheControlMaxAge, value);
125 }
126
127 public string CacheControlCustom
128 {
129 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.CacheControlCustom].AsString();
130 set => this.Set((int)IIsWebDirPropertiesSymbolFields.CacheControlCustom, value);
131 }
132
133 public int? NoCustomError
134 {
135 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.NoCustomError].AsNullableNumber();
136 set => this.Set((int)IIsWebDirPropertiesSymbolFields.NoCustomError, value);
137 }
138
139 public int? AccessSSLFlags
140 {
141 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.AccessSSLFlags].AsNullableNumber();
142 set => this.Set((int)IIsWebDirPropertiesSymbolFields.AccessSSLFlags, value);
143 }
144
145 public string AuthenticationProviders
146 {
147 get => this.Fields[(int)IIsWebDirPropertiesSymbolFields.AuthenticationProviders].AsString();
148 set => this.Set((int)IIsWebDirPropertiesSymbolFields.AuthenticationProviders, value);
149 }
150 }
151} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsWebDirSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsWebDirSymbol.cs
new file mode 100644
index 00000000..7f257f14
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsWebDirSymbol.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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsWebDir = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsWebDir.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsWebDirSymbolFields.ComponentRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IIsWebDirSymbolFields.WebRef), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(IIsWebDirSymbolFields.Path), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(IIsWebDirSymbolFields.DirPropertiesRef), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(IIsWebDirSymbolFields.ApplicationRef), IntermediateFieldType.String),
19 },
20 typeof(IIsWebDirSymbol));
21 }
22}
23
24namespace WixToolset.Iis.Symbols
25{
26 using WixToolset.Data;
27
28 public enum IIsWebDirSymbolFields
29 {
30 ComponentRef,
31 WebRef,
32 Path,
33 DirPropertiesRef,
34 ApplicationRef,
35 }
36
37 public class IIsWebDirSymbol : IntermediateSymbol
38 {
39 public IIsWebDirSymbol() : base(IisSymbolDefinitions.IIsWebDir, null, null)
40 {
41 }
42
43 public IIsWebDirSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsWebDir, sourceLineNumber, id)
44 {
45 }
46
47 public IntermediateField this[IIsWebDirSymbolFields index] => this.Fields[(int)index];
48
49 public string ComponentRef
50 {
51 get => this.Fields[(int)IIsWebDirSymbolFields.ComponentRef].AsString();
52 set => this.Set((int)IIsWebDirSymbolFields.ComponentRef, value);
53 }
54
55 public string WebRef
56 {
57 get => this.Fields[(int)IIsWebDirSymbolFields.WebRef].AsString();
58 set => this.Set((int)IIsWebDirSymbolFields.WebRef, value);
59 }
60
61 public string Path
62 {
63 get => this.Fields[(int)IIsWebDirSymbolFields.Path].AsString();
64 set => this.Set((int)IIsWebDirSymbolFields.Path, value);
65 }
66
67 public string DirPropertiesRef
68 {
69 get => this.Fields[(int)IIsWebDirSymbolFields.DirPropertiesRef].AsString();
70 set => this.Set((int)IIsWebDirSymbolFields.DirPropertiesRef, value);
71 }
72
73 public string ApplicationRef
74 {
75 get => this.Fields[(int)IIsWebDirSymbolFields.ApplicationRef].AsString();
76 set => this.Set((int)IIsWebDirSymbolFields.ApplicationRef, value);
77 }
78 }
79} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsWebErrorSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsWebErrorSymbol.cs
new file mode 100644
index 00000000..f8488fed
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsWebErrorSymbol.cs
@@ -0,0 +1,87 @@
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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsWebError = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsWebError.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsWebErrorSymbolFields.ErrorCode), IntermediateFieldType.Number),
15 new IntermediateFieldDefinition(nameof(IIsWebErrorSymbolFields.SubCode), IntermediateFieldType.Number),
16 new IntermediateFieldDefinition(nameof(IIsWebErrorSymbolFields.ParentType), IntermediateFieldType.Number),
17 new IntermediateFieldDefinition(nameof(IIsWebErrorSymbolFields.ParentValue), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(IIsWebErrorSymbolFields.File), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(IIsWebErrorSymbolFields.URL), IntermediateFieldType.String),
20 },
21 typeof(IIsWebErrorSymbol));
22 }
23}
24
25namespace WixToolset.Iis.Symbols
26{
27 using WixToolset.Data;
28
29 public enum IIsWebErrorSymbolFields
30 {
31 ErrorCode,
32 SubCode,
33 ParentType,
34 ParentValue,
35 File,
36 URL,
37 }
38
39 public class IIsWebErrorSymbol : IntermediateSymbol
40 {
41 public IIsWebErrorSymbol() : base(IisSymbolDefinitions.IIsWebError, null, null)
42 {
43 }
44
45 public IIsWebErrorSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsWebError, sourceLineNumber, id)
46 {
47 }
48
49 public IntermediateField this[IIsWebErrorSymbolFields index] => this.Fields[(int)index];
50
51 public int ErrorCode
52 {
53 get => this.Fields[(int)IIsWebErrorSymbolFields.ErrorCode].AsNumber();
54 set => this.Set((int)IIsWebErrorSymbolFields.ErrorCode, value);
55 }
56
57 public int SubCode
58 {
59 get => this.Fields[(int)IIsWebErrorSymbolFields.SubCode].AsNumber();
60 set => this.Set((int)IIsWebErrorSymbolFields.SubCode, value);
61 }
62
63 public int ParentType
64 {
65 get => this.Fields[(int)IIsWebErrorSymbolFields.ParentType].AsNumber();
66 set => this.Set((int)IIsWebErrorSymbolFields.ParentType, value);
67 }
68
69 public string ParentValue
70 {
71 get => this.Fields[(int)IIsWebErrorSymbolFields.ParentValue].AsString();
72 set => this.Set((int)IIsWebErrorSymbolFields.ParentValue, value);
73 }
74
75 public string File
76 {
77 get => this.Fields[(int)IIsWebErrorSymbolFields.File].AsString();
78 set => this.Set((int)IIsWebErrorSymbolFields.File, value);
79 }
80
81 public string URL
82 {
83 get => this.Fields[(int)IIsWebErrorSymbolFields.URL].AsString();
84 set => this.Set((int)IIsWebErrorSymbolFields.URL, value);
85 }
86 }
87} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsWebLogSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsWebLogSymbol.cs
new file mode 100644
index 00000000..409dc673
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsWebLogSymbol.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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsWebLog = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsWebLog.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsWebLogSymbolFields.Format), IntermediateFieldType.String),
15 },
16 typeof(IIsWebLogSymbol));
17 }
18}
19
20namespace WixToolset.Iis.Symbols
21{
22 using WixToolset.Data;
23
24 public enum IIsWebLogSymbolFields
25 {
26 Format,
27 }
28
29 public class IIsWebLogSymbol : IntermediateSymbol
30 {
31 public IIsWebLogSymbol() : base(IisSymbolDefinitions.IIsWebLog, null, null)
32 {
33 }
34
35 public IIsWebLogSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsWebLog, sourceLineNumber, id)
36 {
37 }
38
39 public IntermediateField this[IIsWebLogSymbolFields index] => this.Fields[(int)index];
40
41 public string Format
42 {
43 get => this.Fields[(int)IIsWebLogSymbolFields.Format].AsString();
44 set => this.Set((int)IIsWebLogSymbolFields.Format, value);
45 }
46 }
47} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsWebServiceExtensionSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsWebServiceExtensionSymbol.cs
new file mode 100644
index 00000000..44922357
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsWebServiceExtensionSymbol.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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsWebServiceExtension = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsWebServiceExtension.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsWebServiceExtensionSymbolFields.ComponentRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IIsWebServiceExtensionSymbolFields.File), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(IIsWebServiceExtensionSymbolFields.Description), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(IIsWebServiceExtensionSymbolFields.Group), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(IIsWebServiceExtensionSymbolFields.Attributes), IntermediateFieldType.Number),
19 },
20 typeof(IIsWebServiceExtensionSymbol));
21 }
22}
23
24namespace WixToolset.Iis.Symbols
25{
26 using WixToolset.Data;
27
28 public enum IIsWebServiceExtensionSymbolFields
29 {
30 ComponentRef,
31 File,
32 Description,
33 Group,
34 Attributes,
35 }
36
37 public class IIsWebServiceExtensionSymbol : IntermediateSymbol
38 {
39 public IIsWebServiceExtensionSymbol() : base(IisSymbolDefinitions.IIsWebServiceExtension, null, null)
40 {
41 }
42
43 public IIsWebServiceExtensionSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsWebServiceExtension, sourceLineNumber, id)
44 {
45 }
46
47 public IntermediateField this[IIsWebServiceExtensionSymbolFields index] => this.Fields[(int)index];
48
49 public string ComponentRef
50 {
51 get => this.Fields[(int)IIsWebServiceExtensionSymbolFields.ComponentRef].AsString();
52 set => this.Set((int)IIsWebServiceExtensionSymbolFields.ComponentRef, value);
53 }
54
55 public string File
56 {
57 get => this.Fields[(int)IIsWebServiceExtensionSymbolFields.File].AsString();
58 set => this.Set((int)IIsWebServiceExtensionSymbolFields.File, value);
59 }
60
61 public string Description
62 {
63 get => this.Fields[(int)IIsWebServiceExtensionSymbolFields.Description].AsString();
64 set => this.Set((int)IIsWebServiceExtensionSymbolFields.Description, value);
65 }
66
67 public string Group
68 {
69 get => this.Fields[(int)IIsWebServiceExtensionSymbolFields.Group].AsString();
70 set => this.Set((int)IIsWebServiceExtensionSymbolFields.Group, value);
71 }
72
73 public int Attributes
74 {
75 get => this.Fields[(int)IIsWebServiceExtensionSymbolFields.Attributes].AsNumber();
76 set => this.Set((int)IIsWebServiceExtensionSymbolFields.Attributes, value);
77 }
78 }
79} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsWebSiteCertificatesSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsWebSiteCertificatesSymbol.cs
new file mode 100644
index 00000000..851ce556
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsWebSiteCertificatesSymbol.cs
@@ -0,0 +1,55 @@
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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsWebSiteCertificates = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsWebSiteCertificates.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsWebSiteCertificatesSymbolFields.WebRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IIsWebSiteCertificatesSymbolFields.CertificateRef), IntermediateFieldType.String),
16 },
17 typeof(IIsWebSiteCertificatesSymbol));
18 }
19}
20
21namespace WixToolset.Iis.Symbols
22{
23 using WixToolset.Data;
24
25 public enum IIsWebSiteCertificatesSymbolFields
26 {
27 WebRef,
28 CertificateRef,
29 }
30
31 public class IIsWebSiteCertificatesSymbol : IntermediateSymbol
32 {
33 public IIsWebSiteCertificatesSymbol() : base(IisSymbolDefinitions.IIsWebSiteCertificates, null, null)
34 {
35 }
36
37 public IIsWebSiteCertificatesSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsWebSiteCertificates, sourceLineNumber, id)
38 {
39 }
40
41 public IntermediateField this[IIsWebSiteCertificatesSymbolFields index] => this.Fields[(int)index];
42
43 public string WebRef
44 {
45 get => this.Fields[(int)IIsWebSiteCertificatesSymbolFields.WebRef].AsString();
46 set => this.Set((int)IIsWebSiteCertificatesSymbolFields.WebRef, value);
47 }
48
49 public string CertificateRef
50 {
51 get => this.Fields[(int)IIsWebSiteCertificatesSymbolFields.CertificateRef].AsString();
52 set => this.Set((int)IIsWebSiteCertificatesSymbolFields.CertificateRef, value);
53 }
54 }
55} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsWebSiteSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsWebSiteSymbol.cs
new file mode 100644
index 00000000..ceba2ea0
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsWebSiteSymbol.cs
@@ -0,0 +1,135 @@
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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsWebSite = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsWebSite.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsWebSiteSymbolFields.ComponentRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IIsWebSiteSymbolFields.Description), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(IIsWebSiteSymbolFields.ConnectionTimeout), IntermediateFieldType.Number),
17 new IntermediateFieldDefinition(nameof(IIsWebSiteSymbolFields.DirectoryRef), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(IIsWebSiteSymbolFields.State), IntermediateFieldType.Number),
19 new IntermediateFieldDefinition(nameof(IIsWebSiteSymbolFields.Attributes), IntermediateFieldType.Number),
20 new IntermediateFieldDefinition(nameof(IIsWebSiteSymbolFields.KeyAddressRef), IntermediateFieldType.String),
21 new IntermediateFieldDefinition(nameof(IIsWebSiteSymbolFields.DirPropertiesRef), IntermediateFieldType.String),
22 new IntermediateFieldDefinition(nameof(IIsWebSiteSymbolFields.ApplicationRef), IntermediateFieldType.String),
23 new IntermediateFieldDefinition(nameof(IIsWebSiteSymbolFields.Sequence), IntermediateFieldType.Number),
24 new IntermediateFieldDefinition(nameof(IIsWebSiteSymbolFields.LogRef), IntermediateFieldType.String),
25 new IntermediateFieldDefinition(nameof(IIsWebSiteSymbolFields.WebsiteId), IntermediateFieldType.String),
26 },
27 typeof(IIsWebSiteSymbol));
28 }
29}
30
31namespace WixToolset.Iis.Symbols
32{
33 using WixToolset.Data;
34
35 public enum IIsWebSiteSymbolFields
36 {
37 ComponentRef,
38 Description,
39 ConnectionTimeout,
40 DirectoryRef,
41 State,
42 Attributes,
43 KeyAddressRef,
44 DirPropertiesRef,
45 ApplicationRef,
46 Sequence,
47 LogRef,
48 WebsiteId,
49 }
50
51 public class IIsWebSiteSymbol : IntermediateSymbol
52 {
53 public IIsWebSiteSymbol() : base(IisSymbolDefinitions.IIsWebSite, null, null)
54 {
55 }
56
57 public IIsWebSiteSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsWebSite, sourceLineNumber, id)
58 {
59 }
60
61 public IntermediateField this[IIsWebSiteSymbolFields index] => this.Fields[(int)index];
62
63 public string ComponentRef
64 {
65 get => this.Fields[(int)IIsWebSiteSymbolFields.ComponentRef].AsString();
66 set => this.Set((int)IIsWebSiteSymbolFields.ComponentRef, value);
67 }
68
69 public string Description
70 {
71 get => this.Fields[(int)IIsWebSiteSymbolFields.Description].AsString();
72 set => this.Set((int)IIsWebSiteSymbolFields.Description, value);
73 }
74
75 public int? ConnectionTimeout
76 {
77 get => this.Fields[(int)IIsWebSiteSymbolFields.ConnectionTimeout].AsNullableNumber();
78 set => this.Set((int)IIsWebSiteSymbolFields.ConnectionTimeout, value);
79 }
80
81 public string DirectoryRef
82 {
83 get => this.Fields[(int)IIsWebSiteSymbolFields.DirectoryRef].AsString();
84 set => this.Set((int)IIsWebSiteSymbolFields.DirectoryRef, value);
85 }
86
87 public int? State
88 {
89 get => this.Fields[(int)IIsWebSiteSymbolFields.State].AsNullableNumber();
90 set => this.Set((int)IIsWebSiteSymbolFields.State, value);
91 }
92
93 public int Attributes
94 {
95 get => this.Fields[(int)IIsWebSiteSymbolFields.Attributes].AsNumber();
96 set => this.Set((int)IIsWebSiteSymbolFields.Attributes, value);
97 }
98
99 public string KeyAddressRef
100 {
101 get => this.Fields[(int)IIsWebSiteSymbolFields.KeyAddressRef].AsString();
102 set => this.Set((int)IIsWebSiteSymbolFields.KeyAddressRef, value);
103 }
104
105 public string DirPropertiesRef
106 {
107 get => this.Fields[(int)IIsWebSiteSymbolFields.DirPropertiesRef].AsString();
108 set => this.Set((int)IIsWebSiteSymbolFields.DirPropertiesRef, value);
109 }
110
111 public string ApplicationRef
112 {
113 get => this.Fields[(int)IIsWebSiteSymbolFields.ApplicationRef].AsString();
114 set => this.Set((int)IIsWebSiteSymbolFields.ApplicationRef, value);
115 }
116
117 public int? Sequence
118 {
119 get => this.Fields[(int)IIsWebSiteSymbolFields.Sequence].AsNullableNumber();
120 set => this.Set((int)IIsWebSiteSymbolFields.Sequence, value);
121 }
122
123 public string LogRef
124 {
125 get => this.Fields[(int)IIsWebSiteSymbolFields.LogRef].AsString();
126 set => this.Set((int)IIsWebSiteSymbolFields.LogRef, value);
127 }
128
129 public string WebsiteId
130 {
131 get => this.Fields[(int)IIsWebSiteSymbolFields.WebsiteId].AsString();
132 set => this.Set((int)IIsWebSiteSymbolFields.WebsiteId, value);
133 }
134 }
135} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IIsWebVirtualDirSymbol.cs b/src/ext/Iis/wixext/Symbols/IIsWebVirtualDirSymbol.cs
new file mode 100644
index 00000000..bfc29e84
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IIsWebVirtualDirSymbol.cs
@@ -0,0 +1,87 @@
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.Iis
4{
5 using WixToolset.Data;
6 using WixToolset.Iis.Symbols;
7
8 public static partial class IisSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition IIsWebVirtualDir = new IntermediateSymbolDefinition(
11 IisSymbolDefinitionType.IIsWebVirtualDir.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(IIsWebVirtualDirSymbolFields.ComponentRef), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(IIsWebVirtualDirSymbolFields.WebRef), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(IIsWebVirtualDirSymbolFields.Alias), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(IIsWebVirtualDirSymbolFields.DirectoryRef), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(IIsWebVirtualDirSymbolFields.DirPropertiesRef), IntermediateFieldType.String),
19 new IntermediateFieldDefinition(nameof(IIsWebVirtualDirSymbolFields.ApplicationRef), IntermediateFieldType.String),
20 },
21 typeof(IIsWebVirtualDirSymbol));
22 }
23}
24
25namespace WixToolset.Iis.Symbols
26{
27 using WixToolset.Data;
28
29 public enum IIsWebVirtualDirSymbolFields
30 {
31 ComponentRef,
32 WebRef,
33 Alias,
34 DirectoryRef,
35 DirPropertiesRef,
36 ApplicationRef,
37 }
38
39 public class IIsWebVirtualDirSymbol : IntermediateSymbol
40 {
41 public IIsWebVirtualDirSymbol() : base(IisSymbolDefinitions.IIsWebVirtualDir, null, null)
42 {
43 }
44
45 public IIsWebVirtualDirSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(IisSymbolDefinitions.IIsWebVirtualDir, sourceLineNumber, id)
46 {
47 }
48
49 public IntermediateField this[IIsWebVirtualDirSymbolFields index] => this.Fields[(int)index];
50
51 public string ComponentRef
52 {
53 get => this.Fields[(int)IIsWebVirtualDirSymbolFields.ComponentRef].AsString();
54 set => this.Set((int)IIsWebVirtualDirSymbolFields.ComponentRef, value);
55 }
56
57 public string WebRef
58 {
59 get => this.Fields[(int)IIsWebVirtualDirSymbolFields.WebRef].AsString();
60 set => this.Set((int)IIsWebVirtualDirSymbolFields.WebRef, value);
61 }
62
63 public string Alias
64 {
65 get => this.Fields[(int)IIsWebVirtualDirSymbolFields.Alias].AsString();
66 set => this.Set((int)IIsWebVirtualDirSymbolFields.Alias, value);
67 }
68
69 public string DirectoryRef
70 {
71 get => this.Fields[(int)IIsWebVirtualDirSymbolFields.DirectoryRef].AsString();
72 set => this.Set((int)IIsWebVirtualDirSymbolFields.DirectoryRef, value);
73 }
74
75 public string DirPropertiesRef
76 {
77 get => this.Fields[(int)IIsWebVirtualDirSymbolFields.DirPropertiesRef].AsString();
78 set => this.Set((int)IIsWebVirtualDirSymbolFields.DirPropertiesRef, value);
79 }
80
81 public string ApplicationRef
82 {
83 get => this.Fields[(int)IIsWebVirtualDirSymbolFields.ApplicationRef].AsString();
84 set => this.Set((int)IIsWebVirtualDirSymbolFields.ApplicationRef, value);
85 }
86 }
87} \ No newline at end of file
diff --git a/src/ext/Iis/wixext/Symbols/IisSymbolDefinitions.cs b/src/ext/Iis/wixext/Symbols/IisSymbolDefinitions.cs
new file mode 100644
index 00000000..d6ed80a2
--- /dev/null
+++ b/src/ext/Iis/wixext/Symbols/IisSymbolDefinitions.cs
@@ -0,0 +1,107 @@
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.Iis
4{
5 using System;
6 using WixToolset.Data;
7
8 public enum IisSymbolDefinitionType
9 {
10 Certificate,
11 CertificateHash,
12 IIsAppPool,
13 IIsFilter,
14 IIsHttpHeader,
15 IIsMimeMap,
16 IIsProperty,
17 IIsWebAddress,
18 IIsWebApplication,
19 IIsWebApplicationExtension,
20 IIsWebDir,
21 IIsWebDirProperties,
22 IIsWebError,
23 IIsWebLog,
24 IIsWebServiceExtension,
25 IIsWebSite,
26 IIsWebSiteCertificates,
27 IIsWebVirtualDir,
28 }
29
30 public static partial class IisSymbolDefinitions
31 {
32 public static readonly Version Version = new Version("4.0.0");
33
34 public static IntermediateSymbolDefinition ByName(string name)
35 {
36 if (!Enum.TryParse(name, out IisSymbolDefinitionType type))
37 {
38 return null;
39 }
40
41 return ByType(type);
42 }
43
44 public static IntermediateSymbolDefinition ByType(IisSymbolDefinitionType type)
45 {
46 switch (type)
47 {
48 case IisSymbolDefinitionType.Certificate:
49 return IisSymbolDefinitions.Certificate;
50
51 case IisSymbolDefinitionType.CertificateHash:
52 return IisSymbolDefinitions.CertificateHash;
53
54 case IisSymbolDefinitionType.IIsAppPool:
55 return IisSymbolDefinitions.IIsAppPool;
56
57 case IisSymbolDefinitionType.IIsFilter:
58 return IisSymbolDefinitions.IIsFilter;
59
60 case IisSymbolDefinitionType.IIsHttpHeader:
61 return IisSymbolDefinitions.IIsHttpHeader;
62
63 case IisSymbolDefinitionType.IIsMimeMap:
64 return IisSymbolDefinitions.IIsMimeMap;
65
66 case IisSymbolDefinitionType.IIsProperty:
67 return IisSymbolDefinitions.IIsProperty;
68
69 case IisSymbolDefinitionType.IIsWebAddress:
70 return IisSymbolDefinitions.IIsWebAddress;
71
72 case IisSymbolDefinitionType.IIsWebApplication:
73 return IisSymbolDefinitions.IIsWebApplication;
74
75 case IisSymbolDefinitionType.IIsWebApplicationExtension:
76 return IisSymbolDefinitions.IIsWebApplicationExtension;
77
78 case IisSymbolDefinitionType.IIsWebDir:
79 return IisSymbolDefinitions.IIsWebDir;
80
81 case IisSymbolDefinitionType.IIsWebDirProperties:
82 return IisSymbolDefinitions.IIsWebDirProperties;
83
84 case IisSymbolDefinitionType.IIsWebError:
85 return IisSymbolDefinitions.IIsWebError;
86
87 case IisSymbolDefinitionType.IIsWebLog:
88 return IisSymbolDefinitions.IIsWebLog;
89
90 case IisSymbolDefinitionType.IIsWebServiceExtension:
91 return IisSymbolDefinitions.IIsWebServiceExtension;
92
93 case IisSymbolDefinitionType.IIsWebSite:
94 return IisSymbolDefinitions.IIsWebSite;
95
96 case IisSymbolDefinitionType.IIsWebSiteCertificates:
97 return IisSymbolDefinitions.IIsWebSiteCertificates;
98
99 case IisSymbolDefinitionType.IIsWebVirtualDir:
100 return IisSymbolDefinitions.IIsWebVirtualDir;
101
102 default:
103 throw new ArgumentOutOfRangeException(nameof(type));
104 }
105 }
106 }
107}
diff --git a/src/ext/Iis/wixext/WixToolset.Iis.wixext.csproj b/src/ext/Iis/wixext/WixToolset.Iis.wixext.csproj
new file mode 100644
index 00000000..81d41e77
--- /dev/null
+++ b/src/ext/Iis/wixext/WixToolset.Iis.wixext.csproj
@@ -0,0 +1,31 @@
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.Iis</RootNamespace>
8 <Description>WiX Toolset Iis Extension</Description>
9 <Title>WiX Toolset Iis Extension</Title>
10 <IsTool>true</IsTool>
11 <ContentTargetFolders>build</ContentTargetFolders>
12 </PropertyGroup>
13
14 <ItemGroup>
15 <Content Include="$(MSBuildThisFileName).targets" />
16 <EmbeddedResource Include="$(OutputPath)..\iis.wixlib" />
17 </ItemGroup>
18
19 <ItemGroup>
20 <PackageReference Include="WixToolset.Data" Version="4.0.*" PrivateAssets="all" />
21 <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" PrivateAssets="all" />
22 </ItemGroup>
23
24 <ItemGroup>
25 <ProjectReference Include="..\wixlib\iis.wixproj" ReferenceOutputAssembly="false" Condition=" '$(NCrunch)'=='' " />
26 </ItemGroup>
27
28 <ItemGroup>
29 <PackageReference Include="Nerdbank.GitVersioning" Version="2.1.65" PrivateAssets="all" />
30 </ItemGroup>
31</Project>
diff --git a/src/ext/Iis/wixext/WixToolset.Iis.wixext.targets b/src/ext/Iis/wixext/WixToolset.Iis.wixext.targets
new file mode 100644
index 00000000..6398fce1
--- /dev/null
+++ b/src/ext/Iis/wixext/WixToolset.Iis.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 <WixToolsetIisWixextPath Condition=" '$(WixToolsetIisWixextPath)' == '' ">$(MSBuildThisFileDirectory)..\tools\WixToolset.Iis.wixext.dll</WixToolsetIisWixextPath>
7 </PropertyGroup>
8 <ItemGroup>
9 <WixExtension Include="$(WixToolsetIisWixextPath)" />
10 </ItemGroup>
11</Project>