diff options
Diffstat (limited to 'src/wixext')
-rw-r--r-- | src/wixext/Data/messages.xml | 133 | ||||
-rw-r--r-- | src/wixext/Data/tables.xml | 66 | ||||
-rw-r--r-- | src/wixext/VSCompiler.cs | 835 | ||||
-rw-r--r-- | src/wixext/VSDecompiler.cs | 296 | ||||
-rw-r--r-- | src/wixext/VSExtensionData.cs | 55 | ||||
-rw-r--r-- | src/wixext/WixToolset.VisualStudio.wixext.csproj | 69 | ||||
-rw-r--r-- | src/wixext/WixToolset.VisualStudio.wixext.targets | 10 | ||||
-rw-r--r-- | src/wixext/xsd/vs.xsd | 292 |
8 files changed, 1756 insertions, 0 deletions
diff --git a/src/wixext/Data/messages.xml b/src/wixext/Data/messages.xml new file mode 100644 index 00000000..d1c85301 --- /dev/null +++ b/src/wixext/Data/messages.xml | |||
@@ -0,0 +1,133 @@ | |||
1 | <?xml version='1.0' encoding='utf-8'?> | ||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
3 | |||
4 | |||
5 | <Messages Namespace="WixToolset.Extensions" Resources="Data.Messages" xmlns="http://schemas.microsoft.com/genmsgs/2004/07/messages"> | ||
6 | <Class Name="VSErrors" ContainerName="VSErrorEventArgs" BaseContainerName="MessageEventArgs"> | ||
7 | <Message Id="InvalidOutputGroup" Number="5301" SourceLineNumbers="no"> | ||
8 | <Instance> | ||
9 | Invalid project output group: {0}. | ||
10 | <Parameter Type="System.String" Name="outputGroup" /> | ||
11 | </Instance> | ||
12 | </Message> | ||
13 | <Message Id="NoOutputGroupSpecified" Number="5302" SourceLineNumbers="no"> | ||
14 | <Instance> | ||
15 | No project output group specified. | ||
16 | </Instance> | ||
17 | </Message> | ||
18 | <Message Id="CannotLoadMSBuildAssembly" Number="5303" SourceLineNumbers="no"> | ||
19 | <Instance> | ||
20 | Failed to load MSBuild assembly: {0} | ||
21 | <Parameter Type="System.String" Name="innerExceptionMessage" /> | ||
22 | </Instance> | ||
23 | </Message> | ||
24 | <Message Id="CannotLoadMSBuildEngine" Number="5304" SourceLineNumbers="no"> | ||
25 | <Instance> | ||
26 | Failed to load MSBuild engine: {0} | ||
27 | <Parameter Type="System.String" Name="innerExceptionMessage" /> | ||
28 | </Instance> | ||
29 | </Message> | ||
30 | <Message Id="CannotLoadProject" Number="5305" SourceLineNumbers="no"> | ||
31 | <Instance> | ||
32 | Failed to load project {0}: {1} | ||
33 | <Parameter Type="System.String" Name="projectFile" /> | ||
34 | <Parameter Type="System.String" Name="innerExceptionMessage" /> | ||
35 | </Instance> | ||
36 | </Message> | ||
37 | <Message Id="CannotBuildProject" Number="5306" SourceLineNumbers="no"> | ||
38 | <Instance> | ||
39 | Failed to build project {0}: {1} | ||
40 | <Parameter Type="System.String" Name="projectFile" /> | ||
41 | <Parameter Type="System.String" Name="innerExceptionMessage" /> | ||
42 | </Instance> | ||
43 | </Message> | ||
44 | <Message Id="BuildFailed" Number="5307" SourceLineNumbers="no"> | ||
45 | <Instance> | ||
46 | Build failed. | ||
47 | </Instance> | ||
48 | </Message> | ||
49 | <Message Id="MissingProjectOutputGroup" Number="5308" SourceLineNumbers="no"> | ||
50 | <Instance> | ||
51 | Missing project output group '{1}' in project {0}. | ||
52 | <Parameter Type="System.String" Name="projectFile" /> | ||
53 | <Parameter Type="System.String" Name="outputGroup" /> | ||
54 | </Instance> | ||
55 | </Message> | ||
56 | <Message Id="DirectoryAttributeAccessorBadType" Number="5309" SourceLineNumbers="no"> | ||
57 | <Instance> | ||
58 | DirectoryAttributeAccessor tried to access an invalid element type for attribute '{0'}. | ||
59 | <Parameter Type="System.String" Name="attributeName" /> | ||
60 | </Instance> | ||
61 | </Message> | ||
62 | <Message Id="InvalidOutputType" Number="5310" SourceLineNumbers="no"> | ||
63 | <Instance> | ||
64 | Invalid generated type: {0}. Must be one of: components, container, payloadgroup, layout. | ||
65 | <Parameter Type="System.String" Name="generateType" /> | ||
66 | </Instance> | ||
67 | </Message> | ||
68 | <Message Id="InvalidDirectoryId" Number="5311" SourceLineNumbers="no"> | ||
69 | <Instance> | ||
70 | Invalid directory ID: {0}. Check that it doesn't start with a hyphen or slash. | ||
71 | <Parameter Type="System.String" Name="generateType" /> | ||
72 | </Instance> | ||
73 | </Message> | ||
74 | <Message Id="InvalidProjectName" Number="5312" SourceLineNumbers="no"> | ||
75 | <Instance> | ||
76 | Invalid project name: {0}. Check that it doesn't start with a hyphen or slash. | ||
77 | <Parameter Type="System.String" Name="generateType" /> | ||
78 | </Instance> | ||
79 | </Message> | ||
80 | <Message Id="BuildErrorDuringHarvesting" Number="5313" SourceLineNumbers="no"> | ||
81 | <Instance> | ||
82 | Build error during harvesting: {0} | ||
83 | <Parameter Type="System.String" Name="buildError" /> | ||
84 | </Instance> | ||
85 | </Message> | ||
86 | <Message Id="CannotLoadMSBuildWrapperAssembly" Number="5314" SourceLineNumbers="no"> | ||
87 | <Instance> | ||
88 | Failed to load MSBuild wrapper assembly: {0} | ||
89 | <Parameter Type="System.String" Name="innerExceptionMessage" /> | ||
90 | </Instance> | ||
91 | </Message> | ||
92 | <Message Id="CannotLoadMSBuildWrapperType" Number="5315" SourceLineNumbers="no"> | ||
93 | <Instance> | ||
94 | Failed to load MSBuild wrapper type: {0} | ||
95 | <Parameter Type="System.String" Name="innerExceptionMessage" /> | ||
96 | </Instance> | ||
97 | </Message> | ||
98 | <Message Id="CannotLoadMSBuildWrapperObject" Number="5316" SourceLineNumbers="no"> | ||
99 | <Instance> | ||
100 | Failed to load MSBuild wrapper object: {0} | ||
101 | <Parameter Type="System.String" Name="innerExceptionMessage" /> | ||
102 | </Instance> | ||
103 | </Message> | ||
104 | </Class> | ||
105 | <Class Name="VSWarnings" ContainerName="VSWarningEventArgs" BaseContainerName="MessageEventArgs"> | ||
106 | <Message Id="NoLogger" Number="5399" SourceLineNumbers="no"> | ||
107 | <Instance> | ||
108 | Failed to set loggers: {0} | ||
109 | <Parameter Type="System.String" Name="exceptionMessage" /> | ||
110 | </Instance> | ||
111 | </Message> | ||
112 | <Message Id="NoProjectConfiguration" Number="5398" SourceLineNumbers="no"> | ||
113 | <Instance> | ||
114 | Failed to set project configuration and platform: {0} | ||
115 | <Parameter Type="System.String" Name="exceptionMessage" /> | ||
116 | </Instance> | ||
117 | </Message> | ||
118 | </Class> | ||
119 | <Class Name="VSVerboses" ContainerName="VSVerboseEventArgs" BaseContainerName="MessageEventArgs"> | ||
120 | <Message Id="FoundToolsVersion" Number="5379" SourceLineNumbers="no"> | ||
121 | <Instance> | ||
122 | Found ToolsVersion {0} inside project file. | ||
123 | <Parameter Type="System.String" Name="toolsVersion" /> | ||
124 | </Instance> | ||
125 | </Message> | ||
126 | <Message Id="LoadingProject" Number="5378" SourceLineNumbers="no"> | ||
127 | <Instance> | ||
128 | Loading project using MSBuild version {0}. | ||
129 | <Parameter Type="System.String" Name="msbuildVersion" /> | ||
130 | </Instance> | ||
131 | </Message> | ||
132 | </Class> | ||
133 | </Messages> | ||
diff --git a/src/wixext/Data/tables.xml b/src/wixext/Data/tables.xml new file mode 100644 index 00000000..e9c86097 --- /dev/null +++ b/src/wixext/Data/tables.xml | |||
@@ -0,0 +1,66 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
3 | |||
4 | |||
5 | <tableDefinitions xmlns="http://wixtoolset.org/schemas/v4/wi/tables"> | ||
6 | <tableDefinition name="HelpFile" createSymbols="yes"> | ||
7 | <columnDefinition name="HelpFileKey" type="string" length="72" primaryKey="yes" modularize="column" | ||
8 | category="identifier" description="Primary Key for HelpFile Table (required)."/> | ||
9 | <columnDefinition name="HelpFileName" type="string" length="72" | ||
10 | category="text" description="Internal Microsoft Help ID for this HelpFile (required)."/> | ||
11 | <columnDefinition name="LangID" type="number" length="2" nullable="yes" | ||
12 | category="language" description="Language ID for content file (optional)."/> | ||
13 | <columnDefinition name="File_HxS" type="string" length="72" modularize="column" | ||
14 | keyTable="File" keyColumn="1" category="identifier" description="Key for HxS (Title) file (required)."/> | ||
15 | <columnDefinition name="File_HxI" type="string" length="72" nullable="yes" modularize="column" | ||
16 | keyTable="File" keyColumn="1" category="identifier" description="Key for HxI (Index) file (optional)."/> | ||
17 | <columnDefinition name="File_HxQ" type="string" length="72" nullable="yes" modularize="column" | ||
18 | keyTable="File" keyColumn="1" category="identifier" description="Key for HxQ (Query) file (optional)."/> | ||
19 | <columnDefinition name="File_HxR" type="string" length="72" nullable="yes" modularize="column" | ||
20 | keyTable="File" keyColumn="1" category="identifier" description="Key for HxR (Attributes) file (optional)."/> | ||
21 | <columnDefinition name="File_Samples" type="string" length="72" nullable="yes" modularize="column" | ||
22 | keyTable="File" keyColumn="1" category="identifier" description="Key for a file that is in the 'root' of the samples directory for this HelpFile (optional)."/> | ||
23 | </tableDefinition> | ||
24 | <tableDefinition name="HelpFileToNamespace"> | ||
25 | <columnDefinition name="HelpFile_" type="string" length="72" primaryKey="yes" modularize="column" | ||
26 | keyTable="HelpFile" keyColumn="1" category="identifier" description="Foreign key into HelpFile table (required)."/> | ||
27 | <columnDefinition name="HelpNamespace_" type="string" length="72" primaryKey="yes" | ||
28 | keyTable="HelpNamespace" keyColumn="1" category="identifier" description="Foreign key into HelpNamespace table (required)."/> | ||
29 | </tableDefinition> | ||
30 | <tableDefinition name="HelpFilter" createSymbols="yes"> | ||
31 | <columnDefinition name="FilterKey" type="string" length="72" primaryKey="yes" modularize="column" | ||
32 | category="identifier" description="Primary Key for HelpFilter (required)."/> | ||
33 | <columnDefinition name="Description" type="localized" length="0" | ||
34 | category="text" description="Friendly name for Filter (required)."/> | ||
35 | <columnDefinition name="QueryString" type="string" length="0" nullable="yes" | ||
36 | category="text" description="Query String for Help Filter (optional)."/> | ||
37 | </tableDefinition> | ||
38 | <tableDefinition name="HelpFilterToNamespace"> | ||
39 | <columnDefinition name="HelpFilter_" type="string" length="72" primaryKey="yes" modularize="column" | ||
40 | keyTable="HelpFilter" keyColumn="1" category="identifier" description="Foreign key into HelpFilter table (required)."/> | ||
41 | <columnDefinition name="HelpNamespace_" type="string" length="72" primaryKey="yes" | ||
42 | keyTable="HelpNamespace" keyColumn="1" category="identifier" description="Foreign key into HelpNamespace table (required)."/> | ||
43 | </tableDefinition> | ||
44 | <tableDefinition name="HelpNamespace" createSymbols="yes"> | ||
45 | <columnDefinition name="NamespaceKey" type="string" length="72" primaryKey="yes" | ||
46 | category="identifier" description="Primary Key for HelpNamespace (required)."/> | ||
47 | <columnDefinition name="NamespaceName" type="string" length="0" | ||
48 | category="text" description="Internal Microsoft Help ID for this Namespace (required)."/> | ||
49 | <columnDefinition name="File_Collection" type="string" length="72" modularize="column" | ||
50 | keyTable="File" keyColumn="1" category="text" description="Key for HxC (Collection) file (required)."/> | ||
51 | <columnDefinition name="Description" type="localized" length="0" nullable="yes" | ||
52 | category="text" description="Friendly name for Namespace (optional)."/> | ||
53 | </tableDefinition> | ||
54 | <tableDefinition name="HelpPlugin"> | ||
55 | <columnDefinition name="HelpNamespace_" type="string" length="72" primaryKey="yes" | ||
56 | keyTable="HelpNamespace" keyColumn="1" category="identifier" description="Forein Key into HelpNamespace table for the child namespace that will be plugged into the parent namespace (required)."/> | ||
57 | <columnDefinition name="HelpNamespace_Parent" type="string" length="72" primaryKey="yes" | ||
58 | category="identifier" description="Forein Key into HelpNamespace table for the parent namespace into which the child will be inserted (required)."/> | ||
59 | <columnDefinition name="File_HxT" type="string" length="72" nullable="yes" modularize="column" | ||
60 | keyTable="File" keyColumn="1" category="identifier" description="Key for HxT file of child namespace (optional)."/> | ||
61 | <columnDefinition name="File_HxA" type="string" length="72" nullable="yes" modularize="column" | ||
62 | keyTable="File" keyColumn="1" category="identifier" description="Key for HxA (Attributes) file of child namespace (optional)."/> | ||
63 | <columnDefinition name="File_ParentHxT" type="string" length="72" nullable="yes" modularize="column" | ||
64 | keyTable="File" keyColumn="1" category="identifier" description="Key for HxT file of parent namespace that now includes the new child namespace (optional)."/> | ||
65 | </tableDefinition> | ||
66 | </tableDefinitions> | ||
diff --git a/src/wixext/VSCompiler.cs b/src/wixext/VSCompiler.cs new file mode 100644 index 00000000..cf6226dd --- /dev/null +++ b/src/wixext/VSCompiler.cs | |||
@@ -0,0 +1,835 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensions | ||
4 | { | ||
5 | using System; | ||
6 | using System.Collections.Generic; | ||
7 | using System.Xml.Linq; | ||
8 | using WixToolset.Data; | ||
9 | using WixToolset.Extensibility; | ||
10 | |||
11 | /// <summary> | ||
12 | /// The compiler for the WiX Toolset Visual Studio Extension. | ||
13 | /// </summary> | ||
14 | public sealed class VSCompiler : CompilerExtension | ||
15 | { | ||
16 | internal const int MsidbCustomActionTypeExe = 0x00000002; // Target = command line args | ||
17 | internal const int MsidbCustomActionTypeProperty = 0x00000030; // Source = full path to executable | ||
18 | internal const int MsidbCustomActionTypeContinue = 0x00000040; // ignore action return status; continue running | ||
19 | internal const int MsidbCustomActionTypeRollback = 0x00000100; // in conjunction with InScript: queue in Rollback script | ||
20 | internal const int MsidbCustomActionTypeInScript = 0x00000400; // queue for execution within script | ||
21 | internal const int MsidbCustomActionTypeNoImpersonate = 0x00000800; // queue for not impersonating | ||
22 | |||
23 | /// <summary> | ||
24 | /// Instantiate a new HelpCompiler. | ||
25 | /// </summary> | ||
26 | public VSCompiler() | ||
27 | { | ||
28 | this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/vs"; | ||
29 | } | ||
30 | |||
31 | /// <summary> | ||
32 | /// Processes an element for the Compiler. | ||
33 | /// </summary> | ||
34 | /// <param name="sourceLineNumbers">Source line number for the parent element.</param> | ||
35 | /// <param name="parentElement">Parent element of element to process.</param> | ||
36 | /// <param name="element">Element to process.</param> | ||
37 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> | ||
38 | public override void ParseElement(XElement parentElement, XElement element, IDictionary<string, string> context) | ||
39 | { | ||
40 | switch (parentElement.Name.LocalName) | ||
41 | { | ||
42 | case "Component": | ||
43 | switch (element.Name.LocalName) | ||
44 | { | ||
45 | case "VsixPackage": | ||
46 | this.ParseVsixPackageElement(element, context["ComponentId"], null); | ||
47 | break; | ||
48 | default: | ||
49 | this.Core.UnexpectedElement(parentElement, element); | ||
50 | break; | ||
51 | } | ||
52 | break; | ||
53 | case "File": | ||
54 | switch (element.Name.LocalName) | ||
55 | { | ||
56 | case "HelpCollection": | ||
57 | this.ParseHelpCollectionElement(element, context["FileId"]); | ||
58 | break; | ||
59 | case "HelpFile": | ||
60 | this.ParseHelpFileElement(element, context["FileId"]); | ||
61 | break; | ||
62 | case "VsixPackage": | ||
63 | this.ParseVsixPackageElement(element, context["ComponentId"], context["FileId"]); | ||
64 | break; | ||
65 | default: | ||
66 | this.Core.UnexpectedElement(parentElement, element); | ||
67 | break; | ||
68 | } | ||
69 | break; | ||
70 | case "Fragment": | ||
71 | case "Module": | ||
72 | case "Product": | ||
73 | switch (element.Name.LocalName) | ||
74 | { | ||
75 | case "HelpCollectionRef": | ||
76 | this.ParseHelpCollectionRefElement(element); | ||
77 | break; | ||
78 | case "HelpFilter": | ||
79 | this.ParseHelpFilterElement(element); | ||
80 | break; | ||
81 | default: | ||
82 | this.Core.UnexpectedElement(parentElement, element); | ||
83 | break; | ||
84 | } | ||
85 | break; | ||
86 | default: | ||
87 | this.Core.UnexpectedElement(parentElement, element); | ||
88 | break; | ||
89 | } | ||
90 | } | ||
91 | |||
92 | /// <summary> | ||
93 | /// Parses a HelpCollectionRef element. | ||
94 | /// </summary> | ||
95 | /// <param name="node">Element to process.</param> | ||
96 | private void ParseHelpCollectionRefElement(XElement node) | ||
97 | { | ||
98 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
99 | string id = null; | ||
100 | |||
101 | foreach (XAttribute attrib in node.Attributes()) | ||
102 | { | ||
103 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
104 | { | ||
105 | switch (attrib.Name.LocalName) | ||
106 | { | ||
107 | case "Id": | ||
108 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
109 | this.Core.CreateSimpleReference(sourceLineNumbers, "HelpNamespace", id); | ||
110 | break; | ||
111 | default: | ||
112 | this.Core.UnexpectedAttribute(node, attrib); | ||
113 | break; | ||
114 | } | ||
115 | } | ||
116 | else | ||
117 | { | ||
118 | this.Core.ParseExtensionAttribute(node, attrib); | ||
119 | } | ||
120 | } | ||
121 | |||
122 | if (null == id) | ||
123 | { | ||
124 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); | ||
125 | } | ||
126 | |||
127 | foreach (XElement child in node.Elements()) | ||
128 | { | ||
129 | if (this.Namespace == child.Name.Namespace) | ||
130 | { | ||
131 | SourceLineNumber childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); | ||
132 | switch (child.Name.LocalName) | ||
133 | { | ||
134 | case "HelpFileRef": | ||
135 | this.ParseHelpFileRefElement(child, id); | ||
136 | break; | ||
137 | default: | ||
138 | this.Core.UnexpectedElement(node, child); | ||
139 | break; | ||
140 | } | ||
141 | } | ||
142 | else | ||
143 | { | ||
144 | this.Core.ParseExtensionElement(node, child); | ||
145 | } | ||
146 | } | ||
147 | } | ||
148 | |||
149 | /// <summary> | ||
150 | /// Parses a HelpCollection element. | ||
151 | /// </summary> | ||
152 | /// <param name="node">Element to process.</param> | ||
153 | /// <param name="fileId">Identifier of the parent File element.</param> | ||
154 | private void ParseHelpCollectionElement(XElement node, string fileId) | ||
155 | { | ||
156 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
157 | string id = null; | ||
158 | string description = null; | ||
159 | string name = null; | ||
160 | YesNoType suppressCAs = YesNoType.No; | ||
161 | |||
162 | foreach (XAttribute attrib in node.Attributes()) | ||
163 | { | ||
164 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
165 | { | ||
166 | switch (attrib.Name.LocalName) | ||
167 | { | ||
168 | case "Id": | ||
169 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
170 | break; | ||
171 | case "Description": | ||
172 | description = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
173 | break; | ||
174 | case "Name": | ||
175 | name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
176 | break; | ||
177 | case "SuppressCustomActions": | ||
178 | suppressCAs = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
179 | break; | ||
180 | default: | ||
181 | this.Core.UnexpectedAttribute(node, attrib); | ||
182 | break; | ||
183 | } | ||
184 | } | ||
185 | else | ||
186 | { | ||
187 | this.Core.ParseExtensionAttribute(node, attrib); | ||
188 | } | ||
189 | } | ||
190 | |||
191 | if (null == id) | ||
192 | { | ||
193 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); | ||
194 | } | ||
195 | |||
196 | if (null == description) | ||
197 | { | ||
198 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Description")); | ||
199 | } | ||
200 | |||
201 | if (null == name) | ||
202 | { | ||
203 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); | ||
204 | } | ||
205 | |||
206 | foreach (XElement child in node.Elements()) | ||
207 | { | ||
208 | if (this.Namespace == child.Name.Namespace) | ||
209 | { | ||
210 | switch (child.Name.LocalName) | ||
211 | { | ||
212 | case "HelpFileRef": | ||
213 | this.ParseHelpFileRefElement(child, id); | ||
214 | break; | ||
215 | case "HelpFilterRef": | ||
216 | this.ParseHelpFilterRefElement(child, id); | ||
217 | break; | ||
218 | case "PlugCollectionInto": | ||
219 | this.ParsePlugCollectionIntoElement(child, id); | ||
220 | break; | ||
221 | default: | ||
222 | this.Core.UnexpectedElement(node, child); | ||
223 | break; | ||
224 | } | ||
225 | } | ||
226 | else | ||
227 | { | ||
228 | this.Core.ParseExtensionElement(node, child); | ||
229 | } | ||
230 | } | ||
231 | |||
232 | if (!this.Core.EncounteredError) | ||
233 | { | ||
234 | Row row = this.Core.CreateRow(sourceLineNumbers, "HelpNamespace"); | ||
235 | row[0] = id; | ||
236 | row[1] = name; | ||
237 | row[2] = fileId; | ||
238 | row[3] = description; | ||
239 | |||
240 | if (YesNoType.No == suppressCAs) | ||
241 | { | ||
242 | this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "CA_RegisterMicrosoftHelp.3643236F_FC70_11D3_A536_0090278A1BB8"); | ||
243 | } | ||
244 | } | ||
245 | } | ||
246 | |||
247 | /// <summary> | ||
248 | /// Parses a HelpFile element. | ||
249 | /// </summary> | ||
250 | /// <param name="node">Element to process.</param> | ||
251 | /// <param name="fileId">Identifier of the parent file element.</param> | ||
252 | private void ParseHelpFileElement(XElement node, string fileId) | ||
253 | { | ||
254 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
255 | string id = null; | ||
256 | string name = null; | ||
257 | int language = CompilerConstants.IntegerNotSet; | ||
258 | string hxi = null; | ||
259 | string hxq = null; | ||
260 | string hxr = null; | ||
261 | string samples = null; | ||
262 | YesNoType suppressCAs = YesNoType.No; | ||
263 | |||
264 | foreach (XAttribute attrib in node.Attributes()) | ||
265 | { | ||
266 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
267 | { | ||
268 | switch (attrib.Name.LocalName) | ||
269 | { | ||
270 | case "Id": | ||
271 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
272 | break; | ||
273 | case "AttributeIndex": | ||
274 | hxr = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
275 | this.Core.CreateSimpleReference(sourceLineNumbers, "File", hxr); | ||
276 | break; | ||
277 | case "Index": | ||
278 | hxi = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
279 | this.Core.CreateSimpleReference(sourceLineNumbers, "File", hxi); | ||
280 | break; | ||
281 | case "Language": | ||
282 | language = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue); | ||
283 | break; | ||
284 | case "Name": | ||
285 | name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
286 | break; | ||
287 | case "SampleLocation": | ||
288 | samples = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
289 | this.Core.CreateSimpleReference(sourceLineNumbers, "File", samples); | ||
290 | break; | ||
291 | case "Search": | ||
292 | hxq = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
293 | this.Core.CreateSimpleReference(sourceLineNumbers, "File", hxq); | ||
294 | break; | ||
295 | case "SuppressCustomActions": | ||
296 | suppressCAs = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
297 | break; | ||
298 | default: | ||
299 | this.Core.UnexpectedAttribute(node, attrib); | ||
300 | break; | ||
301 | } | ||
302 | } | ||
303 | else | ||
304 | { | ||
305 | this.Core.ParseExtensionAttribute(node, attrib); | ||
306 | } | ||
307 | } | ||
308 | |||
309 | if (null == id) | ||
310 | { | ||
311 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); | ||
312 | } | ||
313 | |||
314 | if (null == name) | ||
315 | { | ||
316 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); | ||
317 | } | ||
318 | |||
319 | //uninstall will always fail silently, leaving file registered, if Language is not set | ||
320 | if (CompilerConstants.IntegerNotSet == language) | ||
321 | { | ||
322 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Language")); | ||
323 | } | ||
324 | |||
325 | this.Core.ParseForExtensionElements(node); | ||
326 | |||
327 | if (!this.Core.EncounteredError) | ||
328 | { | ||
329 | Row row = this.Core.CreateRow(sourceLineNumbers, "HelpFile"); | ||
330 | row[0] = id; | ||
331 | row[1] = name; | ||
332 | row[2] = language; | ||
333 | row[3] = fileId; | ||
334 | row[4] = hxi; | ||
335 | row[5] = hxq; | ||
336 | row[6] = hxr; | ||
337 | row[7] = samples; | ||
338 | |||
339 | if (YesNoType.No == suppressCAs) | ||
340 | { | ||
341 | this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "CA_RegisterMicrosoftHelp.3643236F_FC70_11D3_A536_0090278A1BB8"); | ||
342 | } | ||
343 | } | ||
344 | } | ||
345 | |||
346 | /// <summary> | ||
347 | /// Parses a HelpFileRef element. | ||
348 | /// </summary> | ||
349 | /// <param name="node">Element to process.</param> | ||
350 | /// <param name="collectionId">Identifier of the parent help collection.</param> | ||
351 | private void ParseHelpFileRefElement(XElement node, string collectionId) | ||
352 | { | ||
353 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
354 | string id = null; | ||
355 | |||
356 | foreach (XAttribute attrib in node.Attributes()) | ||
357 | { | ||
358 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
359 | { | ||
360 | switch (attrib.Name.LocalName) | ||
361 | { | ||
362 | case "Id": | ||
363 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
364 | this.Core.CreateSimpleReference(sourceLineNumbers, "HelpFile", id); | ||
365 | break; | ||
366 | default: | ||
367 | this.Core.UnexpectedAttribute(node, attrib); | ||
368 | break; | ||
369 | } | ||
370 | } | ||
371 | else | ||
372 | { | ||
373 | this.Core.ParseExtensionAttribute(node, attrib); | ||
374 | } | ||
375 | } | ||
376 | |||
377 | if (null == id) | ||
378 | { | ||
379 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); | ||
380 | } | ||
381 | |||
382 | this.Core.ParseForExtensionElements(node); | ||
383 | |||
384 | if (!this.Core.EncounteredError) | ||
385 | { | ||
386 | Row row = this.Core.CreateRow(sourceLineNumbers, "HelpFileToNamespace"); | ||
387 | row[0] = id; | ||
388 | row[1] = collectionId; | ||
389 | } | ||
390 | } | ||
391 | |||
392 | /// <summary> | ||
393 | /// Parses a HelpFilter element. | ||
394 | /// </summary> | ||
395 | /// <param name="node">Element to process.</param> | ||
396 | private void ParseHelpFilterElement(XElement node) | ||
397 | { | ||
398 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
399 | string id = null; | ||
400 | string filterDefinition = null; | ||
401 | string name = null; | ||
402 | YesNoType suppressCAs = YesNoType.No; | ||
403 | |||
404 | foreach (XAttribute attrib in node.Attributes()) | ||
405 | { | ||
406 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
407 | { | ||
408 | switch (attrib.Name.LocalName) | ||
409 | { | ||
410 | case "Id": | ||
411 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
412 | break; | ||
413 | case "FilterDefinition": | ||
414 | filterDefinition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
415 | break; | ||
416 | case "Name": | ||
417 | name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
418 | break; | ||
419 | case "SuppressCustomActions": | ||
420 | suppressCAs = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
421 | break; | ||
422 | default: | ||
423 | this.Core.UnexpectedAttribute(node, attrib); | ||
424 | break; | ||
425 | } | ||
426 | } | ||
427 | else | ||
428 | { | ||
429 | this.Core.ParseExtensionAttribute(node, attrib); | ||
430 | } | ||
431 | } | ||
432 | |||
433 | if (null == id) | ||
434 | { | ||
435 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); | ||
436 | } | ||
437 | |||
438 | if (null == name) | ||
439 | { | ||
440 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); | ||
441 | } | ||
442 | |||
443 | this.Core.ParseForExtensionElements(node); | ||
444 | |||
445 | if (!this.Core.EncounteredError) | ||
446 | { | ||
447 | Row row = this.Core.CreateRow(sourceLineNumbers, "HelpFilter"); | ||
448 | row[0] = id; | ||
449 | row[1] = name; | ||
450 | row[2] = filterDefinition; | ||
451 | |||
452 | if (YesNoType.No == suppressCAs) | ||
453 | { | ||
454 | this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", "CA_RegisterMicrosoftHelp.3643236F_FC70_11D3_A536_0090278A1BB8"); | ||
455 | } | ||
456 | } | ||
457 | } | ||
458 | |||
459 | /// <summary> | ||
460 | /// Parses a HelpFilterRef element. | ||
461 | /// </summary> | ||
462 | /// <param name="node">Element to process.</param> | ||
463 | /// <param name="collectionId">Identifier of the parent help collection.</param> | ||
464 | private void ParseHelpFilterRefElement(XElement node, string collectionId) | ||
465 | { | ||
466 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
467 | string id = null; | ||
468 | |||
469 | foreach (XAttribute attrib in node.Attributes()) | ||
470 | { | ||
471 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
472 | { | ||
473 | switch (attrib.Name.LocalName) | ||
474 | { | ||
475 | case "Id": | ||
476 | id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
477 | this.Core.CreateSimpleReference(sourceLineNumbers, "HelpFilter", id); | ||
478 | break; | ||
479 | default: | ||
480 | this.Core.UnexpectedAttribute(node, attrib); | ||
481 | break; | ||
482 | } | ||
483 | } | ||
484 | else | ||
485 | { | ||
486 | this.Core.ParseExtensionAttribute(node, attrib); | ||
487 | } | ||
488 | } | ||
489 | |||
490 | if (null == id) | ||
491 | { | ||
492 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); | ||
493 | } | ||
494 | |||
495 | this.Core.ParseForExtensionElements(node); | ||
496 | |||
497 | if (!this.Core.EncounteredError) | ||
498 | { | ||
499 | Row row = this.Core.CreateRow(sourceLineNumbers, "HelpFilterToNamespace"); | ||
500 | row[0] = id; | ||
501 | row[1] = collectionId; | ||
502 | } | ||
503 | } | ||
504 | |||
505 | /// <summary> | ||
506 | /// Parses a PlugCollectionInto element. | ||
507 | /// </summary> | ||
508 | /// <param name="node">Element to process.</param> | ||
509 | /// <param name="parentId">Identifier of the parent help collection.</param> | ||
510 | private void ParsePlugCollectionIntoElement(XElement node, string parentId) | ||
511 | { | ||
512 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
513 | string hxa = null; | ||
514 | string hxt = null; | ||
515 | string hxtParent = null; | ||
516 | string namespaceParent = null; | ||
517 | string feature = null; | ||
518 | YesNoType suppressExternalNamespaces = YesNoType.No; | ||
519 | bool pluginVS05 = false; | ||
520 | bool pluginVS08 = false; | ||
521 | |||
522 | foreach (XAttribute attrib in node.Attributes()) | ||
523 | { | ||
524 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
525 | { | ||
526 | switch (attrib.Name.LocalName) | ||
527 | { | ||
528 | case "Attributes": | ||
529 | hxa = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
530 | break; | ||
531 | case "TableOfContents": | ||
532 | hxt = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
533 | break; | ||
534 | case "TargetCollection": | ||
535 | namespaceParent = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
536 | break; | ||
537 | case "TargetTableOfContents": | ||
538 | hxtParent = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
539 | break; | ||
540 | case "TargetFeature": | ||
541 | feature = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
542 | break; | ||
543 | case "SuppressExternalNamespaces": | ||
544 | suppressExternalNamespaces = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
545 | break; | ||
546 | default: | ||
547 | this.Core.UnexpectedAttribute(node, attrib); | ||
548 | break; | ||
549 | } | ||
550 | } | ||
551 | else | ||
552 | { | ||
553 | this.Core.ParseExtensionAttribute(node, attrib); | ||
554 | } | ||
555 | } | ||
556 | |||
557 | pluginVS05 = namespaceParent.Equals("MS_VSIPCC_v80", StringComparison.Ordinal); | ||
558 | pluginVS08 = namespaceParent.Equals("MS.VSIPCC.v90", StringComparison.Ordinal); | ||
559 | |||
560 | if (null == namespaceParent) | ||
561 | { | ||
562 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "TargetCollection")); | ||
563 | } | ||
564 | |||
565 | if (null == feature && (pluginVS05 || pluginVS08) && YesNoType.No == suppressExternalNamespaces) | ||
566 | { | ||
567 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "TargetFeature")); | ||
568 | } | ||
569 | |||
570 | this.Core.ParseForExtensionElements(node); | ||
571 | |||
572 | if (!this.Core.EncounteredError) | ||
573 | { | ||
574 | Row row = this.Core.CreateRow(sourceLineNumbers, "HelpPlugin"); | ||
575 | row[0] = parentId; | ||
576 | row[1] = namespaceParent; | ||
577 | row[2] = hxt; | ||
578 | row[3] = hxa; | ||
579 | row[4] = hxtParent; | ||
580 | |||
581 | if (pluginVS05) | ||
582 | { | ||
583 | if (YesNoType.No == suppressExternalNamespaces) | ||
584 | { | ||
585 | // Bring in the help 2 base namespace components for VS 2005 | ||
586 | this.Core.CreateComplexReference(sourceLineNumbers, ComplexReferenceParentType.Feature, feature, String.Empty, | ||
587 | ComplexReferenceChildType.ComponentGroup, "Help2_VS2005_Namespace_Components", false); | ||
588 | // Reference CustomAction since nothing will happen without it | ||
589 | this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", | ||
590 | "CA_HxMerge_VSIPCC_VSCC"); | ||
591 | } | ||
592 | } | ||
593 | else if (pluginVS08) | ||
594 | { | ||
595 | if (YesNoType.No == suppressExternalNamespaces) | ||
596 | { | ||
597 | // Bring in the help 2 base namespace components for VS 2008 | ||
598 | this.Core.CreateComplexReference(sourceLineNumbers, ComplexReferenceParentType.Feature, feature, String.Empty, | ||
599 | ComplexReferenceChildType.ComponentGroup, "Help2_VS2008_Namespace_Components", false); | ||
600 | // Reference CustomAction since nothing will happen without it | ||
601 | this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", | ||
602 | "CA_ScheduleExtHelpPlugin_VSCC_VSIPCC"); | ||
603 | } | ||
604 | } | ||
605 | else | ||
606 | { | ||
607 | // Reference the parent namespace to enforce the foreign key relationship | ||
608 | this.Core.CreateSimpleReference(sourceLineNumbers, "HelpNamespace", | ||
609 | namespaceParent); | ||
610 | } | ||
611 | } | ||
612 | } | ||
613 | |||
614 | /// <summary> | ||
615 | /// Parses a VsixPackage element. | ||
616 | /// </summary> | ||
617 | /// <param name="node">Element to process.</param> | ||
618 | /// <param name="componentId">Identifier of the parent Component element.</param> | ||
619 | /// <param name="fileId">Identifier of the parent File element.</param> | ||
620 | private void ParseVsixPackageElement(XElement node, string componentId, string fileId) | ||
621 | { | ||
622 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
623 | string propertyId = "VS_VSIX_INSTALLER_PATH"; | ||
624 | string packageId = null; | ||
625 | YesNoType permanent = YesNoType.NotSet; | ||
626 | string target = null; | ||
627 | string targetVersion = null; | ||
628 | YesNoType vital = YesNoType.NotSet; | ||
629 | |||
630 | foreach (XAttribute attrib in node.Attributes()) | ||
631 | { | ||
632 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
633 | { | ||
634 | switch (attrib.Name.LocalName) | ||
635 | { | ||
636 | case "File": | ||
637 | if (String.IsNullOrEmpty(fileId)) | ||
638 | { | ||
639 | fileId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
640 | } | ||
641 | else | ||
642 | { | ||
643 | this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "File", "File")); | ||
644 | } | ||
645 | break; | ||
646 | case "PackageId": | ||
647 | packageId = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
648 | break; | ||
649 | case "Permanent": | ||
650 | permanent = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
651 | break; | ||
652 | case "Target": | ||
653 | target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
654 | switch (target.ToLowerInvariant()) | ||
655 | { | ||
656 | case "integrated": | ||
657 | case "integratedshell": | ||
658 | target = "IntegratedShell"; | ||
659 | break; | ||
660 | case "professional": | ||
661 | target = "Pro"; | ||
662 | break; | ||
663 | case "premium": | ||
664 | target = "Premium"; | ||
665 | break; | ||
666 | case "ultimate": | ||
667 | target = "Ultimate"; | ||
668 | break; | ||
669 | case "vbexpress": | ||
670 | target = "VBExpress"; | ||
671 | break; | ||
672 | case "vcexpress": | ||
673 | target = "VCExpress"; | ||
674 | break; | ||
675 | case "vcsexpress": | ||
676 | target = "VCSExpress"; | ||
677 | break; | ||
678 | case "vwdexpress": | ||
679 | target = "VWDExpress"; | ||
680 | break; | ||
681 | } | ||
682 | break; | ||
683 | case "TargetVersion": | ||
684 | targetVersion = this.Core.GetAttributeVersionValue(sourceLineNumbers, attrib); | ||
685 | break; | ||
686 | case "Vital": | ||
687 | vital = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
688 | break; | ||
689 | case "VsixInstallerPathProperty": | ||
690 | propertyId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
691 | break; | ||
692 | default: | ||
693 | this.Core.UnexpectedAttribute(node, attrib); | ||
694 | break; | ||
695 | } | ||
696 | } | ||
697 | else | ||
698 | { | ||
699 | this.Core.ParseExtensionAttribute(node, attrib); | ||
700 | } | ||
701 | } | ||
702 | |||
703 | if (String.IsNullOrEmpty(fileId)) | ||
704 | { | ||
705 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "File")); | ||
706 | } | ||
707 | |||
708 | if (String.IsNullOrEmpty(packageId)) | ||
709 | { | ||
710 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "PackageId")); | ||
711 | } | ||
712 | |||
713 | if (!String.IsNullOrEmpty(target) && String.IsNullOrEmpty(targetVersion)) | ||
714 | { | ||
715 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "TargetVersion", "Target")); | ||
716 | } | ||
717 | else if (String.IsNullOrEmpty(target) && !String.IsNullOrEmpty(targetVersion)) | ||
718 | { | ||
719 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Target", "TargetVersion")); | ||
720 | } | ||
721 | |||
722 | this.Core.ParseForExtensionElements(node); | ||
723 | |||
724 | if (!this.Core.EncounteredError) | ||
725 | { | ||
726 | // Ensure there is a reference to the AppSearch Property that will find the VsixInstaller.exe. | ||
727 | this.Core.CreateSimpleReference(sourceLineNumbers, "Property", propertyId); | ||
728 | |||
729 | // Ensure there is a reference to the package file (even if we are a child under it). | ||
730 | this.Core.CreateSimpleReference(sourceLineNumbers, "File", fileId); | ||
731 | |||
732 | string cmdlinePrefix = "/q "; | ||
733 | |||
734 | if (!String.IsNullOrEmpty(target)) | ||
735 | { | ||
736 | cmdlinePrefix = String.Format("{0} /skuName:{1} /skuVersion:{2}", cmdlinePrefix, target, targetVersion); | ||
737 | } | ||
738 | |||
739 | string installAfter = "WriteRegistryValues"; // by default, come after the registry key registration. | ||
740 | int installExtraBits = VSCompiler.MsidbCustomActionTypeInScript; | ||
741 | |||
742 | // If the package is not vital, mark the install action as continue. | ||
743 | if (vital == YesNoType.No) | ||
744 | { | ||
745 | installExtraBits |= VSCompiler.MsidbCustomActionTypeContinue; | ||
746 | } | ||
747 | else // the package is vital so ensure there is a rollback action scheduled. | ||
748 | { | ||
749 | Identifier rollbackNamePerUser = this.Core.CreateIdentifier("vru", componentId, fileId, "per-user", target ?? String.Empty, targetVersion ?? String.Empty); | ||
750 | Identifier rollbackNamePerMachine = this.Core.CreateIdentifier("vrm", componentId, fileId, "per-machine", target ?? String.Empty, targetVersion ?? String.Empty); | ||
751 | string rollbackCmdLinePerUser = String.Concat(cmdlinePrefix, " /u:\"", packageId, "\""); | ||
752 | string rollbackCmdLinePerMachine = String.Concat(rollbackCmdLinePerUser, " /admin"); | ||
753 | int rollbackExtraBitsPerUser = VSCompiler.MsidbCustomActionTypeContinue | VSCompiler.MsidbCustomActionTypeRollback | VSCompiler.MsidbCustomActionTypeInScript; | ||
754 | int rollbackExtraBitsPerMachine = rollbackExtraBitsPerUser | VSCompiler.MsidbCustomActionTypeNoImpersonate; | ||
755 | string rollbackConditionPerUser = String.Format("NOT ALLUSERS AND NOT Installed AND ${0}=2 AND ?{0}>2", componentId); // NOT Installed && Component being installed but not installed already. | ||
756 | string rollbackConditionPerMachine = String.Format("ALLUSERS AND NOT Installed AND ${0}=2 AND ?{0}>2", componentId); // NOT Installed && Component being installed but not installed already. | ||
757 | |||
758 | this.SchedulePropertyExeAction(sourceLineNumbers, rollbackNamePerUser, propertyId, rollbackCmdLinePerUser, rollbackExtraBitsPerUser, rollbackConditionPerUser, null, installAfter); | ||
759 | this.SchedulePropertyExeAction(sourceLineNumbers, rollbackNamePerMachine, propertyId, rollbackCmdLinePerMachine, rollbackExtraBitsPerMachine, rollbackConditionPerMachine, null, rollbackNamePerUser.Id); | ||
760 | |||
761 | installAfter = rollbackNamePerMachine.Id; | ||
762 | } | ||
763 | |||
764 | Identifier installNamePerUser = this.Core.CreateIdentifier("viu", componentId, fileId, "per-user", target ?? String.Empty, targetVersion ?? String.Empty); | ||
765 | Identifier installNamePerMachine = this.Core.CreateIdentifier("vim", componentId, fileId, "per-machine", target ?? String.Empty, targetVersion ?? String.Empty); | ||
766 | string installCmdLinePerUser = String.Format("{0} \"[#{1}]\"", cmdlinePrefix, fileId); | ||
767 | string installCmdLinePerMachine = String.Concat(installCmdLinePerUser, " /admin"); | ||
768 | string installConditionPerUser = String.Format("NOT ALLUSERS AND ${0}=3", componentId); // only execute if the Component being installed. | ||
769 | string installConditionPerMachine = String.Format("ALLUSERS AND ${0}=3", componentId); // only execute if the Component being installed. | ||
770 | |||
771 | this.SchedulePropertyExeAction(sourceLineNumbers, installNamePerUser, propertyId, installCmdLinePerUser, installExtraBits, installConditionPerUser, null, installAfter); | ||
772 | this.SchedulePropertyExeAction(sourceLineNumbers, installNamePerMachine, propertyId, installCmdLinePerMachine, installExtraBits | VSCompiler.MsidbCustomActionTypeNoImpersonate, installConditionPerMachine, null, installNamePerUser.Id); | ||
773 | |||
774 | // If not permanent, schedule the uninstall custom action. | ||
775 | if (permanent != YesNoType.Yes) | ||
776 | { | ||
777 | Identifier uninstallNamePerUser = this.Core.CreateIdentifier("vuu", componentId, fileId, "per-user", target ?? String.Empty, targetVersion ?? String.Empty); | ||
778 | Identifier uninstallNamePerMachine = this.Core.CreateIdentifier("vum", componentId, fileId, "per-machine", target ?? String.Empty, targetVersion ?? String.Empty); | ||
779 | string uninstallCmdLinePerUser = String.Concat(cmdlinePrefix, " /u:\"", packageId, "\""); | ||
780 | string uninstallCmdLinePerMachine = String.Concat(uninstallCmdLinePerUser, " /admin"); | ||
781 | int uninstallExtraBitsPerUser = VSCompiler.MsidbCustomActionTypeContinue | VSCompiler.MsidbCustomActionTypeInScript; | ||
782 | int uninstallExtraBitsPerMachine = uninstallExtraBitsPerUser | VSCompiler.MsidbCustomActionTypeNoImpersonate; | ||
783 | string uninstallConditionPerUser = String.Format("NOT ALLUSERS AND ${0}=2 AND ?{0}>2", componentId); // Only execute if component is being uninstalled. | ||
784 | string uninstallConditionPerMachine = String.Format("ALLUSERS AND ${0}=2 AND ?{0}>2", componentId); // Only execute if component is being uninstalled. | ||
785 | |||
786 | this.SchedulePropertyExeAction(sourceLineNumbers, uninstallNamePerUser, propertyId, uninstallCmdLinePerUser, uninstallExtraBitsPerUser, uninstallConditionPerUser, "InstallFinalize", null); | ||
787 | this.SchedulePropertyExeAction(sourceLineNumbers, uninstallNamePerMachine, propertyId, uninstallCmdLinePerMachine, uninstallExtraBitsPerMachine, uninstallConditionPerMachine, "InstallFinalize", null); | ||
788 | } | ||
789 | } | ||
790 | } | ||
791 | |||
792 | private void SchedulePropertyExeAction(SourceLineNumber sourceLineNumbers, Identifier name, string source, string cmdline, int extraBits, string condition, string beforeAction, string afterAction) | ||
793 | { | ||
794 | const string sequence = "InstallExecuteSequence"; | ||
795 | |||
796 | Row actionRow = this.Core.CreateRow(sourceLineNumbers, "CustomAction", name); | ||
797 | actionRow[1] = VSCompiler.MsidbCustomActionTypeProperty | VSCompiler.MsidbCustomActionTypeExe | extraBits; | ||
798 | actionRow[2] = source; | ||
799 | actionRow[3] = cmdline; | ||
800 | |||
801 | Row sequenceRow = this.Core.CreateRow(sourceLineNumbers, "WixAction"); | ||
802 | sequenceRow[0] = sequence; | ||
803 | sequenceRow[1] = name.Id; | ||
804 | sequenceRow[2] = condition; | ||
805 | // no explicit sequence | ||
806 | sequenceRow[4] = beforeAction; | ||
807 | sequenceRow[5] = afterAction; | ||
808 | sequenceRow[6] = 0; // not overridable | ||
809 | |||
810 | if (null != beforeAction) | ||
811 | { | ||
812 | if (WindowsInstallerStandard.IsStandardAction(beforeAction)) | ||
813 | { | ||
814 | this.Core.CreateSimpleReference(sourceLineNumbers, "WixAction", sequence, beforeAction); | ||
815 | } | ||
816 | else | ||
817 | { | ||
818 | this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", beforeAction); | ||
819 | } | ||
820 | } | ||
821 | |||
822 | if (null != afterAction) | ||
823 | { | ||
824 | if (WindowsInstallerStandard.IsStandardAction(afterAction)) | ||
825 | { | ||
826 | this.Core.CreateSimpleReference(sourceLineNumbers, "WixAction", sequence, afterAction); | ||
827 | } | ||
828 | else | ||
829 | { | ||
830 | this.Core.CreateSimpleReference(sourceLineNumbers, "CustomAction", afterAction); | ||
831 | } | ||
832 | } | ||
833 | } | ||
834 | } | ||
835 | } | ||
diff --git a/src/wixext/VSDecompiler.cs b/src/wixext/VSDecompiler.cs new file mode 100644 index 00000000..bfa0670c --- /dev/null +++ b/src/wixext/VSDecompiler.cs | |||
@@ -0,0 +1,296 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | namespace WixToolset.Extensions | ||
4 | { | ||
5 | using System; | ||
6 | using System.Collections; | ||
7 | using System.Diagnostics; | ||
8 | using System.Globalization; | ||
9 | using WixToolset.Data; | ||
10 | using WixToolset.Extensibility; | ||
11 | using VS = WixToolset.Extensions.Serialize.VS; | ||
12 | using Wix = WixToolset.Data.Serialize; | ||
13 | |||
14 | /// <summary> | ||
15 | /// The decompiler for the WiX Toolset Visual Studio Extension. | ||
16 | /// </summary> | ||
17 | public sealed class VSDecompiler : DecompilerExtension | ||
18 | { | ||
19 | /// <summary> | ||
20 | /// Creates a decompiler for VS Extension. | ||
21 | /// </summary> | ||
22 | public VSDecompiler() | ||
23 | { | ||
24 | this.TableDefinitions = VSExtensionData.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 VSExtensionData.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 "HelpFile": | ||
46 | this.DecompileHelpFileTable(table); | ||
47 | break; | ||
48 | case "HelpFileToNamespace": | ||
49 | this.DecompileHelpFileToNamespaceTable(table); | ||
50 | break; | ||
51 | case "HelpFilter": | ||
52 | this.DecompileHelpFilterTable(table); | ||
53 | break; | ||
54 | case "HelpFilterToNamespace": | ||
55 | this.DecompileHelpFilterToNamespaceTable(table); | ||
56 | break; | ||
57 | case "HelpNamespace": | ||
58 | this.DecompileHelpNamespaceTable(table); | ||
59 | break; | ||
60 | case "HelpPlugin": | ||
61 | this.DecompileHelpPluginTable(table); | ||
62 | break; | ||
63 | default: | ||
64 | base.DecompileTable(table); | ||
65 | break; | ||
66 | } | ||
67 | } | ||
68 | |||
69 | /// <summary> | ||
70 | /// Decompile the HelpFile table. | ||
71 | /// </summary> | ||
72 | /// <param name="table">The table to decompile.</param> | ||
73 | private void DecompileHelpFileTable(Table table) | ||
74 | { | ||
75 | foreach (Row row in table.Rows) | ||
76 | { | ||
77 | VS.HelpFile helpFile = new VS.HelpFile(); | ||
78 | |||
79 | helpFile.Id = (string)row[0]; | ||
80 | |||
81 | helpFile.Name = (string)row[1]; | ||
82 | |||
83 | if (null != row[2]) | ||
84 | { | ||
85 | helpFile.Language = (int)row[2]; | ||
86 | } | ||
87 | |||
88 | if (null != row[4]) | ||
89 | { | ||
90 | helpFile.Index = (string)row[4]; | ||
91 | } | ||
92 | |||
93 | if (null != row[5]) | ||
94 | { | ||
95 | helpFile.Search = (string)row[5]; | ||
96 | } | ||
97 | |||
98 | if (null != row[6]) | ||
99 | { | ||
100 | helpFile.AttributeIndex = (string)row[6]; | ||
101 | } | ||
102 | |||
103 | if (null != row[7]) | ||
104 | { | ||
105 | helpFile.SampleLocation = (string)row[7]; | ||
106 | } | ||
107 | |||
108 | if (this.Core.RootElement is Wix.Module) | ||
109 | { | ||
110 | helpFile.SuppressCustomActions = VS.YesNoType.yes; | ||
111 | } | ||
112 | |||
113 | Wix.File file = (Wix.File)this.Core.GetIndexedElement("File", (string)row[3]); | ||
114 | if (null != file) | ||
115 | { | ||
116 | file.AddChild(helpFile); | ||
117 | } | ||
118 | else | ||
119 | { | ||
120 | this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "File_HxS", (string)row[3], "File")); | ||
121 | } | ||
122 | } | ||
123 | } | ||
124 | |||
125 | /// <summary> | ||
126 | /// Decompile the HelpFileToNamespace table. | ||
127 | /// </summary> | ||
128 | /// <param name="table">The table to decompile.</param> | ||
129 | private void DecompileHelpFileToNamespaceTable(Table table) | ||
130 | { | ||
131 | foreach (Row row in table.Rows) | ||
132 | { | ||
133 | VS.HelpFileRef helpFileRef = new VS.HelpFileRef(); | ||
134 | |||
135 | helpFileRef.Id = (string)row[0]; | ||
136 | |||
137 | VS.HelpCollection helpCollection = (VS.HelpCollection)this.Core.GetIndexedElement("HelpNamespace", (string)row[1]); | ||
138 | if (null != helpCollection) | ||
139 | { | ||
140 | helpCollection.AddChild(helpFileRef); | ||
141 | } | ||
142 | else | ||
143 | { | ||
144 | this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "HelpNamespace_", (string)row[1], "HelpNamespace")); | ||
145 | } | ||
146 | } | ||
147 | } | ||
148 | |||
149 | /// <summary> | ||
150 | /// Decompile the HelpFilter table. | ||
151 | /// </summary> | ||
152 | /// <param name="table">The table to decompile.</param> | ||
153 | private void DecompileHelpFilterTable(Table table) | ||
154 | { | ||
155 | foreach (Row row in table.Rows) | ||
156 | { | ||
157 | VS.HelpFilter helpFilter = new VS.HelpFilter(); | ||
158 | |||
159 | helpFilter.Id = (string)row[0]; | ||
160 | |||
161 | helpFilter.Name = (string)row[1]; | ||
162 | |||
163 | if (null != row[2]) | ||
164 | { | ||
165 | helpFilter.FilterDefinition = (string)row[2]; | ||
166 | } | ||
167 | |||
168 | if (this.Core.RootElement is Wix.Module) | ||
169 | { | ||
170 | helpFilter.SuppressCustomActions = VS.YesNoType.yes; | ||
171 | } | ||
172 | |||
173 | this.Core.RootElement.AddChild(helpFilter); | ||
174 | } | ||
175 | } | ||
176 | |||
177 | /// <summary> | ||
178 | /// Decompile the HelpFilterToNamespace table. | ||
179 | /// </summary> | ||
180 | /// <param name="table">The table to decompile.</param> | ||
181 | private void DecompileHelpFilterToNamespaceTable(Table table) | ||
182 | { | ||
183 | foreach (Row row in table.Rows) | ||
184 | { | ||
185 | VS.HelpFilterRef helpFilterRef = new VS.HelpFilterRef(); | ||
186 | |||
187 | helpFilterRef.Id = (string)row[0]; | ||
188 | |||
189 | VS.HelpCollection helpCollection = (VS.HelpCollection)this.Core.GetIndexedElement("HelpNamespace", (string)row[1]); | ||
190 | if (null != helpCollection) | ||
191 | { | ||
192 | helpCollection.AddChild(helpFilterRef); | ||
193 | } | ||
194 | else | ||
195 | { | ||
196 | this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "HelpNamespace_", (string)row[1], "HelpNamespace")); | ||
197 | } | ||
198 | } | ||
199 | } | ||
200 | |||
201 | /// <summary> | ||
202 | /// Decompile the HelpNamespace table. | ||
203 | /// </summary> | ||
204 | /// <param name="table">The table to decompile.</param> | ||
205 | private void DecompileHelpNamespaceTable(Table table) | ||
206 | { | ||
207 | foreach (Row row in table.Rows) | ||
208 | { | ||
209 | VS.HelpCollection helpCollection = new VS.HelpCollection(); | ||
210 | |||
211 | helpCollection.Id = (string)row[0]; | ||
212 | |||
213 | helpCollection.Name = (string)row[1]; | ||
214 | |||
215 | if (null != row[3]) | ||
216 | { | ||
217 | helpCollection.Description = (string)row[3]; | ||
218 | } | ||
219 | |||
220 | if (this.Core.RootElement is Wix.Module) | ||
221 | { | ||
222 | helpCollection.SuppressCustomActions = VS.YesNoType.yes; | ||
223 | } | ||
224 | |||
225 | Wix.File file = (Wix.File)this.Core.GetIndexedElement("File", (string)row[2]); | ||
226 | if (null != file) | ||
227 | { | ||
228 | file.AddChild(helpCollection); | ||
229 | } | ||
230 | else if (0 != String.Compare(helpCollection.Id, "MS_VSIPCC_v80", StringComparison.Ordinal) && | ||
231 | 0 != String.Compare(helpCollection.Id, "MS.VSIPCC.v90", StringComparison.Ordinal)) | ||
232 | { | ||
233 | this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "File_Collection", (string)row[2], "File")); | ||
234 | } | ||
235 | this.Core.IndexElement(row, helpCollection); | ||
236 | } | ||
237 | } | ||
238 | |||
239 | /// <summary> | ||
240 | /// Decompile the HelpPlugin table. | ||
241 | /// </summary> | ||
242 | /// <param name="table">The table to decompile.</param> | ||
243 | private void DecompileHelpPluginTable(Table table) | ||
244 | { | ||
245 | foreach (Row row in table.Rows) | ||
246 | { | ||
247 | VS.PlugCollectionInto plugCollectionInto = new VS.PlugCollectionInto(); | ||
248 | |||
249 | plugCollectionInto.TargetCollection = (string)row[1]; | ||
250 | |||
251 | if (null != row[2]) | ||
252 | { | ||
253 | plugCollectionInto.TableOfContents = (string)row[2]; | ||
254 | } | ||
255 | |||
256 | if (null != row[3]) | ||
257 | { | ||
258 | plugCollectionInto.Attributes = (string)row[3]; | ||
259 | } | ||
260 | |||
261 | if (null != row[4]) | ||
262 | { | ||
263 | plugCollectionInto.TargetTableOfContents = (string)row[4]; | ||
264 | } | ||
265 | |||
266 | if (this.Core.RootElement is Wix.Module) | ||
267 | { | ||
268 | plugCollectionInto.SuppressExternalNamespaces = VS.YesNoType.yes; | ||
269 | } | ||
270 | |||
271 | //we cannot do this work because we cannot get the FeatureComponent table | ||
272 | //plugCollectionInto.TargetFeature = DecompileHelpComponents(); | ||
273 | |||
274 | VS.HelpCollection helpCollection = (VS.HelpCollection)this.Core.GetIndexedElement("HelpNamespace", (string)row[0]); | ||
275 | if (null != helpCollection) | ||
276 | { | ||
277 | helpCollection.AddChild(plugCollectionInto); | ||
278 | } | ||
279 | else | ||
280 | { | ||
281 | this.Core.OnMessage(WixWarnings.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "HelpNamespace_", (string)row[0], "HelpNamespace")); | ||
282 | } | ||
283 | } | ||
284 | } | ||
285 | //private string DecompileHelpComponents() | ||
286 | //{ | ||
287 | // throw new NotImplementedException(); | ||
288 | // //Find both known compontents from FeatureComponents table and build feature list | ||
289 | |||
290 | // //remove components from FeatureComponents | ||
291 | |||
292 | // //return a space delimited list of features that mapped to our help components | ||
293 | // return String.Empty; | ||
294 | //} | ||
295 | } | ||
296 | } | ||
diff --git a/src/wixext/VSExtensionData.cs b/src/wixext/VSExtensionData.cs new file mode 100644 index 00000000..edb1fd42 --- /dev/null +++ b/src/wixext/VSExtensionData.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 | |||
3 | namespace WixToolset.Extensions | ||
4 | { | ||
5 | using System; | ||
6 | using System.Reflection; | ||
7 | using WixToolset.Data; | ||
8 | using WixToolset.Extensibility; | ||
9 | |||
10 | /// <summary> | ||
11 | /// The WiX Toolset Visual Studio Extension. | ||
12 | /// </summary> | ||
13 | public sealed class VSExtensionData : ExtensionData | ||
14 | { | ||
15 | /// <summary> | ||
16 | /// Gets the optional table definitions for this extension. | ||
17 | /// </summary> | ||
18 | /// <value>The optional table definitions for this extension.</value> | ||
19 | public override TableDefinitionCollection TableDefinitions | ||
20 | { | ||
21 | get | ||
22 | { | ||
23 | return VSExtensionData.GetExtensionTableDefinitions(); | ||
24 | } | ||
25 | } | ||
26 | |||
27 | /// <summary> | ||
28 | /// Gets the library associated with this extension. | ||
29 | /// </summary> | ||
30 | /// <param name="tableDefinitions">The table definitions to use while loading the library.</param> | ||
31 | /// <returns>The loaded library.</returns> | ||
32 | public override Library GetLibrary(TableDefinitionCollection tableDefinitions) | ||
33 | { | ||
34 | return VSExtensionData.GetExtensionLibrary(tableDefinitions); | ||
35 | } | ||
36 | |||
37 | /// <summary> | ||
38 | /// Internal mechanism to access the extension's table definitions. | ||
39 | /// </summary> | ||
40 | /// <returns>Extension's table definitions.</returns> | ||
41 | internal static TableDefinitionCollection GetExtensionTableDefinitions() | ||
42 | { | ||
43 | return ExtensionData.LoadTableDefinitionHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.tables.xml"); | ||
44 | } | ||
45 | |||
46 | /// <summary> | ||
47 | /// Internal mechanism to access the extension's library. | ||
48 | /// </summary> | ||
49 | /// <returns>Extension's library.</returns> | ||
50 | internal static Library GetExtensionLibrary(TableDefinitionCollection tableDefinitions) | ||
51 | { | ||
52 | return ExtensionData.LoadLibraryHelper(Assembly.GetExecutingAssembly(), "WixToolset.Extensions.Data.vs.wixlib", tableDefinitions); | ||
53 | } | ||
54 | } | ||
55 | } | ||
diff --git a/src/wixext/WixToolset.VisualStudio.wixext.csproj b/src/wixext/WixToolset.VisualStudio.wixext.csproj new file mode 100644 index 00000000..0b092662 --- /dev/null +++ b/src/wixext/WixToolset.VisualStudio.wixext.csproj | |||
@@ -0,0 +1,69 @@ | |||
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.Extensions</RootNamespace> | ||
8 | <Description>WiX Toolset Visual Studio Extension</Description> | ||
9 | <Title>WiX Toolset VS Extension</Title> | ||
10 | <IsTool>true</IsTool> | ||
11 | <ContentTargetFolders>build</ContentTargetFolders> | ||
12 | </PropertyGroup> | ||
13 | |||
14 | <PropertyGroup> | ||
15 | <NoWarn>NU1701</NoWarn> | ||
16 | </PropertyGroup> | ||
17 | |||
18 | <ItemGroup> | ||
19 | <EmbeddedResource Include="Data\tables.xml"> | ||
20 | <LogicalName>$(RootNamespace).Data.tables.xml</LogicalName> | ||
21 | </EmbeddedResource> | ||
22 | |||
23 | <MsgGenSource Include="Data\messages.xml"> | ||
24 | <ResourcesLogicalName>$(RootNamespace).Data.Messages.resources</ResourcesLogicalName> | ||
25 | </MsgGenSource> | ||
26 | |||
27 | <EmbeddedResource Include="Xsd\vs.xsd"> | ||
28 | <LogicalName>$(RootNamespace).Xsd.vs.xsd</LogicalName> | ||
29 | <Pack>true</Pack> | ||
30 | <PackagePath>tools</PackagePath> | ||
31 | </EmbeddedResource> | ||
32 | |||
33 | <XsdGenSource Include="Xsd\vs.xsd"> | ||
34 | <CommonNamespace>WixToolset.Data.Serialize</CommonNamespace> | ||
35 | <Namespace>WixToolset.Extensions.Serialize.VS</Namespace> | ||
36 | </XsdGenSource> | ||
37 | |||
38 | <EmbeddedResource Include="$(OutputPath)..\vs.wixlib"> | ||
39 | <Link>Data\vs.wixlib</Link> | ||
40 | </EmbeddedResource> | ||
41 | </ItemGroup> | ||
42 | |||
43 | <ItemGroup> | ||
44 | <Content Include="$(MSBuildThisFileName).targets" /> | ||
45 | </ItemGroup> | ||
46 | |||
47 | <ItemGroup> | ||
48 | <ProjectReference Include="$(WixToolsetRootFolder)\Data\src\WixToolset.Data\WixToolset.Data.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Data\src\WixToolset.Data\WixToolset.Data.csproj') " /> | ||
49 | <PackageReference Include="WixToolset.Data" Version="4.0.*" Condition=" '$(Configuration)' == 'Release' Or !Exists('$(WixToolsetRootFolder)\Data\src\WixToolset.Data\WixToolset.Data.csproj') " PrivateAssets="all" /> | ||
50 | |||
51 | <ProjectReference Include="$(WixToolsetRootFolder)\Extensibility\src\WixToolset.Extensibility\WixToolset.Extensibility.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Extensibility\src\WixToolset.Extensibility\WixToolset.Extensibility.csproj') " /> | ||
52 | <PackageReference Include="WixToolset.Extensibility" Version="4.0.*" Condition=" '$(Configuration)' == 'Release' Or !Exists('$(WixToolsetRootFolder)\Extensibility\src\WixToolset.Extensibility\WixToolset.Extensibility.csproj') " PrivateAssets="all" /> | ||
53 | |||
54 | <ProjectReference Include="$(WixToolsetRootFolder)\Core\src\WixToolset.Core\WixToolset.Core.csproj" Condition=" '$(Configuration)' == 'Debug' And Exists('$(WixToolsetRootFolder)\Core\src\WixToolset.Core\WixToolset.Core.csproj') " /> | ||
55 | <PackageReference Include="WixToolset.Core" Version="4.0.*" Condition=" '$(Configuration)' == 'Release' Or !Exists('$(WixToolsetRootFolder)\Core\src\WixToolset.Core\WixToolset.Core.csproj') " PrivateAssets="all" /> | ||
56 | </ItemGroup> | ||
57 | |||
58 | <ItemGroup> | ||
59 | <ProjectReference Include="..\wixlib\vs.wixproj"> | ||
60 | <ReferenceOutputAssembly>false</ReferenceOutputAssembly> | ||
61 | </ProjectReference> | ||
62 | </ItemGroup> | ||
63 | |||
64 | <ItemGroup> | ||
65 | <PackageReference Include="Nerdbank.GitVersioning" Version="2.0.41" PrivateAssets="all" /> | ||
66 | <PackageReference Include="WixBuildTools.MsgGen" Version="4.0.*" PrivateAssets="all" /> | ||
67 | <PackageReference Include="WixBuildTools.XsdGen" Version="4.0.*" PrivateAssets="all" /> | ||
68 | </ItemGroup> | ||
69 | </Project> | ||
diff --git a/src/wixext/WixToolset.VisualStudio.wixext.targets b/src/wixext/WixToolset.VisualStudio.wixext.targets new file mode 100644 index 00000000..903455e3 --- /dev/null +++ b/src/wixext/WixToolset.VisualStudio.wixext.targets | |||
@@ -0,0 +1,10 @@ | |||
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 | <ItemGroup> | ||
6 | <WixExtension Include="WixToolset.VS.wixext"> | ||
7 | <HintPath>$(MSBuildThisFileDirectory)..\tools\WixToolset.VS.wixext.dll</HintPath> | ||
8 | </WixExtension> | ||
9 | </ItemGroup> | ||
10 | </Project> | ||
diff --git a/src/wixext/xsd/vs.xsd b/src/wixext/xsd/vs.xsd new file mode 100644 index 00000000..51172920 --- /dev/null +++ b/src/wixext/xsd/vs.xsd | |||
@@ -0,0 +1,292 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
3 | |||
4 | |||
5 | <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
6 | xmlns:xse=" http://wixtoolset.org/schemas/XmlSchemaExtension" | ||
7 | targetNamespace="http://wixtoolset.org/schemas/v4/wxs/vs" | ||
8 | xmlns="http://wixtoolset.org/schemas/v4/wxs/vs"> | ||
9 | <xs:annotation> | ||
10 | <xs:documentation> | ||
11 | The source code schema for the WiX Toolset Visual Studio Extension. | ||
12 | </xs:documentation> | ||
13 | </xs:annotation> | ||
14 | |||
15 | <xs:element name="HelpCollection"> | ||
16 | <xs:annotation> | ||
17 | <xs:documentation> | ||
18 | Help Namespace for a help collection. The parent file is the key for the HxC (Collection) file. | ||
19 | </xs:documentation> | ||
20 | <xs:appinfo> | ||
21 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="File" /> | ||
22 | </xs:appinfo> | ||
23 | </xs:annotation> | ||
24 | <xs:complexType> | ||
25 | <xs:choice minOccurs="0" maxOccurs="unbounded"> | ||
26 | <xs:element ref="HelpFileRef" /> | ||
27 | <xs:element ref="HelpFilterRef" /> | ||
28 | <xs:element ref="PlugCollectionInto" /> | ||
29 | </xs:choice> | ||
30 | <xs:attribute name="Id" type="xs:string" use="required"> | ||
31 | <xs:annotation><xs:documentation>Primary Key for HelpNamespace.</xs:documentation></xs:annotation> | ||
32 | </xs:attribute> | ||
33 | <xs:attribute name="Description" type="xs:string"> | ||
34 | <xs:annotation><xs:documentation>Friendly name for Namespace.</xs:documentation></xs:annotation> | ||
35 | </xs:attribute> | ||
36 | <xs:attribute name="Name" use="required" type="xs:string"> | ||
37 | <xs:annotation><xs:documentation>Internal Microsoft Help ID for this Namespace.</xs:documentation></xs:annotation> | ||
38 | </xs:attribute> | ||
39 | <xs:attribute name="SuppressCustomActions" type="YesNoType"> | ||
40 | <xs:annotation><xs:documentation>Suppress linking Help registration custom actions. Help redistributable merge modules will be required. Use this when building a merge module.</xs:documentation></xs:annotation> | ||
41 | </xs:attribute> | ||
42 | </xs:complexType> | ||
43 | </xs:element> | ||
44 | |||
45 | <xs:element name="HelpFilter"> | ||
46 | <xs:annotation> | ||
47 | <xs:documentation> | ||
48 | Filter for Help Namespace. | ||
49 | </xs:documentation> | ||
50 | <xs:appinfo> | ||
51 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" /> | ||
52 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Module" /> | ||
53 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Product" /> | ||
54 | </xs:appinfo> | ||
55 | </xs:annotation> | ||
56 | <xs:complexType> | ||
57 | <xs:attribute name="Id" use="required" type="xs:string"> | ||
58 | <xs:annotation><xs:documentation>Primary Key for HelpFilter.</xs:documentation></xs:annotation> | ||
59 | </xs:attribute> | ||
60 | <xs:attribute name="FilterDefinition" type="xs:string"> | ||
61 | <xs:annotation><xs:documentation>Query String for Help Filter.</xs:documentation></xs:annotation> | ||
62 | </xs:attribute> | ||
63 | <xs:attribute name="Name" use="required" type="xs:string"> | ||
64 | <xs:annotation><xs:documentation>Friendly name for Filter.</xs:documentation></xs:annotation> | ||
65 | </xs:attribute> | ||
66 | <xs:attribute name="SuppressCustomActions" type="YesNoType"> | ||
67 | <xs:annotation><xs:documentation>Suppress linking Help registration custom actions. Help redistributable merge modules will be required. Use this when building a merge module.</xs:documentation></xs:annotation> | ||
68 | </xs:attribute> | ||
69 | </xs:complexType> | ||
70 | </xs:element> | ||
71 | |||
72 | <xs:element name="HelpFile"> | ||
73 | <xs:annotation> | ||
74 | <xs:documentation> | ||
75 | File for Help Namespace. The parent file is the key for HxS (Title) file. | ||
76 | </xs:documentation> | ||
77 | <xs:appinfo> | ||
78 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="File" /> | ||
79 | </xs:appinfo> | ||
80 | </xs:annotation> | ||
81 | <xs:complexType> | ||
82 | <xs:attribute name="Id" use="required" type="xs:string"> | ||
83 | <xs:annotation><xs:documentation>Primary Key for HelpFile Table.</xs:documentation></xs:annotation> | ||
84 | </xs:attribute> | ||
85 | <xs:attribute name="AttributeIndex" type="xs:string"> | ||
86 | <xs:annotation><xs:documentation>Key for HxR (Attributes) file.</xs:documentation></xs:annotation> | ||
87 | </xs:attribute> | ||
88 | <xs:attribute name="Index" type="xs:string"> | ||
89 | <xs:annotation><xs:documentation>Key for HxI (Index) file.</xs:documentation></xs:annotation> | ||
90 | </xs:attribute> | ||
91 | <xs:attribute name="Language" use="required" type="xs:integer"> | ||
92 | <xs:annotation><xs:documentation>Language ID for content file.</xs:documentation></xs:annotation> | ||
93 | </xs:attribute> | ||
94 | <xs:attribute name="Name" use="required" type="xs:string"> | ||
95 | <xs:annotation><xs:documentation>Internal Microsoft Help ID for this HelpFile.</xs:documentation></xs:annotation> | ||
96 | </xs:attribute> | ||
97 | <xs:attribute name="SampleLocation" type="xs:string"> | ||
98 | <xs:annotation><xs:documentation>Key for a file that is in the "root" of the samples directory for this HelpFile.</xs:documentation></xs:annotation> | ||
99 | </xs:attribute> | ||
100 | <xs:attribute name="Search" type="xs:string"> | ||
101 | <xs:annotation><xs:documentation>Key for HxQ (Query) file.</xs:documentation></xs:annotation> | ||
102 | </xs:attribute> | ||
103 | <xs:attribute name="SuppressCustomActions" type="YesNoType"> | ||
104 | <xs:annotation><xs:documentation>Suppress linking Help registration custom actions. Help redistributable merge modules will be required. Use this when building a merge module.</xs:documentation></xs:annotation> | ||
105 | </xs:attribute> | ||
106 | </xs:complexType> | ||
107 | </xs:element> | ||
108 | |||
109 | <xs:element name="PlugCollectionInto"> | ||
110 | <xs:annotation><xs:documentation>Plugin for Help Namespace.</xs:documentation></xs:annotation> | ||
111 | <xs:complexType> | ||
112 | <xs:attribute name="Attributes" type="xs:string"> | ||
113 | <xs:annotation><xs:documentation>Key for HxA (Attributes) file of child namespace.</xs:documentation></xs:annotation> | ||
114 | </xs:attribute> | ||
115 | <xs:attribute name="TableOfContents" type="xs:string"> | ||
116 | <xs:annotation><xs:documentation>Key for HxT file of child namespace.</xs:documentation></xs:annotation> | ||
117 | </xs:attribute> | ||
118 | <xs:attribute name="TargetCollection" use="required" type="xs:string"> | ||
119 | <xs:annotation><xs:documentation> | ||
120 | Foriegn Key into HelpNamespace table for the parent namespace into which the child will be inserted. | ||
121 | The following special keys can be used to plug into external namespaces defined outside of the installer. | ||
122 | MS_VSIPCC_v80 : Visual Studio 2005 | ||
123 | MS.VSIPCC.v90 : Visual Studio 2008 | ||
124 | </xs:documentation></xs:annotation> | ||
125 | </xs:attribute> | ||
126 | <xs:attribute name="TargetTableOfContents" type="xs:string"> | ||
127 | <xs:annotation><xs:documentation>Key for HxT file of parent namespace that now includes the new child namespace.</xs:documentation></xs:annotation> | ||
128 | </xs:attribute> | ||
129 | <xs:attribute name="TargetFeature" type="xs:string"> | ||
130 | <xs:annotation><xs:documentation>Key for the feature parent of this help collection. Required only when plugging into external namespaces.</xs:documentation></xs:annotation> | ||
131 | </xs:attribute> | ||
132 | <xs:attribute name="SuppressExternalNamespaces" type="YesNoType"> | ||
133 | <xs:annotation><xs:documentation>Suppress linking Visual Studio Help namespaces. Help redistributable merge modules will be required. Use this when building a merge module.</xs:documentation></xs:annotation> | ||
134 | </xs:attribute> | ||
135 | </xs:complexType> | ||
136 | </xs:element> | ||
137 | |||
138 | <xs:element name="HelpFileRef"> | ||
139 | <xs:annotation><xs:documentation>Create a reference to a HelpFile element in another Fragment.</xs:documentation></xs:annotation> | ||
140 | <xs:complexType> | ||
141 | <xs:attribute name="Id" use="required" type="xs:string"> | ||
142 | <xs:annotation><xs:documentation>Primary Key for HelpFile Table.</xs:documentation></xs:annotation> | ||
143 | </xs:attribute> | ||
144 | <xs:anyAttribute namespace="##other" processContents="lax"> | ||
145 | <xs:annotation><xs:documentation> | ||
146 | Extensibility point in the WiX XML Schema. Schema extensions can register additional | ||
147 | attributes at this point in the schema. | ||
148 | </xs:documentation></xs:annotation> | ||
149 | </xs:anyAttribute> | ||
150 | </xs:complexType> | ||
151 | </xs:element> | ||
152 | |||
153 | <xs:element name="HelpFilterRef"> | ||
154 | <xs:annotation><xs:documentation>Create a reference to a HelpFile element in another Fragment.</xs:documentation></xs:annotation> | ||
155 | <xs:complexType> | ||
156 | <xs:attribute name="Id" use="required" type="xs:string"> | ||
157 | <xs:annotation><xs:documentation>Primary Key for HelpFilter.</xs:documentation></xs:annotation> | ||
158 | </xs:attribute> | ||
159 | <xs:anyAttribute namespace="##other" processContents="lax"> | ||
160 | <xs:annotation><xs:documentation> | ||
161 | Extensibility point in the WiX XML Schema. Schema extensions can register additional | ||
162 | attributes at this point in the schema. | ||
163 | </xs:documentation></xs:annotation> | ||
164 | </xs:anyAttribute> | ||
165 | </xs:complexType> | ||
166 | </xs:element> | ||
167 | |||
168 | <xs:element name="HelpCollectionRef"> | ||
169 | <xs:annotation> | ||
170 | <xs:documentation>Create a reference to a HelpCollection element in another Fragment.</xs:documentation> | ||
171 | <xs:appinfo> | ||
172 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" /> | ||
173 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Module" /> | ||
174 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Product" /> | ||
175 | </xs:appinfo> | ||
176 | </xs:annotation> | ||
177 | <xs:complexType> | ||
178 | <xs:choice minOccurs="0" maxOccurs="unbounded"> | ||
179 | <xs:element ref="HelpFileRef" /> | ||
180 | </xs:choice> | ||
181 | <xs:attribute name="Id" use="required" type="xs:string"> | ||
182 | <xs:annotation><xs:documentation>Primary Key for HelpNamespace Table.</xs:documentation></xs:annotation> | ||
183 | </xs:attribute> | ||
184 | <xs:anyAttribute namespace="##other" processContents="lax"> | ||
185 | <xs:annotation><xs:documentation> | ||
186 | Extensibility point in the WiX XML Schema. Schema extensions can register additional | ||
187 | attributes at this point in the schema. | ||
188 | </xs:documentation></xs:annotation> | ||
189 | </xs:anyAttribute> | ||
190 | </xs:complexType> | ||
191 | </xs:element> | ||
192 | |||
193 | <xs:element name="VsixPackage"> | ||
194 | <xs:annotation> | ||
195 | <xs:documentation> | ||
196 | This element provides the metdata required to install/uninstall a file as | ||
197 | a VSIX Package. The VSIX package file will be installed as part of the MSI | ||
198 | then passed to the VSIX installer to install the VSIX package. To avoid the | ||
199 | duplication, simply use the MSI to install the VSIX package itself. | ||
200 | </xs:documentation> | ||
201 | <xs:appinfo> | ||
202 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" /> | ||
203 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="File" /> | ||
204 | </xs:appinfo> | ||
205 | </xs:annotation> | ||
206 | <xs:complexType> | ||
207 | <xs:attribute name="File" type="xs:string"> | ||
208 | <xs:annotation> | ||
209 | <xs:documentation> | ||
210 | Reference to file identifer. This attribute is required when the element is not a | ||
211 | child of a File element and is invalid when the element is a child of the File element. | ||
212 | </xs:documentation> | ||
213 | </xs:annotation> | ||
214 | </xs:attribute> | ||
215 | <xs:attribute name="PackageId" type="xs:string" use="required"> | ||
216 | <xs:annotation> | ||
217 | <xs:documentation> | ||
218 | Identity of the VSIX package per its internal manifest. If this value is not correct | ||
219 | the VSIX package will not correctly uninstall. | ||
220 | </xs:documentation> | ||
221 | </xs:annotation> | ||
222 | </xs:attribute> | ||
223 | <xs:attribute name="Permanent" type="YesNoType"> | ||
224 | <xs:annotation> | ||
225 | <xs:documentation> | ||
226 | Indicates whether the VSIX package is uninstalled when the parent Component is uninstalled. | ||
227 | The default is 'no'. | ||
228 | </xs:documentation> | ||
229 | </xs:annotation> | ||
230 | </xs:attribute> | ||
231 | <xs:attribute name="Target" type="xs:string"> | ||
232 | <xs:annotation> | ||
233 | <xs:documentation> | ||
234 | Specifies the SKU of Visual Studio in which to register the extension. If no target | ||
235 | is specified the extension is registered with all installed SKUs. If the Target | ||
236 | attribute is specified the TargetVersion attribute must also be specified. The | ||
237 | following is a list of known Visual Studio targets: integratedShell, professional, | ||
238 | premium, ultimate, vbExpress, vcExpress, vcsExpress, vwdExpress | ||
239 | </xs:documentation> | ||
240 | </xs:annotation> | ||
241 | </xs:attribute> | ||
242 | <xs:attribute name="TargetVersion" type="VersionType"> | ||
243 | <xs:annotation> | ||
244 | <xs:documentation> | ||
245 | Specifies the version of Visual Studio in which to register the extension. This attribute | ||
246 | is required if the Target attribute is specified. | ||
247 | </xs:documentation> | ||
248 | </xs:annotation> | ||
249 | </xs:attribute> | ||
250 | <xs:attribute name="Vital" type="YesNoType"> | ||
251 | <xs:annotation> | ||
252 | <xs:documentation> | ||
253 | Indicates whether failure to install the VSIX package causes the installation to rollback. | ||
254 | The default is 'yes'. | ||
255 | </xs:documentation> | ||
256 | </xs:annotation> | ||
257 | </xs:attribute> | ||
258 | <xs:attribute name="VsixInstallerPathProperty" type="xs:string"> | ||
259 | <xs:annotation> | ||
260 | <xs:documentation> | ||
261 | Optional reference to a Property element that contains the path to the VsixInstaller.exe. | ||
262 | By default, the latest VsixInstaller.exe on the machine will be used to install the VSIX | ||
263 | package. It is highly recommended that this attribute is *not* used. | ||
264 | </xs:documentation> | ||
265 | </xs:annotation> | ||
266 | </xs:attribute> | ||
267 | <xs:anyAttribute namespace="##other" processContents="lax"> | ||
268 | <xs:annotation><xs:documentation> | ||
269 | Extensibility point in the WiX XML Schema. Schema extensions can register additional | ||
270 | attributes at this point in the schema. | ||
271 | </xs:documentation></xs:annotation> | ||
272 | </xs:anyAttribute> | ||
273 | </xs:complexType> | ||
274 | </xs:element> | ||
275 | |||
276 | <xs:simpleType name="VersionType"> | ||
277 | <xs:annotation><xs:documentation>Values of this type will look like: "x.x.x.x" where x is an integer from 0 to 65534.</xs:documentation></xs:annotation> | ||
278 | <xs:restriction base="xs:string"> | ||
279 | <xs:pattern value="(\d{1,5}\.){0,3}\d{1,5}"/> | ||
280 | </xs:restriction> | ||
281 | </xs:simpleType> | ||
282 | |||
283 | <xs:simpleType name="YesNoType"> | ||
284 | <xs:annotation> | ||
285 | <xs:documentation>Values of this type will either be "yes" or "no".</xs:documentation> | ||
286 | </xs:annotation> | ||
287 | <xs:restriction base='xs:NMTOKEN'> | ||
288 | <xs:enumeration value="no"/> | ||
289 | <xs:enumeration value="yes"/> | ||
290 | </xs:restriction> | ||
291 | </xs:simpleType> | ||
292 | </xs:schema> | ||