diff options
Diffstat (limited to 'src/api')
7 files changed, 105 insertions, 24 deletions
diff --git a/src/api/wix/WixToolset.Data/ErrorMessages.cs b/src/api/wix/WixToolset.Data/ErrorMessages.cs index 80738f5e..a833452d 100644 --- a/src/api/wix/WixToolset.Data/ErrorMessages.cs +++ b/src/api/wix/WixToolset.Data/ErrorMessages.cs | |||
@@ -1184,6 +1184,11 @@ namespace WixToolset.Data | |||
1184 | return Message(null, Ids.InvalidCommandLineFileName, "Invalid file name specified on the command line: '{0}'. Error message: '{1}'", fileName, error); | 1184 | return Message(null, Ids.InvalidCommandLineFileName, "Invalid file name specified on the command line: '{0}'. Error message: '{1}'", fileName, error); |
1185 | } | 1185 | } |
1186 | 1186 | ||
1187 | public static Message InvalidBundleCondition(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string condition) | ||
1188 | { | ||
1189 | return Message(sourceLineNumbers, Ids.InvalidBundleCondition, "The {0}/@{1} attribute's value '{2}' is not a valid bundle condition.", elementName, attributeName, condition); | ||
1190 | } | ||
1191 | |||
1187 | public static Message InvalidDateTimeFormat(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) | 1192 | public static Message InvalidDateTimeFormat(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) |
1188 | { | 1193 | { |
1189 | return Message(sourceLineNumbers, Ids.InvalidDateTimeFormat, "The {0}/@{1} attribute's value '{2}' is not a valid date/time value. A date/time value should follow the format YYYY-MM-DDTHH:mm:ss.", elementName, attributeName, value); | 1194 | return Message(sourceLineNumbers, Ids.InvalidDateTimeFormat, "The {0}/@{1} attribute's value '{2}' is not a valid date/time value. A date/time value should follow the format YYYY-MM-DDTHH:mm:ss.", elementName, attributeName, value); |
@@ -2686,6 +2691,7 @@ namespace WixToolset.Data | |||
2686 | MultiplePackagePayloads3 = 406, | 2691 | MultiplePackagePayloads3 = 406, |
2687 | MissingPackagePayload = 407, | 2692 | MissingPackagePayload = 407, |
2688 | ExpectedAttributeWithoutOtherAttributes = 408, | 2693 | ExpectedAttributeWithoutOtherAttributes = 408, |
2694 | InvalidBundleCondition = 409, | ||
2689 | } | 2695 | } |
2690 | } | 2696 | } |
2691 | } | 2697 | } |
diff --git a/src/api/wix/WixToolset.Data/WarningMessages.cs b/src/api/wix/WixToolset.Data/WarningMessages.cs index b749bcf4..f555fd93 100644 --- a/src/api/wix/WixToolset.Data/WarningMessages.cs +++ b/src/api/wix/WixToolset.Data/WarningMessages.cs | |||
@@ -593,6 +593,11 @@ namespace WixToolset.Data | |||
593 | return Message(null, Ids.UnableToResetAcls, "Unable to reset acls on destination files. Exception detail: {0}", error); | 593 | return Message(null, Ids.UnableToResetAcls, "Unable to reset acls on destination files. Exception detail: {0}", error); |
594 | } | 594 | } |
595 | 595 | ||
596 | public static Message UnavailableBundleConditionVariable(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string variable, string illegalValueList) | ||
597 | { | ||
598 | return Message(sourceLineNumbers, Ids.UnavailableBundleConditionVariable, "{0}/@{1} contains the built-in Variable '{2}', which is not available when it is evaluated. (Unavailable Variables are: {3}.). Rewrite the condition to avoid Variables that are never valid during its evaluation.", elementName, attributeName, variable, illegalValueList); | ||
599 | } | ||
600 | |||
596 | public static Message UnclearShortcut(SourceLineNumber sourceLineNumbers, string shortcutId, string fileId, string componentId) | 601 | public static Message UnclearShortcut(SourceLineNumber sourceLineNumbers, string shortcutId, string fileId, string componentId) |
597 | { | 602 | { |
598 | return Message(sourceLineNumbers, Ids.UnclearShortcut, "Because it is an advertised shortcut, the target of shortcut '{0}' will be the keypath of component '{2}' rather than parent file '{1}'. To eliminate this warning, you can (1) make the Shortcut element a child of the File element that is the keypath of component '{2}', (2) make file '{1}' the keypath of component '{2}', or (3) remove the @Advertise attribute so the shortcut is a non-advertised shortcut.", shortcutId, fileId, componentId); | 603 | return Message(sourceLineNumbers, Ids.UnclearShortcut, "Because it is an advertised shortcut, the target of shortcut '{0}' will be the keypath of component '{2}' rather than parent file '{1}'. To eliminate this warning, you can (1) make the Shortcut element a child of the File element that is the keypath of component '{2}', (2) make file '{1}' the keypath of component '{2}', or (3) remove the @Advertise attribute so the shortcut is a non-advertised shortcut.", shortcutId, fileId, componentId); |
@@ -804,6 +809,7 @@ namespace WixToolset.Data | |||
804 | DetectConditionRecommended = 1153, | 809 | DetectConditionRecommended = 1153, |
805 | CollidingModularizationTypes = 1156, | 810 | CollidingModularizationTypes = 1156, |
806 | InvalidEnvironmentVariable = 1157, | 811 | InvalidEnvironmentVariable = 1157, |
812 | UnavailableBundleConditionVariable = 1159, | ||
807 | } | 813 | } |
808 | } | 814 | } |
809 | } | 815 | } |
diff --git a/src/api/wix/WixToolset.Extensibility/Data/BundleConditionPhase.cs b/src/api/wix/WixToolset.Extensibility/Data/BundleConditionPhase.cs new file mode 100644 index 00000000..6d876bcc --- /dev/null +++ b/src/api/wix/WixToolset.Extensibility/Data/BundleConditionPhase.cs | |||
@@ -0,0 +1,35 @@ | |||
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.Extensibility.Data | ||
4 | { | ||
5 | /// <summary> | ||
6 | /// The Burn execution phase during which a Condition will be evaluated. | ||
7 | /// </summary> | ||
8 | public enum BundleConditionPhase | ||
9 | { | ||
10 | /// <summary> | ||
11 | /// Condition is evaluated by the engine before loading the BootstrapperApplication (Bundle/@Condition). | ||
12 | /// </summary> | ||
13 | Startup, | ||
14 | |||
15 | /// <summary> | ||
16 | /// Condition is evaluated during Detect (ExePackage/@DetectCondition). | ||
17 | /// </summary> | ||
18 | Detect, | ||
19 | |||
20 | /// <summary> | ||
21 | /// Condition is evaluated during Plan (ExePackage/@InstallCondition). | ||
22 | /// </summary> | ||
23 | Plan, | ||
24 | |||
25 | /// <summary> | ||
26 | /// Condition is evaluated during Apply (MsiProperty/@Condition). | ||
27 | /// </summary> | ||
28 | Execute, | ||
29 | |||
30 | /// <summary> | ||
31 | /// Condition is evaluated after Apply. | ||
32 | /// </summary> | ||
33 | Shutdown, | ||
34 | } | ||
35 | } | ||
diff --git a/src/api/wix/WixToolset.Extensibility/Services/IBackendHelper.cs b/src/api/wix/WixToolset.Extensibility/Services/IBackendHelper.cs index 29b8f8e6..23ad44f5 100644 --- a/src/api/wix/WixToolset.Extensibility/Services/IBackendHelper.cs +++ b/src/api/wix/WixToolset.Extensibility/Services/IBackendHelper.cs | |||
@@ -74,17 +74,6 @@ namespace WixToolset.Extensibility.Services | |||
74 | string GenerateIdentifier(string prefix, params string[] args); | 74 | string GenerateIdentifier(string prefix, params string[] args); |
75 | 75 | ||
76 | /// <summary> | 76 | /// <summary> |
77 | /// Validates path is relative and canonicalizes it. | ||
78 | /// For example, "a\..\c\.\d.exe" => "c\d.exe". | ||
79 | /// </summary> | ||
80 | /// <param name="sourceLineNumbers"></param> | ||
81 | /// <param name="elementName"></param> | ||
82 | /// <param name="attributeName"></param> | ||
83 | /// <param name="relativePath"></param> | ||
84 | /// <returns>The original value if not relative, otherwise the canonicalized relative path.</returns> | ||
85 | string GetCanonicalRelativePath(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string relativePath); | ||
86 | |||
87 | /// <summary> | ||
88 | /// Gets a valid code page from the given web name or integer value. | 77 | /// Gets a valid code page from the given web name or integer value. |
89 | /// </summary> | 78 | /// </summary> |
90 | /// <param name="value">A code page web name or integer value as a string.</param> | 79 | /// <param name="value">A code page web name or integer value as a string.</param> |
diff --git a/src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs b/src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs new file mode 100644 index 00000000..fc88a443 --- /dev/null +++ b/src/api/wix/WixToolset.Extensibility/Services/IBundleValidator.cs | |||
@@ -0,0 +1,56 @@ | |||
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.Extensibility.Services | ||
4 | { | ||
5 | using WixToolset.Data; | ||
6 | using WixToolset.Extensibility.Data; | ||
7 | |||
8 | /// <summary> | ||
9 | /// Interface provided to help with bundle validation. | ||
10 | /// </summary> | ||
11 | public interface IBundleValidator | ||
12 | { | ||
13 | |||
14 | /// <summary> | ||
15 | /// Validates path is relative and canonicalizes it. | ||
16 | /// For example, "a\..\c\.\d.exe" => "c\d.exe". | ||
17 | /// </summary> | ||
18 | /// <param name="sourceLineNumbers"></param> | ||
19 | /// <param name="elementName"></param> | ||
20 | /// <param name="attributeName"></param> | ||
21 | /// <param name="relativePath"></param> | ||
22 | /// <returns>The original value if not relative, otherwise the canonicalized relative path.</returns> | ||
23 | string GetCanonicalRelativePath(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string relativePath); | ||
24 | |||
25 | /// <summary> | ||
26 | /// Validates an MsiProperty name value and displays an error for an illegal value. | ||
27 | /// </summary> | ||
28 | /// <param name="sourceLineNumbers"></param> | ||
29 | /// <param name="elementName"></param> | ||
30 | /// <param name="attributeName"></param> | ||
31 | /// <param name="propertyName"></param> | ||
32 | /// <returns>Whether the name is valid.</returns> | ||
33 | bool ValidateBundleMsiPropertyName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string propertyName); | ||
34 | |||
35 | /// <summary> | ||
36 | /// Validates a Bundle variable name and displays an error for an illegal value. | ||
37 | /// </summary> | ||
38 | /// <param name="sourceLineNumbers"></param> | ||
39 | /// <param name="elementName"></param> | ||
40 | /// <param name="attributeName"></param> | ||
41 | /// <param name="variableName"></param> | ||
42 | /// <returns>Whether the name is valid.</returns> | ||
43 | bool ValidateBundleVariableName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string variableName); | ||
44 | |||
45 | /// <summary> | ||
46 | /// Validates a bundle condition and displays an error for an illegal value. | ||
47 | /// </summary> | ||
48 | /// <param name="sourceLineNumbers"></param> | ||
49 | /// <param name="elementName"></param> | ||
50 | /// <param name="attributeName"></param> | ||
51 | /// <param name="condition"></param> | ||
52 | /// <param name="phase"></param> | ||
53 | /// <returns>Whether the condition is valid.</returns> | ||
54 | bool ValidateBundleCondition(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string condition, BundleConditionPhase phase); | ||
55 | } | ||
56 | } | ||
diff --git a/src/api/wix/WixToolset.Extensibility/Services/IBurnBackendHelper.cs b/src/api/wix/WixToolset.Extensibility/Services/IBurnBackendHelper.cs index ef5fcc65..1b6a2828 100644 --- a/src/api/wix/WixToolset.Extensibility/Services/IBurnBackendHelper.cs +++ b/src/api/wix/WixToolset.Extensibility/Services/IBurnBackendHelper.cs | |||
@@ -7,7 +7,7 @@ namespace WixToolset.Extensibility.Services | |||
7 | /// <summary> | 7 | /// <summary> |
8 | /// Interface provided to help Burn backend extensions. | 8 | /// Interface provided to help Burn backend extensions. |
9 | /// </summary> | 9 | /// </summary> |
10 | public interface IBurnBackendHelper : IBackendHelper | 10 | public interface IBurnBackendHelper : IBackendHelper, IBundleValidator |
11 | { | 11 | { |
12 | /// <summary> | 12 | /// <summary> |
13 | /// Adds the given XML to the BootstrapperApplicationData manifest. | 13 | /// Adds the given XML to the BootstrapperApplicationData manifest. |
diff --git a/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs b/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs index fbe5aae4..de2c6f9f 100644 --- a/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs +++ b/src/api/wix/WixToolset.Extensibility/Services/IParseHelper.cs | |||
@@ -13,7 +13,7 @@ namespace WixToolset.Extensibility.Services | |||
13 | /// <summary> | 13 | /// <summary> |
14 | /// Interface provided to help compiler extensions parse. | 14 | /// Interface provided to help compiler extensions parse. |
15 | /// </summary> | 15 | /// </summary> |
16 | public interface IParseHelper | 16 | public interface IParseHelper : IBundleValidator |
17 | { | 17 | { |
18 | /// <summary> | 18 | /// <summary> |
19 | /// Creates a version 3 name-based UUID. | 19 | /// Creates a version 3 name-based UUID. |
@@ -323,17 +323,6 @@ namespace WixToolset.Extensibility.Services | |||
323 | YesNoDefaultType GetAttributeYesNoDefaultValue(SourceLineNumber sourceLineNumbers, XAttribute attribute); | 323 | YesNoDefaultType GetAttributeYesNoDefaultValue(SourceLineNumber sourceLineNumbers, XAttribute attribute); |
324 | 324 | ||
325 | /// <summary> | 325 | /// <summary> |
326 | /// Validates path is relative and canonicalizes it. | ||
327 | /// For example, "a\..\c\.\d.exe" => "c\d.exe". | ||
328 | /// </summary> | ||
329 | /// <param name="sourceLineNumbers"></param> | ||
330 | /// <param name="elementName"></param> | ||
331 | /// <param name="attributeName"></param> | ||
332 | /// <param name="relativePath"></param> | ||
333 | /// <returns>The original value if not relative, otherwise the canonicalized relative path.</returns> | ||
334 | string GetCanonicalRelativePath(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string relativePath); | ||
335 | |||
336 | /// <summary> | ||
337 | /// Gets a source line number for an element. | 326 | /// Gets a source line number for an element. |
338 | /// </summary> | 327 | /// </summary> |
339 | /// <param name="element">Element to get source line number.</param> | 328 | /// <param name="element">Element to get source line number.</param> |