From 36a8f464f6c9b7e553c94b29ee3ca836638eef4d Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 7 Jul 2022 17:52:15 -0700 Subject: Support bind variables in Package and Bundle versions Closes 6779 --- src/api/wix/WixToolset.Data/ErrorMessages.cs | 7 +------ .../Services/IBackendHelper.cs | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'src/api') diff --git a/src/api/wix/WixToolset.Data/ErrorMessages.cs b/src/api/wix/WixToolset.Data/ErrorMessages.cs index be222e6d..c28812f7 100644 --- a/src/api/wix/WixToolset.Data/ErrorMessages.cs +++ b/src/api/wix/WixToolset.Data/ErrorMessages.cs @@ -1326,12 +1326,7 @@ namespace WixToolset.Data public static Message InvalidProductVersion(SourceLineNumber sourceLineNumbers, string version) { - return Message(sourceLineNumbers, Ids.InvalidProductVersion, "Invalid product version '{0}'. Product version must have a major version less than 256, a minor version less than 256, and a build version less than 65536.", version); - } - - public static Message InvalidProductVersion(SourceLineNumber sourceLineNumbers, string version, string packagePath) - { - return Message(sourceLineNumbers, Ids.InvalidProductVersion, "Invalid product version '{0}' in package '{1}'. When included in a bundle, all product version fields in an MSI package must be less than 65536.", version, packagePath); + return Message(sourceLineNumbers, Ids.InvalidProductVersion, "Invalid product version '{0}'. MSI product versions must have a major version less than 256, a minor version less than 256, and a build version less than 65536. The revision value is ignored but version labels and metadata are not allowed.", version); } public static Message InvalidRemoveComponent(SourceLineNumber sourceLineNumbers, string component, string feature, string transformPath) diff --git a/src/api/wix/WixToolset.Extensibility/Services/IBackendHelper.cs b/src/api/wix/WixToolset.Extensibility/Services/IBackendHelper.cs index 1c92303e..eff42b99 100644 --- a/src/api/wix/WixToolset.Extensibility/Services/IBackendHelper.cs +++ b/src/api/wix/WixToolset.Extensibility/Services/IBackendHelper.cs @@ -93,7 +93,7 @@ namespace WixToolset.Extensibility.Services /// The Filename value. /// true to get a source name; false to get a target name /// true to get a long name; false to get a short name - /// The name. + /// The requesed file name. string GetMsiFileName(string value, bool source, bool longName); /// @@ -165,5 +165,22 @@ namespace WixToolset.Extensibility.Services /// Thus the returned array will always be of length 4. /// string[] SplitMsiFileName(string value); + + /// + /// Tries to parse a version from the provided version string. + /// + /// The version to verify and parse. + /// The parsed result if possible, otherwise null. + /// True if the version was able to parsed, otherwise false. + bool TryParseFourPartVersion(string version, out string parsedVersion); + + /// + /// Tries to parse an MSI product version from the provided version string. + /// + /// The version to verify and parse. + /// Indicates whether to return a strict (255.255.65535) product version or any valid product version (255.255.65535.*). + /// The parsed result if possible, otherwise null. + /// True if the version was able to parsed as an product version, otherwise false. + bool TryParseMsiProductVersion(string version, bool strict, out string parsedVersion); } } -- cgit v1.2.3-55-g6feb