diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2022-09-09 16:03:29 -0500 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2022-09-09 21:14:27 -0500 |
| commit | a1307cd4e76a89598c53cb68309358a7012db553 (patch) | |
| tree | f79cf181b49f0b754afcd4ec25487bf2b284d45e /src/ext | |
| parent | f61479585d865372645cb18c982aa708dd975da3 (diff) | |
| download | wix-a1307cd4e76a89598c53cb68309358a7012db553.tar.gz wix-a1307cd4e76a89598c53cb68309358a7012db553.tar.bz2 wix-a1307cd4e76a89598c53cb68309358a7012db553.zip | |
Move `Bundle/@CommandLineVariables` into Bal.wixext.
Implements 6858
Diffstat (limited to 'src/ext')
8 files changed, 150 insertions, 11 deletions
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs b/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs index 79e96316..63b9b4a8 100644 --- a/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs +++ b/src/ext/Bal/test/WixToolsetTest.Bal/BalExtensionFixture.cs | |||
| @@ -78,6 +78,12 @@ namespace WixToolsetTest.Bal | |||
| 78 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); | 78 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundleFile, baFolderPath, extractFolderPath); |
| 79 | extractResult.AssertSuccess(); | 79 | extractResult.AssertSuccess(); |
| 80 | 80 | ||
| 81 | var balCommandLines = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixStdbaCommandLine"); | ||
| 82 | WixAssert.CompareLineByLine(new[] | ||
| 83 | { | ||
| 84 | "<WixStdbaCommandLine VariableType='caseInsensitive' />", | ||
| 85 | }, balCommandLines); | ||
| 86 | |||
| 81 | var balOverridableVariables = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixStdbaOverridableVariable"); | 87 | var balOverridableVariables = extractResult.GetBADataTestXmlLines("/ba:BootstrapperApplicationData/ba:WixStdbaOverridableVariable"); |
| 82 | WixAssert.CompareLineByLine(new[] | 88 | WixAssert.CompareLineByLine(new[] |
| 83 | { | 89 | { |
| @@ -209,8 +215,9 @@ namespace WixToolsetTest.Bal | |||
| 209 | WixAssert.CompareLineByLine(new[] | 215 | WixAssert.CompareLineByLine(new[] |
| 210 | { | 216 | { |
| 211 | "bal:Condition/@Condition contains the built-in Variable 'WixBundleAction', which is not available when it is evaluated. (Unavailable Variables are: 'WixBundleAction'.). Rewrite the condition to avoid Variables that are never valid during its evaluation.", | 217 | "bal:Condition/@Condition contains the built-in Variable 'WixBundleAction', which is not available when it is evaluated. (Unavailable Variables are: 'WixBundleAction'.). Rewrite the condition to avoid Variables that are never valid during its evaluation.", |
| 212 | "Overridable variable 'Test1' must be 'TEST1' with Bundle/@CommandLineVariables value 'upperCase'.", | 218 | "Overridable variable 'TEST1' collides with 'Test1' with Bundle/@CommandLineVariables value 'caseInsensitive'.", |
| 213 | "The *Package/@bal:DisplayInternalUICondition attribute's value '=' is not a valid bundle condition.", | 219 | "The *Package/@bal:DisplayInternalUICondition attribute's value '=' is not a valid bundle condition.", |
| 220 | "The location of the Variable related to the previous error.", | ||
| 214 | }, messages.ToArray()); | 221 | }, messages.ToArray()); |
| 215 | } | 222 | } |
| 216 | } | 223 | } |
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/TestData/Overridable/Bundle.wxs b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/Overridable/Bundle.wxs index 83e0d5b0..1274826f 100644 --- a/src/ext/Bal/test/WixToolsetTest.Bal/TestData/Overridable/Bundle.wxs +++ b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/Overridable/Bundle.wxs | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" |
| 3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
| 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2"> | 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2" bal:CommandLineVariables="caseInsensitive"> |
| 5 | <BootstrapperApplication> | 5 | <BootstrapperApplication> |
| 6 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> | 6 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> |
| 7 | </BootstrapperApplication> | 7 | </BootstrapperApplication> |
diff --git a/src/ext/Bal/test/WixToolsetTest.Bal/TestData/Overridable/WrongCaseBundle.wxs b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/Overridable/WrongCaseBundle.wxs index 547af644..67dfc589 100644 --- a/src/ext/Bal/test/WixToolsetTest.Bal/TestData/Overridable/WrongCaseBundle.wxs +++ b/src/ext/Bal/test/WixToolsetTest.Bal/TestData/Overridable/WrongCaseBundle.wxs | |||
| @@ -1,11 +1,12 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" |
| 3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> | 3 | xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"> |
| 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2"> | 4 | <Bundle Name="WixStdBa" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="75D5D534-E177-4689-AAE9-CAC1C39002C2" bal:CommandLineVariables="caseInsensitive"> |
| 5 | <BootstrapperApplication> | 5 | <BootstrapperApplication> |
| 6 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> | 6 | <bal:WixStandardBootstrapperApplication LicenseUrl="http://wixtoolset.org/about/license/" Theme="hyperlinkLicense" /> |
| 7 | </BootstrapperApplication> | 7 | </BootstrapperApplication> |
| 8 | <Variable Name="Test1" bal:Overridable="yes" /> | 8 | <Variable Name="Test1" bal:Overridable="yes" /> |
| 9 | <Variable Name="TEST1" bal:Overridable="yes" /> | ||
| 9 | <Chain> | 10 | <Chain> |
| 10 | <ExePackage Permanent="yes" DetectCondition="none" SourceFile="runtimes\win-x86\native\wixnative.exe" /> | 11 | <ExePackage Permanent="yes" DetectCondition="none" SourceFile="runtimes\win-x86\native\wixnative.exe" /> |
| 11 | <MsiPackage SourceFile="test.msi" bal:DisplayInternalUICondition="!(loc.NonsensePlanCondition)" /> | 12 | <MsiPackage SourceFile="test.msi" bal:DisplayInternalUICondition="!(loc.NonsensePlanCondition)" /> |
diff --git a/src/ext/Bal/wixext/BalBurnBackendExtension.cs b/src/ext/Bal/wixext/BalBurnBackendExtension.cs index 6f615796..a27ff739 100644 --- a/src/ext/Bal/wixext/BalBurnBackendExtension.cs +++ b/src/ext/Bal/wixext/BalBurnBackendExtension.cs | |||
| @@ -24,6 +24,7 @@ namespace WixToolset.Bal | |||
| 24 | BalSymbolDefinitions.WixBalPackageInfo, | 24 | BalSymbolDefinitions.WixBalPackageInfo, |
| 25 | BalSymbolDefinitions.WixDncOptions, | 25 | BalSymbolDefinitions.WixDncOptions, |
| 26 | BalSymbolDefinitions.WixMbaPrereqInformation, | 26 | BalSymbolDefinitions.WixMbaPrereqInformation, |
| 27 | BalSymbolDefinitions.WixStdbaCommandLine, | ||
| 27 | BalSymbolDefinitions.WixStdbaOptions, | 28 | BalSymbolDefinitions.WixStdbaOptions, |
| 28 | BalSymbolDefinitions.WixStdbaOverridableVariable, | 29 | BalSymbolDefinitions.WixStdbaOverridableVariable, |
| 29 | BalSymbolDefinitions.WixMbaPrereqOptions, | 30 | BalSymbolDefinitions.WixMbaPrereqOptions, |
| @@ -61,6 +62,30 @@ namespace WixToolset.Bal | |||
| 61 | 62 | ||
| 62 | return true; | 63 | return true; |
| 63 | } | 64 | } |
| 65 | else if (symbol is WixStdbaCommandLineSymbol stdbaCommandLineSymbol) | ||
| 66 | { | ||
| 67 | var sb = new StringBuilder(); | ||
| 68 | using (var writer = XmlWriter.Create(sb)) | ||
| 69 | { | ||
| 70 | writer.WriteStartElement(symbol.Definition.Name, BurnConstants.BootstrapperApplicationDataNamespace); | ||
| 71 | |||
| 72 | switch (stdbaCommandLineSymbol.VariableType) | ||
| 73 | { | ||
| 74 | case WixStdbaCommandLineVariableType.CaseInsensitive: | ||
| 75 | writer.WriteAttributeString("VariableType", "caseInsensitive"); | ||
| 76 | break; | ||
| 77 | default: | ||
| 78 | writer.WriteAttributeString("VariableType", "caseSensitive"); | ||
| 79 | break; | ||
| 80 | } | ||
| 81 | |||
| 82 | writer.WriteEndElement(); | ||
| 83 | } | ||
| 84 | |||
| 85 | this.BackendHelper.AddBootstrapperApplicationData(sb.ToString()); | ||
| 86 | |||
| 87 | return true; | ||
| 88 | } | ||
| 64 | else | 89 | else |
| 65 | { | 90 | { |
| 66 | return base.TryProcessSymbol(section, symbol); | 91 | return base.TryProcessSymbol(section, symbol); |
| @@ -418,19 +443,24 @@ namespace WixToolset.Bal | |||
| 418 | 443 | ||
| 419 | private void VerifyOverridableVariables(IntermediateSection section) | 444 | private void VerifyOverridableVariables(IntermediateSection section) |
| 420 | { | 445 | { |
| 421 | var bundleSymbol = section.Symbols.OfType<WixBundleSymbol>().Single(); | 446 | var commandLineSymbol = section.Symbols.OfType<WixStdbaCommandLineSymbol>().SingleOrDefault(); |
| 422 | if (bundleSymbol.CommandLineVariables != WixBundleCommandLineVariables.UpperCase) | 447 | if (commandLineSymbol?.VariableType != WixStdbaCommandLineVariableType.CaseInsensitive) |
| 423 | { | 448 | { |
| 424 | return; | 449 | return; |
| 425 | } | 450 | } |
| 426 | 451 | ||
| 427 | var overridableVariableSymbols = section.Symbols.OfType<WixStdbaOverridableVariableSymbol>().ToList(); | 452 | var overridableVariableSymbols = section.Symbols.OfType<WixStdbaOverridableVariableSymbol>().ToList(); |
| 453 | var overridableVariables = new Dictionary<string, WixStdbaOverridableVariableSymbol>(StringComparer.InvariantCultureIgnoreCase); | ||
| 428 | foreach (var overridableVariableSymbol in overridableVariableSymbols) | 454 | foreach (var overridableVariableSymbol in overridableVariableSymbols) |
| 429 | { | 455 | { |
| 430 | var upperName = overridableVariableSymbol.Name.ToUpperInvariant(); | 456 | if (!overridableVariables.TryGetValue(overridableVariableSymbol.Name, out var collisionVariableSymbol)) |
| 431 | if (upperName != overridableVariableSymbol.Name) | 457 | { |
| 458 | overridableVariables.Add(overridableVariableSymbol.Name, overridableVariableSymbol); | ||
| 459 | } | ||
| 460 | else | ||
| 432 | { | 461 | { |
| 433 | this.Messaging.Write(BalErrors.NonUpperCaseOverridableVariable(overridableVariableSymbol.SourceLineNumbers, overridableVariableSymbol.Name, upperName)); | 462 | this.Messaging.Write(BalErrors.OverridableVariableCollision(overridableVariableSymbol.SourceLineNumbers, overridableVariableSymbol.Name, collisionVariableSymbol.Name)); |
| 463 | this.Messaging.Write(BalErrors.OverridableVariableCollision2(collisionVariableSymbol.SourceLineNumbers)); | ||
| 434 | } | 464 | } |
| 435 | } | 465 | } |
| 436 | } | 466 | } |
diff --git a/src/ext/Bal/wixext/BalCompiler.cs b/src/ext/Bal/wixext/BalCompiler.cs index bc2ba861..bd2fb4a2 100644 --- a/src/ext/Bal/wixext/BalCompiler.cs +++ b/src/ext/Bal/wixext/BalCompiler.cs | |||
| @@ -119,6 +119,42 @@ namespace WixToolset.Bal | |||
| 119 | 119 | ||
| 120 | switch (parentElement.Name.LocalName) | 120 | switch (parentElement.Name.LocalName) |
| 121 | { | 121 | { |
| 122 | case "Bundle": | ||
| 123 | switch (attribute.Name.LocalName) | ||
| 124 | { | ||
| 125 | case "CommandLineVariables": | ||
| 126 | WixStdbaCommandLineVariableType? variableType = null; | ||
| 127 | |||
| 128 | var commandLineVariablesValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attribute); | ||
| 129 | switch (commandLineVariablesValue) | ||
| 130 | { | ||
| 131 | case "caseInsensitive": | ||
| 132 | variableType = WixStdbaCommandLineVariableType.CaseInsensitive; | ||
| 133 | break; | ||
| 134 | case "caseSensitive": | ||
| 135 | variableType = WixStdbaCommandLineVariableType.CaseSensitive; | ||
| 136 | break; | ||
| 137 | default: | ||
| 138 | this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, parentElement.Name.LocalName, attribute.Name.LocalName, commandLineVariablesValue, "caseInsensitive", "caseSensitive")); | ||
| 139 | break; | ||
| 140 | } | ||
| 141 | |||
| 142 | if (variableType.HasValue) | ||
| 143 | { | ||
| 144 | // There can only be one. | ||
| 145 | var id = new Identifier(AccessModifier.Global, "WixStdbaCommandLineVariableType"); | ||
| 146 | section.AddSymbol(new WixStdbaCommandLineSymbol(sourceLineNumbers, id) | ||
| 147 | { | ||
| 148 | VariableType = variableType.Value, | ||
| 149 | }); | ||
| 150 | } | ||
| 151 | |||
| 152 | break; | ||
| 153 | default: | ||
| 154 | this.ParseHelper.UnexpectedAttribute(parentElement, attribute); | ||
| 155 | break; | ||
| 156 | } | ||
| 157 | break; | ||
| 122 | case "BundlePackage": | 158 | case "BundlePackage": |
| 123 | case "ExePackage": | 159 | case "ExePackage": |
| 124 | case "MsiPackage": | 160 | case "MsiPackage": |
diff --git a/src/ext/Bal/wixext/BalErrors.cs b/src/ext/Bal/wixext/BalErrors.cs index a7a00a4b..cc4c6d41 100644 --- a/src/ext/Bal/wixext/BalErrors.cs +++ b/src/ext/Bal/wixext/BalErrors.cs | |||
| @@ -78,9 +78,14 @@ namespace WixToolset.Bal | |||
| 78 | return Message(sourceLineNumbers, Ids.MultiplePrimaryPackageType2, "The location of the package related to the previous error."); | 78 | return Message(sourceLineNumbers, Ids.MultiplePrimaryPackageType2, "The location of the package related to the previous error."); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | public static Message NonUpperCaseOverridableVariable(SourceLineNumber sourceLineNumbers, string name, string expectedName) | 81 | public static Message OverridableVariableCollision(SourceLineNumber sourceLineNumbers, string name, string collisionName) |
| 82 | { | 82 | { |
| 83 | return Message(sourceLineNumbers, Ids.NonUpperCaseOverridableVariable, "Overridable variable '{0}' must be '{1}' with Bundle/@CommandLineVariables value 'upperCase'.", name, expectedName); | 83 | return Message(sourceLineNumbers, Ids.OverridableVariableCollision, "Overridable variable '{0}' collides with '{1}' with Bundle/@CommandLineVariables value 'caseInsensitive'.", name, collisionName); |
| 84 | } | ||
| 85 | |||
| 86 | public static Message OverridableVariableCollision2(SourceLineNumber sourceLineNumbers) | ||
| 87 | { | ||
| 88 | return Message(sourceLineNumbers, Ids.OverridableVariableCollision2, "The location of the Variable related to the previous error."); | ||
| 84 | } | 89 | } |
| 85 | 90 | ||
| 86 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) | 91 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) |
| @@ -101,7 +106,6 @@ namespace WixToolset.Bal | |||
| 101 | MultipleBAFunctions = 6804, | 106 | MultipleBAFunctions = 6804, |
| 102 | BAFunctionsPayloadRequiredInUXContainer = 6805, | 107 | BAFunctionsPayloadRequiredInUXContainer = 6805, |
| 103 | MissingDNCPrereq = 6806, | 108 | MissingDNCPrereq = 6806, |
| 104 | NonUpperCaseOverridableVariable = 6807, | ||
| 105 | MissingIUIPrimaryPackage = 6808, | 109 | MissingIUIPrimaryPackage = 6808, |
| 106 | MultiplePrimaryPackageType = 6809, | 110 | MultiplePrimaryPackageType = 6809, |
| 107 | MultiplePrimaryPackageType2 = 6810, | 111 | MultiplePrimaryPackageType2 = 6810, |
| @@ -110,6 +114,8 @@ namespace WixToolset.Bal | |||
| 110 | IuibaPermanentPrimaryPackageType = 6813, | 114 | IuibaPermanentPrimaryPackageType = 6813, |
| 111 | IuibaNonMsiPrimaryPackage = 6814, | 115 | IuibaNonMsiPrimaryPackage = 6814, |
| 112 | IuibaPrimaryPackageEnableFeatureSelection = 6815, | 116 | IuibaPrimaryPackageEnableFeatureSelection = 6815, |
| 117 | OverridableVariableCollision = 6816, | ||
| 118 | OverridableVariableCollision2 = 6817, | ||
| 113 | } | 119 | } |
| 114 | } | 120 | } |
| 115 | } | 121 | } |
diff --git a/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs b/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs index 9010ce2d..22375508 100644 --- a/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs +++ b/src/ext/Bal/wixext/Symbols/BalSymbolDefinitions.cs | |||
| @@ -14,6 +14,7 @@ namespace WixToolset.Bal | |||
| 14 | WixBalPackageInfo, | 14 | WixBalPackageInfo, |
| 15 | WixDncOptions, | 15 | WixDncOptions, |
| 16 | WixMbaPrereqInformation, | 16 | WixMbaPrereqInformation, |
| 17 | WixStdbaCommandLine, | ||
| 17 | WixStdbaOptions, | 18 | WixStdbaOptions, |
| 18 | WixStdbaOverridableVariable, | 19 | WixStdbaOverridableVariable, |
| 19 | WixMbaPrereqOptions, | 20 | WixMbaPrereqOptions, |
| @@ -55,6 +56,9 @@ namespace WixToolset.Bal | |||
| 55 | case BalSymbolDefinitionType.WixMbaPrereqInformation: | 56 | case BalSymbolDefinitionType.WixMbaPrereqInformation: |
| 56 | return BalSymbolDefinitions.WixMbaPrereqInformation; | 57 | return BalSymbolDefinitions.WixMbaPrereqInformation; |
| 57 | 58 | ||
| 59 | case BalSymbolDefinitionType.WixStdbaCommandLine: | ||
| 60 | return BalSymbolDefinitions.WixStdbaCommandLine; | ||
| 61 | |||
| 58 | case BalSymbolDefinitionType.WixStdbaOptions: | 62 | case BalSymbolDefinitionType.WixStdbaOptions: |
| 59 | return BalSymbolDefinitions.WixStdbaOptions; | 63 | return BalSymbolDefinitions.WixStdbaOptions; |
| 60 | 64 | ||
| @@ -77,6 +81,7 @@ namespace WixToolset.Bal | |||
| 77 | WixBalPackageInfo.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); | 81 | WixBalPackageInfo.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); |
| 78 | WixDncOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); | 82 | WixDncOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); |
| 79 | WixMbaPrereqInformation.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); | 83 | WixMbaPrereqInformation.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); |
| 84 | WixStdbaCommandLine.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); | ||
| 80 | WixStdbaOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); | 85 | WixStdbaOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); |
| 81 | WixStdbaOverridableVariable.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); | 86 | WixStdbaOverridableVariable.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); |
| 82 | WixMbaPrereqOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); | 87 | WixMbaPrereqOptions.AddTag(BurnConstants.BootstrapperApplicationDataSymbolDefinitionTag); |
diff --git a/src/ext/Bal/wixext/Symbols/WixStdbaCommandLineSymbol.cs b/src/ext/Bal/wixext/Symbols/WixStdbaCommandLineSymbol.cs new file mode 100644 index 00000000..3b3823f3 --- /dev/null +++ b/src/ext/Bal/wixext/Symbols/WixStdbaCommandLineSymbol.cs | |||
| @@ -0,0 +1,54 @@ | |||
| 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.Bal | ||
| 4 | { | ||
| 5 | using WixToolset.Data; | ||
| 6 | using WixToolset.Bal.Symbols; | ||
| 7 | |||
| 8 | public static partial class BalSymbolDefinitions | ||
| 9 | { | ||
| 10 | public static readonly IntermediateSymbolDefinition WixStdbaCommandLine = new IntermediateSymbolDefinition( | ||
| 11 | BalSymbolDefinitionType.WixStdbaCommandLine.ToString(), | ||
| 12 | new[] | ||
| 13 | { | ||
| 14 | new IntermediateFieldDefinition(nameof(WixStdbaCommandLineSymbolFields.VariableType), IntermediateFieldType.Number), | ||
| 15 | }, | ||
| 16 | typeof(WixStdbaCommandLineSymbol)); | ||
| 17 | } | ||
| 18 | } | ||
| 19 | |||
| 20 | namespace WixToolset.Bal.Symbols | ||
| 21 | { | ||
| 22 | using System; | ||
| 23 | using WixToolset.Data; | ||
| 24 | |||
| 25 | public enum WixStdbaCommandLineSymbolFields | ||
| 26 | { | ||
| 27 | VariableType, | ||
| 28 | } | ||
| 29 | |||
| 30 | public enum WixStdbaCommandLineVariableType | ||
| 31 | { | ||
| 32 | CaseSensitive, | ||
| 33 | CaseInsensitive, | ||
| 34 | } | ||
| 35 | |||
| 36 | public class WixStdbaCommandLineSymbol : IntermediateSymbol | ||
| 37 | { | ||
| 38 | public WixStdbaCommandLineSymbol() : base(BalSymbolDefinitions.WixStdbaCommandLine, null, null) | ||
| 39 | { | ||
| 40 | } | ||
| 41 | |||
| 42 | public WixStdbaCommandLineSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(BalSymbolDefinitions.WixStdbaCommandLine, sourceLineNumber, id) | ||
| 43 | { | ||
| 44 | } | ||
| 45 | |||
| 46 | public IntermediateField this[WixStdbaCommandLineSymbolFields index] => this.Fields[(int)index]; | ||
| 47 | |||
| 48 | public WixStdbaCommandLineVariableType VariableType | ||
| 49 | { | ||
| 50 | get => (WixStdbaCommandLineVariableType)this.Fields[(int)WixStdbaCommandLineSymbolFields.VariableType].AsNumber(); | ||
| 51 | set => this.Set((int)WixStdbaCommandLineSymbolFields.VariableType, (int)value); | ||
| 52 | } | ||
| 53 | } | ||
| 54 | } | ||
