aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2020-09-06 21:23:24 -0400
committerBob Arnson <bob@firegiant.com>2020-09-06 21:25:22 -0400
commit0016b37f80e0d1d1fa5c2ab803042456eafbb9e8 (patch)
treece33d61edd0411ee594ed98dc57dd2e00637a8c4
parentebf83fdc9814dfdfc74f4e215f749a4366421677 (diff)
downloadwix-0016b37f80e0d1d1fa5c2ab803042456eafbb9e8.tar.gz
wix-0016b37f80e0d1d1fa5c2ab803042456eafbb9e8.tar.bz2
wix-0016b37f80e0d1d1fa5c2ab803042456eafbb9e8.zip
Replace BinaryKey with BinaryRef and FileKey with FileRef.
-rw-r--r--src/wixext/SqlCompiler.cs16
-rw-r--r--src/wixext/WixToolset.Sql.wixext.csproj1
-rw-r--r--src/wixext/sql.xsd342
3 files changed, 8 insertions, 351 deletions
diff --git a/src/wixext/SqlCompiler.cs b/src/wixext/SqlCompiler.cs
index bbcdc87d..534fcc27 100644
--- a/src/wixext/SqlCompiler.cs
+++ b/src/wixext/SqlCompiler.cs
@@ -447,7 +447,7 @@ namespace WixToolset.Sql
447 int attributes = 0; 447 int attributes = 0;
448 var rollbackAttribute = false; 448 var rollbackAttribute = false;
449 var nonRollbackAttribute = false; 449 var nonRollbackAttribute = false;
450 string binary = null; 450 string binaryRef = null;
451 var sequence = CompilerConstants.IntegerNotSet; 451 var sequence = CompilerConstants.IntegerNotSet;
452 string user = null; 452 string user = null;
453 453
@@ -460,9 +460,9 @@ namespace WixToolset.Sql
460 case "Id": 460 case "Id":
461 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib); 461 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
462 break; 462 break;
463 case "BinaryKey": 463 case "BinaryRef":
464 binary = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib); 464 binaryRef = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
465 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.Binary, binary); 465 this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.Binary, binaryRef);
466 break; 466 break;
467 case "Sequence": 467 case "Sequence":
468 sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, short.MaxValue); 468 sequence = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, short.MaxValue);
@@ -575,12 +575,12 @@ namespace WixToolset.Sql
575 575
576 if (null == id) 576 if (null == id)
577 { 577 {
578 id = this.ParseHelper.CreateIdentifier("ssc", componentId, binary, sqlDb); 578 id = this.ParseHelper.CreateIdentifier("ssc", componentId, binaryRef, sqlDb);
579 } 579 }
580 580
581 if (null == binary) 581 if (null == binaryRef)
582 { 582 {
583 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "BinaryKey")); 583 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "BinaryRef"));
584 } 584 }
585 585
586 if (null == sqlDb) 586 if (null == sqlDb)
@@ -604,7 +604,7 @@ namespace WixToolset.Sql
604 { 604 {
605 SqlDbRef = sqlDb, 605 SqlDbRef = sqlDb,
606 ComponentRef = componentId, 606 ComponentRef = componentId,
607 ScriptBinaryRef = binary, 607 ScriptBinaryRef = binaryRef,
608 UserRef = user, 608 UserRef = user,
609 Attributes = attributes, 609 Attributes = attributes,
610 }); 610 });
diff --git a/src/wixext/WixToolset.Sql.wixext.csproj b/src/wixext/WixToolset.Sql.wixext.csproj
index 73c7a4e5..01ab5504 100644
--- a/src/wixext/WixToolset.Sql.wixext.csproj
+++ b/src/wixext/WixToolset.Sql.wixext.csproj
@@ -13,7 +13,6 @@
13 13
14 <ItemGroup> 14 <ItemGroup>
15 <Content Include="$(MSBuildThisFileName).targets" /> 15 <Content Include="$(MSBuildThisFileName).targets" />
16 <Content Include="sql.xsd" PackagePath="tools" />
17 <EmbeddedResource Include="$(OutputPath)..\sql.wixlib" /> 16 <EmbeddedResource Include="$(OutputPath)..\sql.wixlib" />
18 </ItemGroup> 17 </ItemGroup>
19 18
diff --git a/src/wixext/sql.xsd b/src/wixext/sql.xsd
deleted file mode 100644
index 161607c9..00000000
--- a/src/wixext/sql.xsd
+++ /dev/null
@@ -1,342 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
3
4
5<xs:schema xmlns:html="http://www.w3.org/1999/xhtml"
6 xmlns:wix="http://wixtoolset.org/schemas/v4/wxs"
7 xmlns:xs="http://www.w3.org/2001/XMLSchema"
8 xmlns:xse=" http://wixtoolset.org/schemas/XmlSchemaExtension"
9 targetNamespace="http://wixtoolset.org/schemas/v4/wxs/sql"
10 xmlns="http://wixtoolset.org/schemas/v4/wxs/sql">
11 <xs:annotation>
12 <xs:documentation>
13 The source code schema for the WiX Toolset SQL Server Extension.
14 </xs:documentation>
15 </xs:annotation>
16
17 <xs:import namespace="http://wixtoolset.org/schemas/v4/wxs" />
18
19 <xs:element name="SqlDatabase">
20 <xs:annotation>
21 <xs:appinfo>
22 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
23 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" />
24 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Module" />
25 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Product" />
26 <xse:remarks>
27 <html:dl>
28 <html:dd>Nesting SqlDatabase under a Component element will result in a SqlDatabase being installed to the machine as the package is installed.</html:dd>
29 <html:dd>
30 Nesting SqlDatabase under Product, Fragment, or Module
31 results in a database "locator" record being created in
32 the SqlDatabase table. This means that the database
33 itself is neither installed nor uninstalled by the MSI
34 package. It does make the database available for referencing
35 from a SqlString or SqlScript record. This allows MSI to install
36 SqlScripts or SqlStrings to already existing databases on the machine.
37 The install will fail if the database does not exist in these cases.
38 </html:dd>
39 <html:dd>
40 The User attribute references credentials specified in a User element.
41 If a user is not specified then Windows Authentication will be used by default
42 using the credentials of the user performing the install to execute sql
43 strings, etc.
44 </html:dd>
45 </html:dl>
46 </xse:remarks>
47 <xse:seeAlso namespace="http://schemas.microsoft.com/wix/UtilExtension" ref="User"/>
48 </xs:appinfo>
49 <xs:documentation>SQL Database</xs:documentation>
50 </xs:annotation>
51 <xs:complexType>
52 <xs:choice minOccurs="0" maxOccurs="unbounded">
53 <xs:sequence>
54 <xs:element ref="SqlFileSpec" minOccurs="0"/>
55 <xs:element ref="SqlLogFileSpec" minOccurs="0"/>
56 </xs:sequence>
57 <xs:element ref="SqlScript"/>
58 <xs:element ref="SqlString"/>
59 </xs:choice>
60 <xs:attribute name="Id" use="required" type="xs:string"/>
61 <xs:attribute name="Server" use="required" type="xs:string">
62 </xs:attribute>
63 <xs:attribute name="Instance" type="xs:string">
64 </xs:attribute>
65 <xs:attribute name="Database" use="required" type="xs:string">
66 <xs:annotation>
67 <xs:documentation>
68 The name of the database. The value can be a literal value or derived from a
69 Property element using the <html:a href='http://msdn.microsoft.com/library/aa368609.aspx' target='_blank'>Formatted</html:a>
70 syntax.
71 </xs:documentation>
72 </xs:annotation>
73 </xs:attribute>
74 <xs:attribute name="User" type="xs:string">
75 </xs:attribute>
76 <xs:attribute name="CreateOnInstall" type="YesNoType">
77 </xs:attribute>
78 <xs:attribute name="CreateOnReinstall" type="YesNoType">
79 <xs:annotation>
80 <xs:documentation>
81 Specifies whether to create the database when the associated component is reinstalled. Setting CreateOnInstall to yes does <html:b>not</html:b> imply CreateOnReinstall is set to yes. CreateOnReinstall must be set in addition to CreateOnInstall for it to be created during both install and reinstall.
82 </xs:documentation>
83 </xs:annotation>
84 </xs:attribute>
85 <xs:attribute name="CreateOnUninstall" type="YesNoType">
86 </xs:attribute>
87 <xs:attribute name="DropOnInstall" type="YesNoType">
88 </xs:attribute>
89 <xs:attribute name="DropOnReinstall" type="YesNoType">
90 <xs:annotation>
91 <xs:documentation>
92 Specifies whether to drop the database when the associated component is reinstalled. Setting DropOnInstall to yes does <html:b>not</html:b> imply DropOnReinstall is set to yes. DropOnReinstall must be set in addition to DropOnInstall for it to be dropped during both install and reinstall.
93 </xs:documentation>
94 </xs:annotation>
95 </xs:attribute>
96 <xs:attribute name="DropOnUninstall" type="YesNoType">
97 </xs:attribute>
98 <xs:attribute name="ContinueOnError" type="YesNoType">
99 </xs:attribute>
100 <xs:attribute name="ConfirmOverwrite" type="YesNoType">
101 </xs:attribute>
102 </xs:complexType>
103 </xs:element>
104
105 <xs:element name="SqlFileSpec">
106 <xs:annotation>
107 <xs:documentation>File specification for a Sql database.</xs:documentation>
108 </xs:annotation>
109 <xs:complexType>
110 <xs:attribute name="Id" use="required" type="xs:string">
111 <xs:annotation>
112 <xs:documentation>ID of the file specification.</xs:documentation>
113 </xs:annotation>
114 </xs:attribute>
115 <xs:attribute name="Name" type="xs:string">
116 <xs:annotation>
117 <xs:documentation>Specifies the logical name for the database file.</xs:documentation>
118 </xs:annotation>
119 </xs:attribute>
120 <xs:attribute name="Filename" use="required" type="xs:string">
121 <xs:annotation>
122 <xs:documentation>Specifies the operating-system file name for the database file.</xs:documentation>
123 </xs:annotation>
124 </xs:attribute>
125 <xs:attribute name="Size" type="xs:string">
126 <xs:annotation>
127 <xs:documentation>
128 Specifies the size of the database file. The GB, MB and KB suffixes can be used to specify gigabytes,
129 megabytes or kilobytes. The default is megabytes if no suffix is specified. When a Size is not
130 supplied for a database file, SQL Server uses the size of the primary file in the model database.
131 </xs:documentation>
132 </xs:annotation>
133 </xs:attribute>
134 <xs:attribute name="MaxSize" type="xs:string">
135 <xs:annotation>
136 <xs:documentation>
137 Specifies the maximum size to which the database file can grow. The GB, MB and KB suffixes can be used to
138 to specify gigabytes, megabytes or kilobytes. The default is megabytes if no suffix is specified. If
139 MaxSize is not specified, the file will grow until the disk is full.
140 </xs:documentation>
141 </xs:annotation>
142 </xs:attribute>
143 <xs:attribute name="GrowthSize" type="xs:string">
144 <xs:annotation>
145 <xs:documentation>
146 Specifies the growth increment of the database file. The GB, MB and KB and % suffixes can be used to
147 specify gigabytes, megabytes, kilobytes or a percentage of the current file size to grow. The default is
148 megabytes if no suffix is specified. The default value is 10% if GrowthSize is not specified, and the
149 minimum value is 64 KB. The GrowthSize setting for a file cannot exceed the MaxSize setting.
150 </xs:documentation>
151 </xs:annotation>
152 </xs:attribute>
153 </xs:complexType>
154 </xs:element>
155
156 <xs:element name="SqlLogFileSpec">
157 <xs:annotation>
158 <xs:documentation>File specification for a Sql database.</xs:documentation>
159 </xs:annotation>
160 <xs:complexType>
161 <xs:attribute name="Id" type="xs:string">
162 <xs:annotation>
163 <xs:documentation>ID of the log file specification.</xs:documentation>
164 </xs:annotation>
165 </xs:attribute>
166 <xs:attribute name="Name" type="xs:string">
167 <xs:annotation>
168 <xs:documentation>Specifies the logical name for the log file.</xs:documentation>
169 </xs:annotation>
170 </xs:attribute>
171 <xs:attribute name="Filename" type="xs:string">
172 <xs:annotation>
173 <xs:documentation>Specifies the operating-system file name for the log file.</xs:documentation>
174 </xs:annotation>
175 </xs:attribute>
176 <xs:attribute name="Size" type="xs:string">
177 <xs:annotation>
178 <xs:documentation>
179 Specifies the size of the log file. The GB, MB and KB suffixes can be used to specify gigabytes,
180 megabytes or kilobytes. The default is megabytes if no suffix is specified. When a Size is not
181 supplied for a log file, SQL Server makes the file 1 MB.
182 </xs:documentation>
183 </xs:annotation>
184 </xs:attribute>
185 <xs:attribute name="MaxSize" type="xs:string">
186 <xs:annotation>
187 <xs:documentation>
188 Specifies the maximum size to which the log file can grow. The GB, MB and KB suffixes can be used to
189 to specify gigabytes, megabytes or kilobytes. The default is megabytes if no suffix is specified. If
190 MaxSize is not specified, the file will grow until the disk is full.
191 </xs:documentation>
192 </xs:annotation>
193 </xs:attribute>
194 <xs:attribute name="GrowthSize" type="xs:string">
195 <xs:annotation>
196 <xs:documentation>
197 Specifies the growth increment of the log file. The GB, MB and KB and % suffixes can be used to
198 specify gigabytes, megabytes, kilobytes or a percentage of the current file size to grow. The default is
199 megabytes if no suffix is specified. The default value is 10% if GrowthSize is not specified, and the
200 minimum value is 64 KB. The GrowthSize setting for a file cannot exceed the MaxSize setting.
201 </xs:documentation>
202 </xs:annotation>
203 </xs:attribute>
204 </xs:complexType>
205 </xs:element>
206
207 <xs:element name="SqlScript">
208 <xs:annotation>
209 <xs:appinfo>
210 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
211 </xs:appinfo>
212 <xs:documentation>SQL Script</xs:documentation>
213 </xs:annotation>
214 <xs:complexType>
215 <xs:attribute name="Id" use="required" type="xs:string"/>
216 <xs:attribute name="SqlDb" type="xs:string">
217 <xs:annotation>
218 <xs:documentation>required when not child of SqlDatabase</xs:documentation>
219 </xs:annotation>
220 </xs:attribute>
221 <xs:attribute name="User" type="xs:string">
222 </xs:attribute>
223 <xs:attribute name="BinaryKey" type="xs:string" use="required">
224 <xs:annotation>
225 <xs:documentation>Reference to Binary stream that contains the SQL script to execute.</xs:documentation>
226 </xs:annotation>
227 </xs:attribute>
228 <xs:attribute name="ExecuteOnInstall" type="YesNoType">
229 <xs:annotation>
230 <xs:documentation>Specifies to execute the script when the associated component is installed. This attribute is mutually exclusive with the RollbackOnInstall, RollbackOnReinstall and RollbackOnUninstall attributes.</xs:documentation>
231 </xs:annotation>
232 </xs:attribute>
233 <xs:attribute name="ExecuteOnReinstall" type="YesNoType">
234 <xs:annotation>
235 <xs:documentation>Specifies whether to execute the script when the associated component is reinstalled. Setting ExecuteOnInstall to yes does <html:b>not</html:b> imply ExecuteOnReinstall is set to yes. ExecuteOnReinstall must be set in addition to ExecuteOnInstall for it to be executed during both install and reinstall. This attribute is mutually exclusive with the RollbackOnInstall, RollbackOnReinstall and RollbackOnUninstall attributes.</xs:documentation>
236 </xs:annotation>
237 </xs:attribute>
238 <xs:attribute name="ExecuteOnUninstall" type="YesNoType">
239 <xs:annotation>
240 <xs:documentation>Specifies to execute the script when the associated component is uninstalled. This attribute is mutually exclusive with the RollbackOnInstall, RollbackOnReinstall and RollbackOnUninstall attributes.</xs:documentation>
241 </xs:annotation>
242 </xs:attribute>
243 <xs:attribute name="RollbackOnInstall" type="YesNoType">
244 <xs:annotation>
245 <xs:documentation>Specifies whether to execute the script on rollback if an attempt is made to install the associated component. This attribute is mutually exclusive with the ExecuteOnInstall, ExecuteOnReinstall and ExecuteOnUninstall attributes.</xs:documentation>
246 </xs:annotation>
247 </xs:attribute>
248 <xs:attribute name="RollbackOnReinstall" type="YesNoType">
249 <xs:annotation>
250 <xs:documentation>Specifies whether to execute the script on rollback if an attempt is made to reinstall the associated component. This attribute is mutually exclusive with the ExecuteOnInstall, ExecuteOnReinstall and ExecuteOnUninstall attributes.</xs:documentation>
251 </xs:annotation>
252 </xs:attribute>
253 <xs:attribute name="RollbackOnUninstall" type="YesNoType">
254 <xs:annotation>
255 <xs:documentation>Specifies whether to execute the script on rollback if an attempt is made to uninstall the associated component. This attribute is mutually exclusive with the ExecuteOnInstall, ExecuteOnReinstall and ExecuteOnUninstall attributes.</xs:documentation>
256 </xs:annotation>
257 </xs:attribute>
258 <xs:attribute name="ContinueOnError" type="YesNoType">
259 <xs:annotation>
260 <xs:documentation>Continue executing scripts even if this one fails.</xs:documentation>
261 </xs:annotation>
262 </xs:attribute>
263 <xs:attribute name="Sequence" type="xs:integer">
264 <xs:annotation>
265 <xs:documentation>Specifes the order to run the SQL Scripts. It is recommended that rollback scripts be scheduled before their complementary execution script. This order is also relative across the SqlString element.</xs:documentation>
266 </xs:annotation>
267 </xs:attribute>
268 </xs:complexType>
269 </xs:element>
270
271 <xs:element name="SqlString">
272 <xs:annotation>
273 <xs:appinfo>
274 <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Component" />
275 </xs:appinfo>
276 <xs:documentation>SQL String</xs:documentation>
277 </xs:annotation>
278 <xs:complexType>
279 <xs:attribute name="Id" use="required" type="xs:string">
280 </xs:attribute>
281 <xs:attribute name="SQL" use="required" type="xs:string">
282 </xs:attribute>
283 <xs:attribute name="User" type="xs:string">
284 </xs:attribute>
285 <xs:attribute name="SqlDb" type="xs:string">
286 </xs:attribute>
287 <xs:attribute name="ExecuteOnInstall" type="YesNoType">
288 <xs:annotation>
289 <xs:documentation>Specifies to execute the string when the associated component is installed. This attribute is mutually exclusive with the RollbackOnInstall, RollbackOnReinstall and RollbackOnUninstall attributes.</xs:documentation>
290 </xs:annotation>
291 </xs:attribute>
292 <xs:attribute name="ExecuteOnReinstall" type="YesNoType">
293 <xs:annotation>
294 <xs:documentation>
295 Specifies whether to execute the string when the associated component is reinstalled. Setting ExecuteOnInstall to yes does <html:b>not</html:b> imply ExecuteOnReinstall is set to yes. ExecuteOnReinstall must be set in addition to ExecuteOnInstall for it to be executed during both install and reinstall. This attribute is mutually exclusive with the RollbackOnInstall, RollbackOnReinstall and RollbackOnUninstall attributes.
296 </xs:documentation>
297 </xs:annotation>
298 </xs:attribute>
299 <xs:attribute name="ExecuteOnUninstall" type="YesNoType">
300 <xs:annotation>
301 <xs:documentation>Specifies to execute the string when the associated component is uninstalled. This attribute is mutually exclusive with the RollbackOnInstall, RollbackOnReinstall and RollbackOnUninstall attributes.</xs:documentation>
302 </xs:annotation>
303 </xs:attribute>
304 <xs:attribute name="RollbackOnInstall" type="YesNoType">
305 <xs:annotation>
306 <xs:documentation>Specifies whether to execute the string on rollback if an attempt is made to install the associated component. This attribute is mutually exclusive with the ExecuteOnInstall, ExecuteOnReinstall and ExecuteOnUninstall attributes.</xs:documentation>
307 </xs:annotation>
308 </xs:attribute>
309 <xs:attribute name="RollbackOnReinstall" type="YesNoType">
310 <xs:annotation>
311 <xs:documentation>Specifies whether to execute the string on rollback if an attempt is made to reinstall the associated component. This attribute is mutually exclusive with the ExecuteOnInstall, ExecuteOnReinstall and ExecuteOnUninstall attributes.</xs:documentation>
312 </xs:annotation>
313 </xs:attribute>
314 <xs:attribute name="RollbackOnUninstall" type="YesNoType">
315 <xs:annotation>
316 <xs:documentation>Specifies whether to execute the string on rollback if an attempt is made to uninstall the associated component. This attribute is mutually exclusive with the ExecuteOnInstall, ExecuteOnReinstall and ExecuteOnUninstall attributes.</xs:documentation>
317 </xs:annotation>
318 </xs:attribute>
319 <xs:attribute name="ContinueOnError" type="YesNoType">
320 <xs:annotation>
321 <xs:documentation>Continue executing strings even if this one fails.</xs:documentation>
322 </xs:annotation>
323 </xs:attribute>
324 <xs:attribute name="Sequence" type="xs:integer">
325 <xs:annotation>
326 <xs:documentation>Specifes the order to run the SQL Strings. It is recommended that rollback strings be scheduled before their complementary execution string. This order is also relative across the SqlScript element.</xs:documentation>
327 </xs:annotation>
328 </xs:attribute>
329 </xs:complexType>
330 </xs:element>
331
332 <xs:simpleType name="YesNoType">
333 <xs:annotation>
334 <xs:documentation>Values of this type will either be "yes" or "no".</xs:documentation>
335 </xs:annotation>
336 <xs:restriction base='xs:NMTOKEN'>
337 <xs:enumeration value="no"/>
338 <xs:enumeration value="yes"/>
339 </xs:restriction>
340 </xs:simpleType>
341
342</xs:schema>