diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2018-12-31 23:52:58 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2018-12-31 23:52:58 -0600 |
| commit | 2c568de11510b453f499827919964badef22304e (patch) | |
| tree | dd342fa59ad9b986e375c4128726b505ae95ad67 /src/wixext | |
| parent | cd23c2cba4239f32abf9743ecec9fef58136e0e8 (diff) | |
| download | wix-2c568de11510b453f499827919964badef22304e.tar.gz wix-2c568de11510b453f499827919964badef22304e.tar.bz2 wix-2c568de11510b453f499827919964badef22304e.zip | |
Import code from old v4 repo
Diffstat (limited to 'src/wixext')
| -rw-r--r-- | src/wixext/BalBinder.cs | 125 | ||||
| -rw-r--r-- | src/wixext/BalCompiler.cs | 562 | ||||
| -rw-r--r-- | src/wixext/BalExtensionData.cs | 55 | ||||
| -rw-r--r-- | src/wixext/WixBalExtension.csproj | 47 | ||||
| -rw-r--r-- | src/wixext/bal.xsd | 266 | ||||
| -rw-r--r-- | src/wixext/messages.xml | 43 | ||||
| -rw-r--r-- | src/wixext/tables.xml | 41 |
7 files changed, 1139 insertions, 0 deletions
diff --git a/src/wixext/BalBinder.cs b/src/wixext/BalBinder.cs new file mode 100644 index 00000000..30f7ab44 --- /dev/null +++ b/src/wixext/BalBinder.cs | |||
| @@ -0,0 +1,125 @@ | |||
| 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.Linq; | ||
| 8 | using System.Text; | ||
| 9 | using WixToolset; | ||
| 10 | using WixToolset.Data; | ||
| 11 | using WixToolset.Data.Rows; | ||
| 12 | using WixToolset.Extensibility; | ||
| 13 | |||
| 14 | public class BalBinder : BinderExtension | ||
| 15 | { | ||
| 16 | public override void Finish(Output output) | ||
| 17 | { | ||
| 18 | // Only process Bundles. | ||
| 19 | if (OutputType.Bundle != output.Type) | ||
| 20 | { | ||
| 21 | return; | ||
| 22 | } | ||
| 23 | |||
| 24 | Table baTable = output.Tables["WixBootstrapperApplication"]; | ||
| 25 | Row baRow = baTable.Rows[0]; | ||
| 26 | string baId = (string)baRow[0]; | ||
| 27 | if (null == baId) | ||
| 28 | { | ||
| 29 | return; | ||
| 30 | } | ||
| 31 | |||
| 32 | bool isStdBA = baId.StartsWith("WixStandardBootstrapperApplication"); | ||
| 33 | bool isMBA = baId.StartsWith("ManagedBootstrapperApplicationHost"); | ||
| 34 | |||
| 35 | if (isStdBA || isMBA) | ||
| 36 | { | ||
| 37 | VerifyBAFunctions(output); | ||
| 38 | } | ||
| 39 | |||
| 40 | if (isMBA) | ||
| 41 | { | ||
| 42 | VerifyPrereqPackages(output); | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 46 | private void VerifyBAFunctions(Output output) | ||
| 47 | { | ||
| 48 | Row baFunctionsRow = null; | ||
| 49 | Table baFunctionsTable = output.Tables["WixBalBAFunctions"]; | ||
| 50 | foreach (Row row in baFunctionsTable.RowsAs<Row>()) | ||
| 51 | { | ||
| 52 | if (null == baFunctionsRow) | ||
| 53 | { | ||
| 54 | baFunctionsRow = row; | ||
| 55 | } | ||
| 56 | else | ||
| 57 | { | ||
| 58 | this.Core.OnMessage(BalErrors.MultipleBAFunctions(row.SourceLineNumbers)); | ||
| 59 | } | ||
| 60 | } | ||
| 61 | |||
| 62 | Table payloadPropertiesTable = output.Tables["WixPayloadProperties"]; | ||
| 63 | IEnumerable<WixPayloadPropertiesRow> payloadPropertiesRows = payloadPropertiesTable.RowsAs<WixPayloadPropertiesRow>(); | ||
| 64 | if (null == baFunctionsRow) | ||
| 65 | { | ||
| 66 | foreach (WixPayloadPropertiesRow payloadPropertiesRow in payloadPropertiesRows) | ||
| 67 | { | ||
| 68 | // TODO: Make core WiX canonicalize Name (this won't catch '.\bafunctions.dll'). | ||
| 69 | if (String.Equals(payloadPropertiesRow.Name, "bafunctions.dll", StringComparison.OrdinalIgnoreCase)) | ||
| 70 | { | ||
| 71 | this.Core.OnMessage(BalWarnings.UnmarkedBAFunctionsDLL(payloadPropertiesRow.SourceLineNumbers)); | ||
| 72 | } | ||
| 73 | } | ||
| 74 | } | ||
| 75 | else | ||
| 76 | { | ||
| 77 | // TODO: May need to revisit this depending on the outcome of #5273. | ||
| 78 | string payloadId = (string)baFunctionsRow[0]; | ||
| 79 | WixPayloadPropertiesRow bundlePayloadRow = payloadPropertiesRows.Single(x => payloadId == x.Id); | ||
| 80 | if (Compiler.BurnUXContainerId != bundlePayloadRow.Container) | ||
| 81 | { | ||
| 82 | this.Core.OnMessage(BalErrors.BAFunctionsPayloadRequiredInUXContainer(baFunctionsRow.SourceLineNumbers)); | ||
| 83 | } | ||
| 84 | } | ||
| 85 | } | ||
| 86 | |||
| 87 | private void VerifyPrereqPackages(Output output) | ||
| 88 | { | ||
| 89 | Table prereqInfoTable = output.Tables["WixMbaPrereqInformation"]; | ||
| 90 | if (null == prereqInfoTable || prereqInfoTable.Rows.Count == 0) | ||
| 91 | { | ||
| 92 | this.Core.OnMessage(BalErrors.MissingPrereq()); | ||
| 93 | return; | ||
| 94 | } | ||
| 95 | |||
| 96 | bool foundLicenseFile = false; | ||
| 97 | bool foundLicenseUrl = false; | ||
| 98 | |||
| 99 | foreach (Row prereqInfoRow in prereqInfoTable.Rows) | ||
| 100 | { | ||
| 101 | if (null != prereqInfoRow[1]) | ||
| 102 | { | ||
| 103 | if (foundLicenseFile || foundLicenseUrl) | ||
| 104 | { | ||
| 105 | this.Core.OnMessage(BalErrors.MultiplePrereqLicenses(prereqInfoRow.SourceLineNumbers)); | ||
| 106 | return; | ||
| 107 | } | ||
| 108 | |||
| 109 | foundLicenseFile = true; | ||
| 110 | } | ||
| 111 | |||
| 112 | if (null != prereqInfoRow[2]) | ||
| 113 | { | ||
| 114 | if (foundLicenseFile || foundLicenseUrl) | ||
| 115 | { | ||
| 116 | this.Core.OnMessage(BalErrors.MultiplePrereqLicenses(prereqInfoRow.SourceLineNumbers)); | ||
| 117 | return; | ||
| 118 | } | ||
| 119 | |||
| 120 | foundLicenseUrl = true; | ||
| 121 | } | ||
| 122 | } | ||
| 123 | } | ||
| 124 | } | ||
| 125 | } | ||
diff --git a/src/wixext/BalCompiler.cs b/src/wixext/BalCompiler.cs new file mode 100644 index 00000000..38ca9e3c --- /dev/null +++ b/src/wixext/BalCompiler.cs | |||
| @@ -0,0 +1,562 @@ | |||
| 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.Data.Rows; | ||
| 10 | using WixToolset.Extensibility; | ||
| 11 | |||
| 12 | /// <summary> | ||
| 13 | /// The compiler for the WiX Toolset Bal Extension. | ||
| 14 | /// </summary> | ||
| 15 | public sealed class BalCompiler : CompilerExtension | ||
| 16 | { | ||
| 17 | private SourceLineNumber addedConditionLineNumber; | ||
| 18 | private Dictionary<string, Row> prereqInfoRows; | ||
| 19 | |||
| 20 | /// <summary> | ||
| 21 | /// Instantiate a new BalCompiler. | ||
| 22 | /// </summary> | ||
| 23 | public BalCompiler() | ||
| 24 | { | ||
| 25 | this.addedConditionLineNumber = null; | ||
| 26 | prereqInfoRows = new Dictionary<string, Row>(); | ||
| 27 | this.Namespace = "http://wixtoolset.org/schemas/v4/wxs/bal"; | ||
| 28 | } | ||
| 29 | |||
| 30 | /// <summary> | ||
| 31 | /// Processes an element for the Compiler. | ||
| 32 | /// </summary> | ||
| 33 | /// <param name="parentElement">Parent element of element to process.</param> | ||
| 34 | /// <param name="element">Element to process.</param> | ||
| 35 | /// <param name="contextValues">Extra information about the context in which this element is being parsed.</param> | ||
| 36 | public override void ParseElement(XElement parentElement, XElement element, IDictionary<string, string> context) | ||
| 37 | { | ||
| 38 | switch (parentElement.Name.LocalName) | ||
| 39 | { | ||
| 40 | case "Bundle": | ||
| 41 | case "Fragment": | ||
| 42 | switch (element.Name.LocalName) | ||
| 43 | { | ||
| 44 | case "Condition": | ||
| 45 | this.ParseConditionElement(element); | ||
| 46 | break; | ||
| 47 | default: | ||
| 48 | this.Core.UnexpectedElement(parentElement, element); | ||
| 49 | break; | ||
| 50 | } | ||
| 51 | break; | ||
| 52 | case "BootstrapperApplicationRef": | ||
| 53 | switch (element.Name.LocalName) | ||
| 54 | { | ||
| 55 | case "WixStandardBootstrapperApplication": | ||
| 56 | this.ParseWixStandardBootstrapperApplicationElement(element); | ||
| 57 | break; | ||
| 58 | case "WixManagedBootstrapperApplicationHost": | ||
| 59 | this.ParseWixManagedBootstrapperApplicationHostElement(element); | ||
| 60 | break; | ||
| 61 | default: | ||
| 62 | this.Core.UnexpectedElement(parentElement, element); | ||
| 63 | break; | ||
| 64 | } | ||
| 65 | break; | ||
| 66 | default: | ||
| 67 | this.Core.UnexpectedElement(parentElement, element); | ||
| 68 | break; | ||
| 69 | } | ||
| 70 | } | ||
| 71 | |||
| 72 | /// <summary> | ||
| 73 | /// Processes an attribute for the Compiler. | ||
| 74 | /// </summary> | ||
| 75 | /// <param name="sourceLineNumbers">Source line number for the parent element.</param> | ||
| 76 | /// <param name="parentElement">Parent element of element to process.</param> | ||
| 77 | /// <param name="attribute">Attribute to process.</param> | ||
| 78 | /// <param name="context">Extra information about the context in which this element is being parsed.</param> | ||
| 79 | public override void ParseAttribute(XElement parentElement, XAttribute attribute, IDictionary<string, string> context) | ||
| 80 | { | ||
| 81 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(parentElement); | ||
| 82 | Row row; | ||
| 83 | |||
| 84 | switch (parentElement.Name.LocalName) | ||
| 85 | { | ||
| 86 | case "ExePackage": | ||
| 87 | case "MsiPackage": | ||
| 88 | case "MspPackage": | ||
| 89 | case "MsuPackage": | ||
| 90 | string packageId; | ||
| 91 | if (!context.TryGetValue("PackageId", out packageId) || String.IsNullOrEmpty(packageId)) | ||
| 92 | { | ||
| 93 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, parentElement.Name.LocalName, "Id", attribute.Name.LocalName)); | ||
| 94 | } | ||
| 95 | else | ||
| 96 | { | ||
| 97 | switch (attribute.Name.LocalName) | ||
| 98 | { | ||
| 99 | case "PrereqLicenseFile": | ||
| 100 | |||
| 101 | if (!prereqInfoRows.TryGetValue(packageId, out row)) | ||
| 102 | { | ||
| 103 | // at the time the extension attribute is parsed, the compiler might not yet have | ||
| 104 | // parsed the PrereqPackage attribute, so we need to get it directly from the parent element. | ||
| 105 | XAttribute prereqPackage = parentElement.Attribute(this.Namespace + "PrereqPackage"); | ||
| 106 | |||
| 107 | if (null != prereqPackage && YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, prereqPackage)) | ||
| 108 | { | ||
| 109 | row = this.Core.CreateRow(sourceLineNumbers, "WixMbaPrereqInformation"); | ||
| 110 | row[0] = packageId; | ||
| 111 | |||
| 112 | prereqInfoRows.Add(packageId, row); | ||
| 113 | } | ||
| 114 | else | ||
| 115 | { | ||
| 116 | this.Core.OnMessage(BalErrors.AttributeRequiresPrereqPackage(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseFile")); | ||
| 117 | break; | ||
| 118 | } | ||
| 119 | } | ||
| 120 | |||
| 121 | if (null != row[2]) | ||
| 122 | { | ||
| 123 | this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseFile", "PrereqLicenseUrl")); | ||
| 124 | } | ||
| 125 | else | ||
| 126 | { | ||
| 127 | row[1] = this.Core.GetAttributeValue(sourceLineNumbers, attribute); | ||
| 128 | } | ||
| 129 | break; | ||
| 130 | case "PrereqLicenseUrl": | ||
| 131 | |||
| 132 | if (!prereqInfoRows.TryGetValue(packageId, out row)) | ||
| 133 | { | ||
| 134 | // at the time the extension attribute is parsed, the compiler might not yet have | ||
| 135 | // parsed the PrereqPackage attribute, so we need to get it directly from the parent element. | ||
| 136 | XAttribute prereqPackage = parentElement.Attribute(this.Namespace + "PrereqPackage"); | ||
| 137 | |||
| 138 | if (null != prereqPackage && YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, prereqPackage)) | ||
| 139 | { | ||
| 140 | row = this.Core.CreateRow(sourceLineNumbers, "WixMbaPrereqInformation"); | ||
| 141 | row[0] = packageId; | ||
| 142 | |||
| 143 | prereqInfoRows.Add(packageId, row); | ||
| 144 | } | ||
| 145 | else | ||
| 146 | { | ||
| 147 | this.Core.OnMessage(BalErrors.AttributeRequiresPrereqPackage(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseUrl")); | ||
| 148 | break; | ||
| 149 | } | ||
| 150 | } | ||
| 151 | |||
| 152 | if (null != row[1]) | ||
| 153 | { | ||
| 154 | this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, parentElement.Name.LocalName, "PrereqLicenseUrl", "PrereqLicenseFile")); | ||
| 155 | } | ||
| 156 | else | ||
| 157 | { | ||
| 158 | row[2] = this.Core.GetAttributeValue(sourceLineNumbers, attribute); | ||
| 159 | } | ||
| 160 | break; | ||
| 161 | case "PrereqPackage": | ||
| 162 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attribute)) | ||
| 163 | { | ||
| 164 | if (!prereqInfoRows.TryGetValue(packageId, out row)) | ||
| 165 | { | ||
| 166 | row = this.Core.CreateRow(sourceLineNumbers, "WixMbaPrereqInformation"); | ||
| 167 | row[0] = packageId; | ||
| 168 | |||
| 169 | prereqInfoRows.Add(packageId, row); | ||
| 170 | } | ||
| 171 | } | ||
| 172 | break; | ||
| 173 | default: | ||
| 174 | this.Core.UnexpectedAttribute(parentElement, attribute); | ||
| 175 | break; | ||
| 176 | } | ||
| 177 | } | ||
| 178 | break; | ||
| 179 | case "Payload": | ||
| 180 | string payloadId; | ||
| 181 | if (!context.TryGetValue("Id", out payloadId) || String.IsNullOrEmpty(payloadId)) | ||
| 182 | { | ||
| 183 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, parentElement.Name.LocalName, "Id", attribute.Name.LocalName)); | ||
| 184 | } | ||
| 185 | else | ||
| 186 | { | ||
| 187 | switch (attribute.Name.LocalName) | ||
| 188 | { | ||
| 189 | case "BAFunctions": | ||
| 190 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attribute)) | ||
| 191 | { | ||
| 192 | row = this.Core.CreateRow(sourceLineNumbers, "WixBalBAFunctions"); | ||
| 193 | row[0] = payloadId; | ||
| 194 | } | ||
| 195 | break; | ||
| 196 | default: | ||
| 197 | this.Core.UnexpectedAttribute(parentElement, attribute); | ||
| 198 | break; | ||
| 199 | } | ||
| 200 | } | ||
| 201 | break; | ||
| 202 | case "Variable": | ||
| 203 | // at the time the extension attribute is parsed, the compiler might not yet have | ||
| 204 | // parsed the Name attribute, so we need to get it directly from the parent element. | ||
| 205 | XAttribute variableName = parentElement.Attribute("Name"); | ||
| 206 | if (null == variableName) | ||
| 207 | { | ||
| 208 | this.Core.OnMessage(WixErrors.ExpectedParentWithAttribute(sourceLineNumbers, "Variable", "Overridable", "Name")); | ||
| 209 | } | ||
| 210 | else | ||
| 211 | { | ||
| 212 | switch (attribute.Name.LocalName) | ||
| 213 | { | ||
| 214 | case "Overridable": | ||
| 215 | if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attribute)) | ||
| 216 | { | ||
| 217 | row = this.Core.CreateRow(sourceLineNumbers, "WixStdbaOverridableVariable"); | ||
| 218 | row[0] = variableName; | ||
| 219 | } | ||
| 220 | break; | ||
| 221 | default: | ||
| 222 | this.Core.UnexpectedAttribute(parentElement, attribute); | ||
| 223 | break; | ||
| 224 | } | ||
| 225 | } | ||
| 226 | break; | ||
| 227 | } | ||
| 228 | } | ||
| 229 | |||
| 230 | /// <summary> | ||
| 231 | /// Parses a Condition element for Bundles. | ||
| 232 | /// </summary> | ||
| 233 | /// <param name="node">The element to parse.</param> | ||
| 234 | private void ParseConditionElement(XElement node) | ||
| 235 | { | ||
| 236 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
| 237 | string condition = this.Core.GetConditionInnerText(node); // condition is the inner text of the element. | ||
| 238 | string message = null; | ||
| 239 | |||
| 240 | foreach (XAttribute attrib in node.Attributes()) | ||
| 241 | { | ||
| 242 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
| 243 | { | ||
| 244 | switch (attrib.Name.LocalName) | ||
| 245 | { | ||
| 246 | case "Message": | ||
| 247 | message = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 248 | break; | ||
| 249 | default: | ||
| 250 | this.Core.UnexpectedAttribute(node, attrib); | ||
| 251 | break; | ||
| 252 | } | ||
| 253 | } | ||
| 254 | else | ||
| 255 | { | ||
| 256 | this.Core.ParseExtensionAttribute(node, attrib); | ||
| 257 | } | ||
| 258 | } | ||
| 259 | |||
| 260 | this.Core.ParseForExtensionElements(node); | ||
| 261 | |||
| 262 | // Error check the values. | ||
| 263 | if (String.IsNullOrEmpty(condition)) | ||
| 264 | { | ||
| 265 | this.Core.OnMessage(WixErrors.ConditionExpected(sourceLineNumbers, node.Name.LocalName)); | ||
| 266 | } | ||
| 267 | |||
| 268 | if (null == message) | ||
| 269 | { | ||
| 270 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Message")); | ||
| 271 | } | ||
| 272 | |||
| 273 | if (!this.Core.EncounteredError) | ||
| 274 | { | ||
| 275 | Row row = this.Core.CreateRow(sourceLineNumbers, "WixBalCondition"); | ||
| 276 | row[0] = condition; | ||
| 277 | row[1] = message; | ||
| 278 | |||
| 279 | if (null == this.addedConditionLineNumber) | ||
| 280 | { | ||
| 281 | this.addedConditionLineNumber = sourceLineNumbers; | ||
| 282 | } | ||
| 283 | } | ||
| 284 | } | ||
| 285 | |||
| 286 | /// <summary> | ||
| 287 | /// Parses a WixStandardBootstrapperApplication element for Bundles. | ||
| 288 | /// </summary> | ||
| 289 | /// <param name="node">The element to parse.</param> | ||
| 290 | private void ParseWixStandardBootstrapperApplicationElement(XElement node) | ||
| 291 | { | ||
| 292 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
| 293 | string launchTarget = null; | ||
| 294 | string launchTargetElevatedId = null; | ||
| 295 | string launchArguments = null; | ||
| 296 | YesNoType launchHidden = YesNoType.NotSet; | ||
| 297 | string launchWorkingDir = null; | ||
| 298 | string licenseFile = null; | ||
| 299 | string licenseUrl = null; | ||
| 300 | string logoFile = null; | ||
| 301 | string logoSideFile = null; | ||
| 302 | string themeFile = null; | ||
| 303 | string localizationFile = null; | ||
| 304 | YesNoType suppressOptionsUI = YesNoType.NotSet; | ||
| 305 | YesNoType suppressDowngradeFailure = YesNoType.NotSet; | ||
| 306 | YesNoType suppressRepair = YesNoType.NotSet; | ||
| 307 | YesNoType showVersion = YesNoType.NotSet; | ||
| 308 | YesNoType supportCacheOnly = YesNoType.NotSet; | ||
| 309 | |||
| 310 | foreach (XAttribute attrib in node.Attributes()) | ||
| 311 | { | ||
| 312 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
| 313 | { | ||
| 314 | switch (attrib.Name.LocalName) | ||
| 315 | { | ||
| 316 | case "LaunchTarget": | ||
| 317 | launchTarget = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 318 | break; | ||
| 319 | case "LaunchTargetElevatedId": | ||
| 320 | launchTargetElevatedId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); | ||
| 321 | break; | ||
| 322 | case "LaunchArguments": | ||
| 323 | launchArguments = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 324 | break; | ||
| 325 | case "LaunchHidden": | ||
| 326 | launchHidden = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
| 327 | break; | ||
| 328 | case "LaunchWorkingFolder": | ||
| 329 | launchWorkingDir = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 330 | break; | ||
| 331 | case "LicenseFile": | ||
| 332 | licenseFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 333 | break; | ||
| 334 | case "LicenseUrl": | ||
| 335 | licenseUrl = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); | ||
| 336 | break; | ||
| 337 | case "LogoFile": | ||
| 338 | logoFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 339 | break; | ||
| 340 | case "LogoSideFile": | ||
| 341 | logoSideFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 342 | break; | ||
| 343 | case "ThemeFile": | ||
| 344 | themeFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 345 | break; | ||
| 346 | case "LocalizationFile": | ||
| 347 | localizationFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 348 | break; | ||
| 349 | case "SuppressOptionsUI": | ||
| 350 | suppressOptionsUI = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
| 351 | break; | ||
| 352 | case "SuppressDowngradeFailure": | ||
| 353 | suppressDowngradeFailure = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
| 354 | break; | ||
| 355 | case "SuppressRepair": | ||
| 356 | suppressRepair = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
| 357 | break; | ||
| 358 | case "ShowVersion": | ||
| 359 | showVersion = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
| 360 | break; | ||
| 361 | case "SupportCacheOnly": | ||
| 362 | supportCacheOnly = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | ||
| 363 | break; | ||
| 364 | default: | ||
| 365 | this.Core.UnexpectedAttribute(node, attrib); | ||
| 366 | break; | ||
| 367 | } | ||
| 368 | } | ||
| 369 | else | ||
| 370 | { | ||
| 371 | this.Core.ParseExtensionAttribute(node, attrib); | ||
| 372 | } | ||
| 373 | } | ||
| 374 | |||
| 375 | this.Core.ParseForExtensionElements(node); | ||
| 376 | |||
| 377 | if (String.IsNullOrEmpty(licenseFile) && null == licenseUrl) | ||
| 378 | { | ||
| 379 | this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "LicenseFile", "LicenseUrl", true)); | ||
| 380 | } | ||
| 381 | |||
| 382 | if (!this.Core.EncounteredError) | ||
| 383 | { | ||
| 384 | if (!String.IsNullOrEmpty(launchTarget)) | ||
| 385 | { | ||
| 386 | WixBundleVariableRow row = (WixBundleVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixBundleVariable"); | ||
| 387 | row.Id = "LaunchTarget"; | ||
| 388 | row.Value = launchTarget; | ||
| 389 | row.Type = "string"; | ||
| 390 | } | ||
| 391 | |||
| 392 | if (!String.IsNullOrEmpty(launchTargetElevatedId)) | ||
| 393 | { | ||
| 394 | WixBundleVariableRow row = (WixBundleVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixBundleVariable"); | ||
| 395 | row.Id = "LaunchTargetElevatedId"; | ||
| 396 | row.Value = launchTargetElevatedId; | ||
| 397 | row.Type = "string"; | ||
| 398 | } | ||
| 399 | |||
| 400 | if (!String.IsNullOrEmpty(launchArguments)) | ||
| 401 | { | ||
| 402 | WixBundleVariableRow row = (WixBundleVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixBundleVariable"); | ||
| 403 | row.Id = "LaunchArguments"; | ||
| 404 | row.Value = launchArguments; | ||
| 405 | row.Type = "string"; | ||
| 406 | } | ||
| 407 | |||
| 408 | if (YesNoType.Yes == launchHidden) | ||
| 409 | { | ||
| 410 | WixBundleVariableRow row = (WixBundleVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixBundleVariable"); | ||
| 411 | row.Id = "LaunchHidden"; | ||
| 412 | row.Value = "yes"; | ||
| 413 | row.Type = "string"; | ||
| 414 | } | ||
| 415 | |||
| 416 | |||
| 417 | if (!String.IsNullOrEmpty(launchWorkingDir)) | ||
| 418 | { | ||
| 419 | WixBundleVariableRow row = (WixBundleVariableRow)this.Core.CreateRow(sourceLineNumbers, "Variable"); | ||
| 420 | row.Id = "LaunchWorkingFolder"; | ||
| 421 | row.Value = launchWorkingDir; | ||
| 422 | row.Type = "string"; | ||
| 423 | } | ||
| 424 | |||
| 425 | if (!String.IsNullOrEmpty(licenseFile)) | ||
| 426 | { | ||
| 427 | WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); | ||
| 428 | wixVariableRow.Id = "WixStdbaLicenseRtf"; | ||
| 429 | wixVariableRow.Value = licenseFile; | ||
| 430 | } | ||
| 431 | |||
| 432 | if (null != licenseUrl) | ||
| 433 | { | ||
| 434 | WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); | ||
| 435 | wixVariableRow.Id = "WixStdbaLicenseUrl"; | ||
| 436 | wixVariableRow.Value = licenseUrl; | ||
| 437 | } | ||
| 438 | |||
| 439 | if (!String.IsNullOrEmpty(logoFile)) | ||
| 440 | { | ||
| 441 | WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); | ||
| 442 | wixVariableRow.Id = "WixStdbaLogo"; | ||
| 443 | wixVariableRow.Value = logoFile; | ||
| 444 | } | ||
| 445 | |||
| 446 | if (!String.IsNullOrEmpty(logoSideFile)) | ||
| 447 | { | ||
| 448 | WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); | ||
| 449 | wixVariableRow.Id = "WixStdbaLogoSide"; | ||
| 450 | wixVariableRow.Value = logoSideFile; | ||
| 451 | } | ||
| 452 | |||
| 453 | if (!String.IsNullOrEmpty(themeFile)) | ||
| 454 | { | ||
| 455 | WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); | ||
| 456 | wixVariableRow.Id = "WixStdbaThemeXml"; | ||
| 457 | wixVariableRow.Value = themeFile; | ||
| 458 | } | ||
| 459 | |||
| 460 | if (!String.IsNullOrEmpty(localizationFile)) | ||
| 461 | { | ||
| 462 | WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); | ||
| 463 | wixVariableRow.Id = "WixStdbaThemeWxl"; | ||
| 464 | wixVariableRow.Value = localizationFile; | ||
| 465 | } | ||
| 466 | |||
| 467 | if (YesNoType.Yes == suppressOptionsUI || YesNoType.Yes == suppressDowngradeFailure || YesNoType.Yes == suppressRepair || YesNoType.Yes == showVersion || YesNoType.Yes == supportCacheOnly) | ||
| 468 | { | ||
| 469 | Row row = this.Core.CreateRow(sourceLineNumbers, "WixStdbaOptions"); | ||
| 470 | if (YesNoType.Yes == suppressOptionsUI) | ||
| 471 | { | ||
| 472 | row[0] = 1; | ||
| 473 | } | ||
| 474 | |||
| 475 | if (YesNoType.Yes == suppressDowngradeFailure) | ||
| 476 | { | ||
| 477 | row[1] = 1; | ||
| 478 | } | ||
| 479 | |||
| 480 | if (YesNoType.Yes == suppressRepair) | ||
| 481 | { | ||
| 482 | row[2] = 1; | ||
| 483 | } | ||
| 484 | |||
| 485 | if (YesNoType.Yes == showVersion) | ||
| 486 | { | ||
| 487 | row[3] = 1; | ||
| 488 | } | ||
| 489 | |||
| 490 | if (YesNoType.Yes == supportCacheOnly) | ||
| 491 | { | ||
| 492 | row[4] = 1; | ||
| 493 | } | ||
| 494 | } | ||
| 495 | } | ||
| 496 | } | ||
| 497 | |||
| 498 | /// <summary> | ||
| 499 | /// Parses a WixManagedBootstrapperApplicationHost element for Bundles. | ||
| 500 | /// </summary> | ||
| 501 | /// <param name="node">The element to parse.</param> | ||
| 502 | private void ParseWixManagedBootstrapperApplicationHostElement(XElement node) | ||
| 503 | { | ||
| 504 | SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | ||
| 505 | string logoFile = null; | ||
| 506 | string themeFile = null; | ||
| 507 | string localizationFile = null; | ||
| 508 | |||
| 509 | foreach (XAttribute attrib in node.Attributes()) | ||
| 510 | { | ||
| 511 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace) | ||
| 512 | { | ||
| 513 | switch (attrib.Name.LocalName) | ||
| 514 | { | ||
| 515 | case "LogoFile": | ||
| 516 | logoFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 517 | break; | ||
| 518 | case "ThemeFile": | ||
| 519 | themeFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 520 | break; | ||
| 521 | case "LocalizationFile": | ||
| 522 | localizationFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 523 | break; | ||
| 524 | default: | ||
| 525 | this.Core.UnexpectedAttribute(node, attrib); | ||
| 526 | break; | ||
| 527 | } | ||
| 528 | } | ||
| 529 | else | ||
| 530 | { | ||
| 531 | this.Core.ParseExtensionAttribute(node, attrib); | ||
| 532 | } | ||
| 533 | } | ||
| 534 | |||
| 535 | this.Core.ParseForExtensionElements(node); | ||
| 536 | |||
| 537 | if (!this.Core.EncounteredError) | ||
| 538 | { | ||
| 539 | if (!String.IsNullOrEmpty(logoFile)) | ||
| 540 | { | ||
| 541 | WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); | ||
| 542 | wixVariableRow.Id = "PreqbaLogo"; | ||
| 543 | wixVariableRow.Value = logoFile; | ||
| 544 | } | ||
| 545 | |||
| 546 | if (!String.IsNullOrEmpty(themeFile)) | ||
| 547 | { | ||
| 548 | WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); | ||
| 549 | wixVariableRow.Id = "PreqbaThemeXml"; | ||
| 550 | wixVariableRow.Value = themeFile; | ||
| 551 | } | ||
| 552 | |||
| 553 | if (!String.IsNullOrEmpty(localizationFile)) | ||
| 554 | { | ||
| 555 | WixVariableRow wixVariableRow = (WixVariableRow)this.Core.CreateRow(sourceLineNumbers, "WixVariable"); | ||
| 556 | wixVariableRow.Id = "PreqbaThemeWxl"; | ||
| 557 | wixVariableRow.Value = localizationFile; | ||
| 558 | } | ||
| 559 | } | ||
| 560 | } | ||
| 561 | } | ||
| 562 | } | ||
diff --git a/src/wixext/BalExtensionData.cs b/src/wixext/BalExtensionData.cs new file mode 100644 index 00000000..7e8dea5b --- /dev/null +++ b/src/wixext/BalExtensionData.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 Bal Extension. | ||
| 12 | /// </summary> | ||
| 13 | public sealed class BalExtensionData : 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 BalExtensionData.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 BalExtensionData.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.bal.wixlib", tableDefinitions); | ||
| 53 | } | ||
| 54 | } | ||
| 55 | } | ||
diff --git a/src/wixext/WixBalExtension.csproj b/src/wixext/WixBalExtension.csproj new file mode 100644 index 00000000..3e9d382e --- /dev/null +++ b/src/wixext/WixBalExtension.csproj | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
| 3 | |||
| 4 | |||
| 5 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> | ||
| 6 | <PropertyGroup> | ||
| 7 | <ProjectGuid>{BF720A63-9D7B-456E-B60C-8122852D9FED}</ProjectGuid> | ||
| 8 | <AssemblyName>WixBalExtension</AssemblyName> | ||
| 9 | <OutputType>Library</OutputType> | ||
| 10 | <RootNamespace>WixToolset.Extensions</RootNamespace> | ||
| 11 | </PropertyGroup> | ||
| 12 | <ItemGroup> | ||
| 13 | <Compile Include="AssemblyInfo.cs" /> | ||
| 14 | <Compile Include="BalBinder.cs" /> | ||
| 15 | <Compile Include="BalCompiler.cs" /> | ||
| 16 | <Compile Include="BalExtensionData.cs" /> | ||
| 17 | <MsgGenSource Include="Data\messages.xml"> | ||
| 18 | <ResourcesLogicalName>$(RootNamespace).Data.Messages.resources</ResourcesLogicalName> | ||
| 19 | </MsgGenSource> | ||
| 20 | <EmbeddedFlattenedResource Include="Data\tables.xml"> | ||
| 21 | <LogicalName>$(RootNamespace).Data.tables.xml</LogicalName> | ||
| 22 | </EmbeddedFlattenedResource> | ||
| 23 | <EmbeddedFlattenedResource Include="Xsd\bal.xsd"> | ||
| 24 | <LogicalName>$(RootNamespace).Xsd.bal.xsd</LogicalName> | ||
| 25 | <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
| 26 | </EmbeddedFlattenedResource> | ||
| 27 | <XsdGenSource Include="Xsd\bal.xsd"> | ||
| 28 | <CommonNamespace>WixToolset.Data.Serialize</CommonNamespace> | ||
| 29 | <Namespace>WixToolset.Extensions.Serialize.Bal</Namespace> | ||
| 30 | </XsdGenSource> | ||
| 31 | <EmbeddedResource Include="$(OutputPath)\bal.wixlib"> | ||
| 32 | <Link>Data\bal.wixlib</Link> | ||
| 33 | </EmbeddedResource> | ||
| 34 | </ItemGroup> | ||
| 35 | <ItemGroup> | ||
| 36 | <Reference Include="System" /> | ||
| 37 | <Reference Include="System.Xml" /> | ||
| 38 | <Reference Include="System.Xml.Linq" /> | ||
| 39 | <ProjectReference Include="..\..\..\libs\WixToolset.Data\WixToolset.Data.csproj" /> | ||
| 40 | <ProjectReference Include="..\..\..\libs\WixToolset.Extensibility\WixToolset.Extensibility.csproj" /> | ||
| 41 | <ProjectReference Include="..\..\..\tools\wix\Wix.csproj" /> | ||
| 42 | <ProjectReference Include="..\wixlib\BalExtension.wixproj"> | ||
| 43 | <ReferenceOutputAssembly>false</ReferenceOutputAssembly> | ||
| 44 | </ProjectReference> | ||
| 45 | </ItemGroup> | ||
| 46 | <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), wix.proj))\tools\WixBuild.targets" /> | ||
| 47 | </Project> | ||
diff --git a/src/wixext/bal.xsd b/src/wixext/bal.xsd new file mode 100644 index 00000000..73f10540 --- /dev/null +++ b/src/wixext/bal.xsd | |||
| @@ -0,0 +1,266 @@ | |||
| 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 | xmlns:html="http://www.w3.org/1999/xhtml" | ||
| 8 | targetNamespace="http://wixtoolset.org/schemas/v4/wxs/bal" | ||
| 9 | xmlns="http://wixtoolset.org/schemas/v4/wxs/bal"> | ||
| 10 | <xs:annotation> | ||
| 11 | <xs:documentation> | ||
| 12 | The source code schema for the WiX Toolset Burn User Experience Extension. | ||
| 13 | </xs:documentation> | ||
| 14 | </xs:annotation> | ||
| 15 | |||
| 16 | <xs:import namespace="http://wixtoolset.org/schemas/v4/wxs" /> | ||
| 17 | |||
| 18 | <xs:element name="Condition"> | ||
| 19 | <xs:annotation> | ||
| 20 | <xs:documentation> | ||
| 21 | Conditions for a bundle. The condition is specified in the inner text of the element. | ||
| 22 | </xs:documentation> | ||
| 23 | <xs:appinfo> | ||
| 24 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Bundle" /> | ||
| 25 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Fragment" /> | ||
| 26 | </xs:appinfo> | ||
| 27 | </xs:annotation> | ||
| 28 | <xs:complexType> | ||
| 29 | <xs:simpleContent> | ||
| 30 | <xs:extension base="xs:string"> | ||
| 31 | <xs:annotation> | ||
| 32 | <xs:documentation> | ||
| 33 | The condition that must evaluate to true for the installation to continue. | ||
| 34 | </xs:documentation> | ||
| 35 | </xs:annotation> | ||
| 36 | <xs:attribute name="Message" type="xs:string" use="required"> | ||
| 37 | <xs:annotation> | ||
| 38 | <xs:documentation> | ||
| 39 | Set the value to the text to display when the condition fails and the installation must be terminated. | ||
| 40 | </xs:documentation> | ||
| 41 | </xs:annotation> | ||
| 42 | </xs:attribute> | ||
| 43 | </xs:extension> | ||
| 44 | </xs:simpleContent> | ||
| 45 | </xs:complexType> | ||
| 46 | </xs:element> | ||
| 47 | |||
| 48 | <xs:element name="WixStandardBootstrapperApplication"> | ||
| 49 | <xs:annotation> | ||
| 50 | <xs:documentation> | ||
| 51 | Configures WixStandardBootstrapperApplication for a Bundle. | ||
| 52 | </xs:documentation> | ||
| 53 | <xs:appinfo> | ||
| 54 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="BootstrapperApplicationRef" /> | ||
| 55 | </xs:appinfo> | ||
| 56 | </xs:annotation> | ||
| 57 | <xs:complexType> | ||
| 58 | <xs:attribute name="LaunchTarget" type="xs:string"> | ||
| 59 | <xs:annotation> | ||
| 60 | <xs:documentation> | ||
| 61 | If set, the success page will show a Launch button the user can use to launch the application being installed. | ||
| 62 | The string value can be formatted using Burn variables enclosed in brackets, | ||
| 63 | to refer to installation directories and so forth. | ||
| 64 | </xs:documentation> | ||
| 65 | </xs:annotation> | ||
| 66 | </xs:attribute> | ||
| 67 | <xs:attribute name="LaunchTargetElevatedId" type="xs:string"> | ||
| 68 | <xs:annotation> | ||
| 69 | <xs:documentation> | ||
| 70 | Id of the target ApprovedExeForElevation element. | ||
| 71 | If set with LaunchTarget, WixStdBA will launch the application through the Engine's LaunchApprovedExe method instead of through ShellExecute. | ||
| 72 | </xs:documentation> | ||
| 73 | </xs:annotation> | ||
| 74 | </xs:attribute> | ||
| 75 | <xs:attribute name="LaunchArguments" type="xs:string"> | ||
| 76 | <xs:annotation> | ||
| 77 | <xs:documentation> | ||
| 78 | If set, WixStdBA will supply these arguments when launching the application specified by the LaunchTarget attribute. | ||
| 79 | The string value can be formatted using Burn variables enclosed in brackets, | ||
| 80 | to refer to installation directories and so forth. | ||
| 81 | </xs:documentation> | ||
| 82 | </xs:annotation> | ||
| 83 | </xs:attribute> | ||
| 84 | <xs:attribute name="LaunchHidden" type="YesNoType"> | ||
| 85 | <xs:annotation> | ||
| 86 | <xs:documentation> | ||
| 87 | If set to "yes", WixStdBA will launch the application specified by the LaunchTarget attribute with the SW_HIDE flag. | ||
| 88 | This attribute is ignored when the LaunchTargetElevatedId attribute is specified. | ||
| 89 | </xs:documentation> | ||
| 90 | </xs:annotation> | ||
| 91 | </xs:attribute> | ||
| 92 | <xs:attribute name="LaunchWorkingFolder" type="xs:string"> | ||
| 93 | <xs:annotation> | ||
| 94 | <xs:documentation> | ||
| 95 | WixStdBA will use this working folder when launching the specified application. | ||
| 96 | The string value can be formatted using Burn variables enclosed in brackets, | ||
| 97 | to refer to installation directories and so forth. | ||
| 98 | This attribute is ignored when the LaunchTargetElevatedId attribute is specified. | ||
| 99 | </xs:documentation> | ||
| 100 | </xs:annotation> | ||
| 101 | </xs:attribute> | ||
| 102 | <xs:attribute name="LicenseFile" type="xs:string"> | ||
| 103 | <xs:annotation> | ||
| 104 | <xs:documentation>Source file of the RTF license file. Cannot be used simultaneously with LicenseUrl.</xs:documentation> | ||
| 105 | </xs:annotation> | ||
| 106 | </xs:attribute> | ||
| 107 | <xs:attribute name="LicenseUrl" type="xs:string"> | ||
| 108 | <xs:annotation> | ||
| 109 | <xs:documentation>URL target of the license link. Cannot be used simultaneously with LicenseFile. This attribute can be empty to hide the license link completely.</xs:documentation> | ||
| 110 | </xs:annotation> | ||
| 111 | </xs:attribute> | ||
| 112 | <xs:attribute name="LogoFile" type="xs:string"> | ||
| 113 | <xs:annotation> | ||
| 114 | <xs:documentation>Source file of the logo graphic.</xs:documentation> | ||
| 115 | </xs:annotation> | ||
| 116 | </xs:attribute> | ||
| 117 | <xs:attribute name="LogoSideFile" type="xs:string"> | ||
| 118 | <xs:annotation> | ||
| 119 | <xs:documentation>Source file of the side logo graphic.</xs:documentation> | ||
| 120 | </xs:annotation> | ||
| 121 | </xs:attribute> | ||
| 122 | <xs:attribute name="ThemeFile" type="xs:string"> | ||
| 123 | <xs:annotation> | ||
| 124 | <xs:documentation>Source file of the theme XML.</xs:documentation> | ||
| 125 | </xs:annotation> | ||
| 126 | </xs:attribute> | ||
| 127 | <xs:attribute name="LocalizationFile" type="xs:string"> | ||
| 128 | <xs:annotation> | ||
| 129 | <xs:documentation>Source file of the theme localization .wxl file.</xs:documentation> | ||
| 130 | </xs:annotation> | ||
| 131 | </xs:attribute> | ||
| 132 | <xs:attribute name="SuppressOptionsUI" type="YesNoType"> | ||
| 133 | <xs:annotation> | ||
| 134 | <xs:documentation>If set to "yes", the Options button will not be shown and the user will not be able to choose an installation directory.</xs:documentation> | ||
| 135 | </xs:annotation> | ||
| 136 | </xs:attribute> | ||
| 137 | <xs:attribute name="SuppressDowngradeFailure" type="YesNoType"> | ||
| 138 | <xs:annotation> | ||
| 139 | <xs:documentation>If set to "yes", attempting to installer a downgraded version of a bundle will be treated as a successful do-nothing operation. | ||
| 140 | The default behavior (or when explicitly set to "no") is to treat downgrade attempts as failures. </xs:documentation> | ||
| 141 | </xs:annotation> | ||
| 142 | </xs:attribute> | ||
| 143 | <xs:attribute name="SuppressRepair" type="YesNoType"> | ||
| 144 | <xs:annotation> | ||
| 145 | <xs:documentation>If set to "yes", the Repair button will not be shown in the maintenance-mode UI.</xs:documentation> | ||
| 146 | </xs:annotation> | ||
| 147 | </xs:attribute> | ||
| 148 | <xs:attribute name="ShowVersion" type="YesNoType"> | ||
| 149 | <xs:annotation> | ||
| 150 | <xs:documentation>If set to "yes", the application version will be displayed on the UI.</xs:documentation> | ||
| 151 | </xs:annotation> | ||
| 152 | </xs:attribute> | ||
| 153 | <xs:attribute name="SupportCacheOnly" type="YesNoType"> | ||
| 154 | <xs:annotation> | ||
| 155 | <xs:documentation>If set to "yes", the bundle can be pre-cached using the /cache command line argument.</xs:documentation> | ||
| 156 | </xs:annotation> | ||
| 157 | </xs:attribute> | ||
| 158 | </xs:complexType> | ||
| 159 | </xs:element> | ||
| 160 | |||
| 161 | <xs:element name="WixManagedBootstrapperApplicationHost"> | ||
| 162 | <xs:annotation> | ||
| 163 | <xs:documentation> | ||
| 164 | Configures the ManagedBootstrapperApplicationHost for a Bundle. | ||
| 165 | </xs:documentation> | ||
| 166 | <xs:appinfo> | ||
| 167 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="BootstrapperApplicationRef" /> | ||
| 168 | </xs:appinfo> | ||
| 169 | </xs:annotation> | ||
| 170 | <xs:complexType> | ||
| 171 | <xs:attribute name="LogoFile" type="xs:string"> | ||
| 172 | <xs:annotation> | ||
| 173 | <xs:documentation>Source file of the logo graphic.</xs:documentation> | ||
| 174 | </xs:annotation> | ||
| 175 | </xs:attribute> | ||
| 176 | <xs:attribute name="ThemeFile" type="xs:string"> | ||
| 177 | <xs:annotation> | ||
| 178 | <xs:documentation>Source file of the theme XML.</xs:documentation> | ||
| 179 | </xs:annotation> | ||
| 180 | </xs:attribute> | ||
| 181 | <xs:attribute name="LocalizationFile" type="xs:string"> | ||
| 182 | <xs:annotation> | ||
| 183 | <xs:documentation>Source file of the theme localization .wxl file.</xs:documentation> | ||
| 184 | </xs:annotation> | ||
| 185 | </xs:attribute> | ||
| 186 | </xs:complexType> | ||
| 187 | </xs:element> | ||
| 188 | |||
| 189 | <xs:attribute name="BAFunctions" type="YesNoType"> | ||
| 190 | <xs:annotation> | ||
| 191 | <xs:documentation> | ||
| 192 | When set to "yes", WixStdBA will load the DLL and work with it to handle BA messages. | ||
| 193 | </xs:documentation> | ||
| 194 | <xs:appinfo> | ||
| 195 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Payload" /> | ||
| 196 | </xs:appinfo> | ||
| 197 | </xs:annotation> | ||
| 198 | </xs:attribute> | ||
| 199 | |||
| 200 | <xs:attribute name="Overridable" type="YesNoType"> | ||
| 201 | <xs:annotation> | ||
| 202 | <xs:documentation> | ||
| 203 | When set to "yes", lets the user override the variable's default value by specifying another value on the command line, | ||
| 204 | in the form Variable=Value. Otherwise, WixStdBA won't overwrite the default value and will log | ||
| 205 | "Ignoring attempt to set non-overridable variable: 'BAR'." | ||
| 206 | </xs:documentation> | ||
| 207 | <xs:appinfo> | ||
| 208 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="Variable" /> | ||
| 209 | </xs:appinfo> | ||
| 210 | </xs:annotation> | ||
| 211 | </xs:attribute> | ||
| 212 | |||
| 213 | <xs:attribute name="PrereqLicenseFile" type="xs:string"> | ||
| 214 | <xs:annotation> | ||
| 215 | <xs:documentation> | ||
| 216 | Source file of the RTF license file. | ||
| 217 | There may only be one package in the bundle that has either the PrereqLicenseFile attribute or the PrereqLicenseUrl attribute. | ||
| 218 | </xs:documentation> | ||
| 219 | <xs:appinfo> | ||
| 220 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="ExePackage" /> | ||
| 221 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="MsiPackage" /> | ||
| 222 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="MspPackage" /> | ||
| 223 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="MsuPackage" /> | ||
| 224 | </xs:appinfo> | ||
| 225 | </xs:annotation> | ||
| 226 | </xs:attribute> | ||
| 227 | |||
| 228 | <xs:attribute name="PrereqLicenseUrl" type="xs:string"> | ||
| 229 | <xs:annotation> | ||
| 230 | <xs:documentation> | ||
| 231 | URL target of the license link. | ||
| 232 | There may only be one package in the bundle that has either the PrereqLicenseFile attribute or the PrereqLicenseUrl attribute. | ||
| 233 | </xs:documentation> | ||
| 234 | <xs:appinfo> | ||
| 235 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="ExePackage" /> | ||
| 236 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="MsiPackage" /> | ||
| 237 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="MspPackage" /> | ||
| 238 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="MsuPackage" /> | ||
| 239 | </xs:appinfo> | ||
| 240 | </xs:annotation> | ||
| 241 | </xs:attribute> | ||
| 242 | |||
| 243 | <xs:attribute name="PrereqPackage" type="YesNoType"> | ||
| 244 | <xs:annotation> | ||
| 245 | <xs:documentation> | ||
| 246 | When set to "yes", the Prereq BA will plan the package to be installed if its InstallCondition is "true" or empty. | ||
| 247 | </xs:documentation> | ||
| 248 | <xs:appinfo> | ||
| 249 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="ExePackage" /> | ||
| 250 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="MsiPackage" /> | ||
| 251 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="MspPackage" /> | ||
| 252 | <xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="MsuPackage" /> | ||
| 253 | </xs:appinfo> | ||
| 254 | </xs:annotation> | ||
| 255 | </xs:attribute> | ||
| 256 | |||
| 257 | <xs:simpleType name="YesNoType"> | ||
| 258 | <xs:annotation> | ||
| 259 | <xs:documentation>Values of this type will either be "yes" or "no".</xs:documentation> | ||
| 260 | </xs:annotation> | ||
| 261 | <xs:restriction base="xs:NMTOKEN"> | ||
| 262 | <xs:enumeration value="no"/> | ||
| 263 | <xs:enumeration value="yes"/> | ||
| 264 | </xs:restriction> | ||
| 265 | </xs:simpleType> | ||
| 266 | </xs:schema> | ||
diff --git a/src/wixext/messages.xml b/src/wixext/messages.xml new file mode 100644 index 00000000..9b11981d --- /dev/null +++ b/src/wixext/messages.xml | |||
| @@ -0,0 +1,43 @@ | |||
| 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="BalErrors" ContainerName="BalErrorEventArgs" BaseContainerName="MessageEventArgs" Level="Error"> | ||
| 7 | <Message Id="AttributeRequiresPrereqPackage" Number="6801"> | ||
| 8 | <Instance> | ||
| 9 | When the {0}/@{1} attribute is specified, the {0}/@PrereqPackage attribute must be set to "yes". | ||
| 10 | <Parameter Type="System.String" Name="elementName" /> | ||
| 11 | <Parameter Type="System.String" Name="attributeName" /> | ||
| 12 | </Instance> | ||
| 13 | </Message> | ||
| 14 | <Message Id="MissingPrereq" Number="6802" SourceLineNumbers="no"> | ||
| 15 | <Instance> | ||
| 16 | There must be at least one PrereqPackage when using the ManagedBootstrapperApplicationHost. | ||
| 17 | This is typically done by using the WixNetFxExtension and referencing one of the NetFxAsPrereq package groups. | ||
| 18 | </Instance> | ||
| 19 | </Message> | ||
| 20 | <Message Id="MultiplePrereqLicenses" Number="6803"> | ||
| 21 | <Instance> | ||
| 22 | There may only be one package in the bundle that has either the PrereqLicenseFile attribute or the PrereqLicenseUrl attribute. | ||
| 23 | </Instance> | ||
| 24 | </Message> | ||
| 25 | <Message Id="MultipleBAFunctions" Number="6804"> | ||
| 26 | <Instance> | ||
| 27 | WixStandardBootstrapperApplication doesn't support multiple BAFunctions DLLs. | ||
| 28 | </Instance> | ||
| 29 | </Message> | ||
| 30 | <Message Id="BAFunctionsPayloadRequiredInUXContainer" Number="6805"> | ||
| 31 | <Instance> | ||
| 32 | The BAFunctions DLL Payload element must be located inside the BootstrapperApplication container. | ||
| 33 | </Instance> | ||
| 34 | </Message> | ||
| 35 | </Class> | ||
| 36 | <Class Name="BalWarnings" ContainerName="BalWarningEventArgs" BaseContainerName="MessageEventArgs" Level="Warning"> | ||
| 37 | <Message Id="UnmarkedBAFunctionsDLL" Number="6501"> | ||
| 38 | <Instance> | ||
| 39 | WixStandardBootstrapperApplication doesn't automatically load BAFunctions.dll. Use the bal:BAFunctions attribute to indicate that it should be loaded. | ||
| 40 | </Instance> | ||
| 41 | </Message> | ||
| 42 | </Class> | ||
| 43 | </Messages> | ||
diff --git a/src/wixext/tables.xml b/src/wixext/tables.xml new file mode 100644 index 00000000..18abf1d7 --- /dev/null +++ b/src/wixext/tables.xml | |||
| @@ -0,0 +1,41 @@ | |||
| 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="WixBalBAFunctions" bootstrapperApplicationData="yes"> | ||
| 7 | <columnDefinition name="PayloadId" type="string" length="0" nullable="yes" category="identifier" primaryKey="yes" | ||
| 8 | keyTable="WixPayloadProperties" keyColumn="1" description="Reference to a payload entry in the WixPayloadProperties table." /> | ||
| 9 | </tableDefinition> | ||
| 10 | <tableDefinition name="WixBalCondition" bootstrapperApplicationData="yes"> | ||
| 11 | <columnDefinition name="Condition" type="string" length="255" primaryKey="yes" localizable="yes" | ||
| 12 | category="condition" description="Expression which must evaluate to TRUE in order for install to commence." /> | ||
| 13 | <columnDefinition name="Message" type="localized" length="255" escapeIdtCharacters="yes" | ||
| 14 | category="formatted" description="Localizable text to display when condition fails and install must abort." /> | ||
| 15 | </tableDefinition> | ||
| 16 | |||
| 17 | <tableDefinition name="WixMbaPrereqInformation" bootstrapperApplicationData="yes"> | ||
| 18 | <columnDefinition name="PackageId" type="string" length="72" primaryKey="yes" | ||
| 19 | category="identifier" description="PackageId for the Prereq BA to conditionally install." /> | ||
| 20 | <columnDefinition name="LicenseFile" type="string" length="0" category="formatted" /> | ||
| 21 | <columnDefinition name="LicenseUrl" type="string" length="0" category="formatted" /> | ||
| 22 | </tableDefinition> | ||
| 23 | |||
| 24 | <tableDefinition name="WixStdbaOptions" bootstrapperApplicationData="yes"> | ||
| 25 | <columnDefinition name="SuppressOptionsUI" type="number" length="2" nullable="yes" | ||
| 26 | maxValue="1" description="If 1, don't show Options button during install." /> | ||
| 27 | <columnDefinition name="SuppressDowngradeFailure" type="number" length="2" nullable="yes" | ||
| 28 | maxValue="1" description="If 1, attempts to downgrade are treated as a successful no-op." /> | ||
| 29 | <columnDefinition name="SuppressRepair" type="number" length="2" nullable="yes" | ||
| 30 | maxValue="1" description="If 1, don't show Repair button during maintenance." /> | ||
| 31 | <columnDefinition name="ShowVersion" type="number" length="2" nullable="yes" | ||
| 32 | maxValue="1" description="If 1, show the version number on the UI." /> | ||
| 33 | <columnDefinition name="SupportCacheOnly" type="number" length="2" nullable="yes" | ||
| 34 | maxValue="1" description="If 1, the bundle can be pre-cached using the /cache command line argument."/> | ||
| 35 | </tableDefinition> | ||
| 36 | |||
| 37 | <tableDefinition name="WixStdbaOverridableVariable" bootstrapperApplicationData="yes"> | ||
| 38 | <columnDefinition name="Name" type="string" length="255" primaryKey="yes" | ||
| 39 | category="identifier" description="Variable name user can override." /> | ||
| 40 | </tableDefinition> | ||
| 41 | </tableDefinitions> | ||
