diff options
| author | Rob Mensching <rob@firegiant.com> | 2022-11-15 23:38:46 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2022-11-17 07:48:19 -0800 |
| commit | dd3ab394ec6e37c24827294605857730f8e7a1a5 (patch) | |
| tree | 7db5d1a5790f28f2a486358fa0b8e5a8617ab1fc /src/api | |
| parent | 13292da793c9e0792d3ecd86974304b8b2a51d7a (diff) | |
| download | wix-dd3ab394ec6e37c24827294605857730f8e7a1a5.tar.gz wix-dd3ab394ec6e37c24827294605857730f8e7a1a5.tar.bz2 wix-dd3ab394ec6e37c24827294605857730f8e7a1a5.zip | |
Expose bind variables from build command and via MSBuild WixVariables property
Also, resolves bind variables in path fields.
Fixes 6995 and 7017
Diffstat (limited to 'src/api')
3 files changed, 22 insertions, 12 deletions
diff --git a/src/api/wix/WixToolset.Data/ErrorMessages.cs b/src/api/wix/WixToolset.Data/ErrorMessages.cs index c447f89d..0c7511b9 100644 --- a/src/api/wix/WixToolset.Data/ErrorMessages.cs +++ b/src/api/wix/WixToolset.Data/ErrorMessages.cs | |||
| @@ -598,9 +598,9 @@ namespace WixToolset.Data | |||
| 598 | return Message(sourceLineNumbers, Ids.ExpectedVariable, "A required variable was missing in the expression '{0}'.", expression); | 598 | return Message(sourceLineNumbers, Ids.ExpectedVariable, "A required variable was missing in the expression '{0}'.", expression); |
| 599 | } | 599 | } |
| 600 | 600 | ||
| 601 | public static Message ExpectedWixVariableValue(string variableId) | 601 | public static Message ExpectedBindVariableValue(string variableId) |
| 602 | { | 602 | { |
| 603 | return Message(null, Ids.ExpectedWixVariableValue, "The WiX variable '{0}' was declared without a value. Please specify a value for the variable.", variableId); | 603 | return Message(null, Ids.ExpectedBindVariableValue, "The bind variable '{0}' was declared without a value. Please specify a value for the variable.", variableId); |
| 604 | } | 604 | } |
| 605 | 605 | ||
| 606 | public static Message FamilyNameTooLong(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, int length) | 606 | public static Message FamilyNameTooLong(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, int length) |
| @@ -1081,9 +1081,9 @@ namespace WixToolset.Data | |||
| 1081 | return Message(null, Ids.IllegalWarningIdAsError, "Illegal value '{0}' for the -wx<N> command line option. Specify a particular warning number, like '-wx6' to display the warning with ID 6 as an error, or '-wx' alone to suppress all warnings.", warningId); | 1081 | return Message(null, Ids.IllegalWarningIdAsError, "Illegal value '{0}' for the -wx<N> command line option. Specify a particular warning number, like '-wx6' to display the warning with ID 6 as an error, or '-wx' alone to suppress all warnings.", warningId); |
| 1082 | } | 1082 | } |
| 1083 | 1083 | ||
| 1084 | public static Message IllegalWixVariablePrefix(SourceLineNumber sourceLineNumbers, string variableId) | 1084 | public static Message IllegalBindVariablePrefix(SourceLineNumber sourceLineNumbers, string variableId) |
| 1085 | { | 1085 | { |
| 1086 | return Message(sourceLineNumbers, Ids.IllegalWixVariablePrefix, "The WiX variable $(wix.{0}) uses an illegal prefix '$'. Please use the '!' prefix instead.", variableId); | 1086 | return Message(sourceLineNumbers, Ids.IllegalBindVariablePrefix, "The bind variable $(wix.{0}) uses an illegal prefix '$'. Please use the '!' prefix instead.", variableId); |
| 1087 | } | 1087 | } |
| 1088 | 1088 | ||
| 1089 | public static Message IllegalYesNoAlwaysValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) | 1089 | public static Message IllegalYesNoAlwaysValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) |
| @@ -2231,14 +2231,14 @@ namespace WixToolset.Data | |||
| 2231 | return Message(null, Ids.WixFileNotFound, "The file '{0}' cannot be found.", file); | 2231 | return Message(null, Ids.WixFileNotFound, "The file '{0}' cannot be found.", file); |
| 2232 | } | 2232 | } |
| 2233 | 2233 | ||
| 2234 | public static Message WixVariableCollision(SourceLineNumber sourceLineNumbers, string variableId) | 2234 | public static Message BindVariableCollision(SourceLineNumber sourceLineNumbers, string variableId) |
| 2235 | { | 2235 | { |
| 2236 | return Message(sourceLineNumbers, Ids.WixVariableCollision, "The WiX variable '{0}' is declared in more than one location. Please remove one of the declarations.", variableId); | 2236 | return Message(sourceLineNumbers, Ids.BindVariableCollision, "The bind variable '{0}' is declared in more than one location. Please remove one of the declarations.", variableId); |
| 2237 | } | 2237 | } |
| 2238 | 2238 | ||
| 2239 | public static Message WixVariableUnknown(SourceLineNumber sourceLineNumbers, string variableId) | 2239 | public static Message BindVariableUnknown(SourceLineNumber sourceLineNumbers, string variableId) |
| 2240 | { | 2240 | { |
| 2241 | return Message(sourceLineNumbers, Ids.WixVariableUnknown, "The WiX variable !(wix.{0}) is unknown. Please ensure the variable is declared on the command line for light.exe, via a WixVariable element, or inline using the syntax !(wix.{0}=some value which doesn't contain parenthesis).", variableId); | 2241 | return Message(sourceLineNumbers, Ids.BindVariableUnknown, "The bind variable !(wix.{0}) is unknown. Please ensure the variable is declared on the command line for wix.exe, via a BindVariable element, or inline using the syntax !(wix.{0}=some value which doesn't contain parenthesis).", variableId); |
| 2242 | } | 2242 | } |
| 2243 | 2243 | ||
| 2244 | public static Message NoSourceFiles() | 2244 | public static Message NoSourceFiles() |
| @@ -2474,10 +2474,10 @@ namespace WixToolset.Data | |||
| 2474 | VersionIndependentProgIdsCannotHaveIcons = 192, | 2474 | VersionIndependentProgIdsCannotHaveIcons = 192, |
| 2475 | IllegalAttributeValueWithOtherAttribute = 193, | 2475 | IllegalAttributeValueWithOtherAttribute = 193, |
| 2476 | InvalidMergeLanguage = 194, | 2476 | InvalidMergeLanguage = 194, |
| 2477 | WixVariableCollision = 195, | 2477 | BindVariableCollision = 195, |
| 2478 | ExpectedWixVariableValue = 196, | 2478 | ExpectedBindVariableValue = 196, |
| 2479 | WixVariableUnknown = 197, | 2479 | BindVariableUnknown = 197, |
| 2480 | IllegalWixVariablePrefix = 198, | 2480 | IllegalBindVariablePrefix = 198, |
| 2481 | InvalidWixXmlNamespace = 199, | 2481 | InvalidWixXmlNamespace = 199, |
| 2482 | UnhandledExtensionElement = 200, | 2482 | UnhandledExtensionElement = 200, |
| 2483 | UnhandledExtensionAttribute = 201, | 2483 | UnhandledExtensionAttribute = 201, |
diff --git a/src/api/wix/WixToolset.Extensibility/Data/ILibraryContext.cs b/src/api/wix/WixToolset.Extensibility/Data/ILibraryContext.cs index f3c4db6e..9fc767f6 100644 --- a/src/api/wix/WixToolset.Extensibility/Data/ILibraryContext.cs +++ b/src/api/wix/WixToolset.Extensibility/Data/ILibraryContext.cs | |||
| @@ -28,6 +28,11 @@ namespace WixToolset.Extensibility.Data | |||
| 28 | IReadOnlyCollection<IBindPath> BindPaths { get; set; } | 28 | IReadOnlyCollection<IBindPath> BindPaths { get; set; } |
| 29 | 29 | ||
| 30 | /// <summary> | 30 | /// <summary> |
| 31 | /// Bind variables used when binding files. | ||
| 32 | /// </summary> | ||
| 33 | IDictionary<string, string> BindVariables { get; set; } | ||
| 34 | |||
| 35 | /// <summary> | ||
| 31 | /// Collection of extensions used during creation of library. | 36 | /// Collection of extensions used during creation of library. |
| 32 | /// </summary> | 37 | /// </summary> |
| 33 | IReadOnlyCollection<ILibrarianExtension> Extensions { get; set; } | 38 | IReadOnlyCollection<ILibrarianExtension> Extensions { get; set; } |
diff --git a/src/api/wix/WixToolset.Extensibility/Data/IResolveContext.cs b/src/api/wix/WixToolset.Extensibility/Data/IResolveContext.cs index bec689ba..a2158e4f 100644 --- a/src/api/wix/WixToolset.Extensibility/Data/IResolveContext.cs +++ b/src/api/wix/WixToolset.Extensibility/Data/IResolveContext.cs | |||
| @@ -23,6 +23,11 @@ namespace WixToolset.Extensibility.Data | |||
| 23 | IReadOnlyCollection<IBindPath> BindPaths { get; set; } | 23 | IReadOnlyCollection<IBindPath> BindPaths { get; set; } |
| 24 | 24 | ||
| 25 | /// <summary> | 25 | /// <summary> |
| 26 | /// Bind variables used during resolution. | ||
| 27 | /// </summary> | ||
| 28 | IDictionary<string, string> BindVariables { get; set; } | ||
| 29 | |||
| 30 | /// <summary> | ||
| 26 | /// Resolve extensions. | 31 | /// Resolve extensions. |
| 27 | /// </summary> | 32 | /// </summary> |
| 28 | IReadOnlyCollection<IResolverExtension> Extensions { get; set; } | 33 | IReadOnlyCollection<IResolverExtension> Extensions { get; set; } |
