aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-07-21 15:45:16 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-07-21 17:06:01 -0500
commit0fcd544b7d2fbdf37227df055122b17428d9a524 (patch)
tree02edc0006c8f11ce960174c562e9e9c0f63ccfdf /src/api
parent913b6238417dceeb8440315e4669990756d17655 (diff)
downloadwix-0fcd544b7d2fbdf37227df055122b17428d9a524.tar.gz
wix-0fcd544b7d2fbdf37227df055122b17428d9a524.tar.bz2
wix-0fcd544b7d2fbdf37227df055122b17428d9a524.zip
Expose and use methods to parse attributes with Burn variable names.
Fixes 6819
Diffstat (limited to 'src/api')
-rw-r--r--src/api/wix/WixToolset.Data/ErrorMessages.cs5
-rw-r--r--src/api/wix/WixToolset.Data/Symbols/WixBundleVariableSymbol.cs17
-rw-r--r--src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs3
-rw-r--r--src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs16
4 files changed, 40 insertions, 1 deletions
diff --git a/src/api/wix/WixToolset.Data/ErrorMessages.cs b/src/api/wix/WixToolset.Data/ErrorMessages.cs
index c28812f7..4826e7c9 100644
--- a/src/api/wix/WixToolset.Data/ErrorMessages.cs
+++ b/src/api/wix/WixToolset.Data/ErrorMessages.cs
@@ -1804,6 +1804,11 @@ namespace WixToolset.Data
1804 return Message(sourceLineNumbers, Ids.RelativePathForRegistryElement, "Cannot convert RelativePath into Registry elements."); 1804 return Message(sourceLineNumbers, Ids.RelativePathForRegistryElement, "Cannot convert RelativePath into Registry elements.");
1805 } 1805 }
1806 1806
1807 public static Message ReservedBurnNamespaceViolation(SourceLineNumber sourceLineNumbers, string element, string attribute, string prefix)
1808 {
1809 return Message(sourceLineNumbers, Ids.ReservedNamespaceViolation, "The {0}/@{1} attribute's value begins with the reserved prefix '{2}'. Some prefixes are reserved by the WiX toolset for well-known values. Change your attribute's value to not begin with the same prefix.", element, attribute, prefix);
1810 }
1811
1807 public static Message ReservedNamespaceViolation(SourceLineNumber sourceLineNumbers, string element, string attribute, string prefix) 1812 public static Message ReservedNamespaceViolation(SourceLineNumber sourceLineNumbers, string element, string attribute, string prefix)
1808 { 1813 {
1809 return Message(sourceLineNumbers, Ids.ReservedNamespaceViolation, "The {0}/@{1} attribute's value begins with the reserved prefix '{2}'. Some prefixes are reserved by the Windows Installer and WiX toolset for well-known values. Change your attribute's value to not begin with the same prefix.", element, attribute, prefix); 1814 return Message(sourceLineNumbers, Ids.ReservedNamespaceViolation, "The {0}/@{1} attribute's value begins with the reserved prefix '{2}'. Some prefixes are reserved by the Windows Installer and WiX toolset for well-known values. Change your attribute's value to not begin with the same prefix.", element, attribute, prefix);
diff --git a/src/api/wix/WixToolset.Data/Symbols/WixBundleVariableSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/WixBundleVariableSymbol.cs
index b8a1923d..ea49da8d 100644
--- a/src/api/wix/WixToolset.Data/Symbols/WixBundleVariableSymbol.cs
+++ b/src/api/wix/WixToolset.Data/Symbols/WixBundleVariableSymbol.cs
@@ -35,6 +35,7 @@ namespace WixToolset.Data.Symbols
35 None = 0x0, 35 None = 0x0,
36 Hidden = 0x1, 36 Hidden = 0x1,
37 Persisted = 0x2, 37 Persisted = 0x2,
38 BuiltIn = 0x4,
38 } 39 }
39 40
40 public enum WixBundleVariableType 41 public enum WixBundleVariableType
@@ -107,5 +108,21 @@ namespace WixToolset.Data.Symbols
107 } 108 }
108 } 109 }
109 } 110 }
111
112 public bool BuiltIn
113 {
114 get { return this.Attributes.HasFlag(WixBundleVariableAttributes.BuiltIn); }
115 set
116 {
117 if (value)
118 {
119 this.Attributes |= WixBundleVariableAttributes.BuiltIn;
120 }
121 else
122 {
123 this.Attributes &= ~WixBundleVariableAttributes.BuiltIn;
124 }
125 }
126 }
110 } 127 }
111} 128}
diff --git a/src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs b/src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs
index fc88a443..43f65fc8 100644
--- a/src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs
+++ b/src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs
@@ -39,8 +39,9 @@ namespace WixToolset.Extensibility.Services
39 /// <param name="elementName"></param> 39 /// <param name="elementName"></param>
40 /// <param name="attributeName"></param> 40 /// <param name="attributeName"></param>
41 /// <param name="variableName"></param> 41 /// <param name="variableName"></param>
42 /// <param name="allowBuiltIn">Whether to bypass checks for reserved values.</param>
42 /// <returns>Whether the name is valid.</returns> 43 /// <returns>Whether the name is valid.</returns>
43 bool ValidateBundleVariableName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string variableName); 44 bool ValidateBundleVariableName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string variableName, bool allowBuiltIn);
44 45
45 /// <summary> 46 /// <summary>
46 /// Validates a bundle condition and displays an error for an illegal value. 47 /// Validates a bundle condition and displays an error for an illegal value.
diff --git a/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs b/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs
index 546a43a7..a8246b9b 100644
--- a/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs
+++ b/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs
@@ -234,6 +234,22 @@ namespace WixToolset.Extensibility.Services
234 string GetAttributeValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, EmptyRule emptyRule = EmptyRule.CanBeWhitespaceOnly); 234 string GetAttributeValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, EmptyRule emptyRule = EmptyRule.CanBeWhitespaceOnly);
235 235
236 /// <summary> 236 /// <summary>
237 /// Gets a bundle variable name identifier and displays an error for an illegal value.
238 /// </summary>
239 /// <param name="sourceLineNumbers">Source line information about the owner element.</param>
240 /// <param name="attribute">The attribute containing the value to get.</param>
241 /// <returns>The attribute's identifier value or a special value if an error occurred.</returns>
242 Identifier GetAttributeBundleVariableNameIdentifier(SourceLineNumber sourceLineNumbers, XAttribute attribute);
243
244 /// <summary>
245 /// Gets a bundle variable name value and displays an error for an illegal value.
246 /// </summary>
247 /// <param name="sourceLineNumbers">Source line information about the owner element.</param>
248 /// <param name="attribute">The attribute containing the value to get.</param>
249 /// <returns>The attribute's value.</returns>
250 string GetAttributeBundleVariableNameValue(SourceLineNumber sourceLineNumbers, XAttribute attribute);
251
252 /// <summary>
237 /// Get a guid attribute value and displays an error for an illegal guid value. 253 /// Get a guid attribute value and displays an error for an illegal guid value.
238 /// </summary> 254 /// </summary>
239 /// <param name="sourceLineNumbers">Source line information about the owner element.</param> 255 /// <param name="sourceLineNumbers">Source line information about the owner element.</param>