summaryrefslogtreecommitdiff
path: root/src/tools/heat/IIsHeatExtension.cs
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2022-07-26 17:20:39 -0700
committerRob Mensching <rob@firegiant.com>2022-08-01 20:25:19 -0700
commita627ca9b720047e633a8fe72003ab9bee31006c5 (patch)
tree2bc8a924bb4141ab718e74d08f6459a0ffe8d573 /src/tools/heat/IIsHeatExtension.cs
parent521eb3c9cf38823a2c4019abb85dc0b3200b92cb (diff)
downloadwix-a627ca9b720047e633a8fe72003ab9bee31006c5.tar.gz
wix-a627ca9b720047e633a8fe72003ab9bee31006c5.tar.bz2
wix-a627ca9b720047e633a8fe72003ab9bee31006c5.zip
Create WixToolset.Heat.nupkg to distribute heat.exe and Heat targets
Moves Heat functionality to the "tools" layer and packages it all up in WixToolset.Heat.nupkg for distribution in WiX v4. Completes 6838
Diffstat (limited to 'src/tools/heat/IIsHeatExtension.cs')
-rw-r--r--src/tools/heat/IIsHeatExtension.cs80
1 files changed, 80 insertions, 0 deletions
diff --git a/src/tools/heat/IIsHeatExtension.cs b/src/tools/heat/IIsHeatExtension.cs
new file mode 100644
index 00000000..be998370
--- /dev/null
+++ b/src/tools/heat/IIsHeatExtension.cs
@@ -0,0 +1,80 @@
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.Harvesters
4{
5 using WixToolset.Harvesters.Data;
6 using WixToolset.Harvesters.Extensibility;
7
8 /// <summary>
9 /// An IIS harvesting extension for the WiX Toolset Harvester application.
10 /// </summary>
11 public sealed class IIsHeatExtension : BaseHeatExtension
12 {
13 /// <summary>
14 /// Gets the supported command line types for this extension.
15 /// </summary>
16 /// <value>The supported command line types for this extension.</value>
17 public override HeatCommandLineOption[] CommandLineTypes
18 {
19 get
20 {
21 return new HeatCommandLineOption[]
22 {
23 new HeatCommandLineOption("website", "harvest an IIS web site"),
24 };
25 }
26 }
27
28 /// <summary>
29 /// Parse the command line options for this extension.
30 /// </summary>
31 /// <param name="type">The active harvester type.</param>
32 /// <param name="args">The option arguments.</param>
33 public override void ParseOptions(string type, string[] args)
34 {
35 bool active = false;
36 IHarvesterExtension harvesterExtension = null;
37 IIsHarvesterMutator iisHarvesterMutator = new IIsHarvesterMutator();
38
39 // select the harvester
40 switch (type)
41 {
42 case "website":
43 harvesterExtension = new IIsWebSiteHarvester();
44 active = true;
45 break;
46 }
47
48 // set default settings
49 iisHarvesterMutator.SetUniqueIdentifiers = true;
50
51 // parse the options
52 foreach (string arg in args)
53 {
54 if (null == arg || 0 == arg.Length) // skip blank arguments
55 {
56 continue;
57 }
58
59 if ('-' == arg[0] || '/' == arg[0])
60 {
61 string parameter = arg.Substring(1);
62
63 if ("suid" == parameter)
64 {
65 iisHarvesterMutator.SetUniqueIdentifiers = false;
66 }
67 }
68 }
69
70 // set the appropriate harvester extension
71 if (active)
72 {
73 this.Core.Harvester.Extension = harvesterExtension;
74 this.Core.Mutator.AddExtension(iisHarvesterMutator);
75 this.Core.Mutator.AddExtension(new IIsFinalizeHarvesterMutator());
76 this.Core.Mutator.AddExtension(new UtilFinalizeHarvesterMutator());
77 }
78 }
79 }
80}