diff options
Diffstat (limited to 'src/WixToolset.Core/CompilerCore.cs')
| -rw-r--r-- | src/WixToolset.Core/CompilerCore.cs | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/src/WixToolset.Core/CompilerCore.cs b/src/WixToolset.Core/CompilerCore.cs index cfe3082e..ec22a8ec 100644 --- a/src/WixToolset.Core/CompilerCore.cs +++ b/src/WixToolset.Core/CompilerCore.cs | |||
| @@ -297,20 +297,6 @@ namespace WixToolset.Core | |||
| 297 | } | 297 | } |
| 298 | 298 | ||
| 299 | /// <summary> | 299 | /// <summary> |
| 300 | /// Creates a short file/directory name using an identifier and long file/directory name as input. | ||
| 301 | /// </summary> | ||
| 302 | /// <param name="longName">The long file/directory name.</param> | ||
| 303 | /// <param name="keepExtension">The option to keep the extension on generated short names.</param> | ||
| 304 | /// <param name="allowWildcards">true if wildcards are allowed in the filename.</param> | ||
| 305 | /// <param name="args">Any additional information to include in the hash for the generated short name.</param> | ||
| 306 | /// <returns>The generated 8.3-compliant short file/directory name.</returns> | ||
| 307 | [Obsolete] | ||
| 308 | public string CreateShortName(string longName, bool keepExtension, bool allowWildcards, params string[] args) | ||
| 309 | { | ||
| 310 | return this.parseHelper.CreateShortName(longName, keepExtension, allowWildcards, args); | ||
| 311 | } | ||
| 312 | |||
| 313 | /// <summary> | ||
| 314 | /// Verifies the given string is a valid product version. | 300 | /// Verifies the given string is a valid product version. |
| 315 | /// </summary> | 301 | /// </summary> |
| 316 | /// <param name="version">The product version to verify.</param> | 302 | /// <param name="version">The product version to verify.</param> |
| @@ -337,7 +323,7 @@ namespace WixToolset.Core | |||
| 337 | /// <returns>True if version is a valid module or bundle version.</returns> | 323 | /// <returns>True if version is a valid module or bundle version.</returns> |
| 338 | public static bool IsValidModuleOrBundleVersion(string version) | 324 | public static bool IsValidModuleOrBundleVersion(string version) |
| 339 | { | 325 | { |
| 340 | return Common.IsValidModuleOrBundleVersion(version); | 326 | return Common.IsValidFourPartVersion(version); |
| 341 | } | 327 | } |
| 342 | 328 | ||
| 343 | /// <summary> | 329 | /// <summary> |
| @@ -547,15 +533,14 @@ namespace WixToolset.Core | |||
| 547 | { | 533 | { |
| 548 | if (null == attribute) | 534 | if (null == attribute) |
| 549 | { | 535 | { |
| 550 | throw new ArgumentNullException("attribute"); | 536 | throw new ArgumentNullException(nameof(attribute)); |
| 551 | } | 537 | } |
| 552 | 538 | ||
| 553 | string value = this.GetAttributeValue(sourceLineNumbers, attribute); | 539 | var value = this.GetAttributeValue(sourceLineNumbers, attribute); |
| 554 | 540 | ||
| 555 | try | 541 | try |
| 556 | { | 542 | { |
| 557 | int codePage = Common.GetValidCodePage(value); | 543 | return Common.GetValidCodePage(value); |
| 558 | return codePage; | ||
| 559 | } | 544 | } |
| 560 | catch (NotSupportedException) | 545 | catch (NotSupportedException) |
| 561 | { | 546 | { |
| @@ -576,12 +561,12 @@ namespace WixToolset.Core | |||
| 576 | { | 561 | { |
| 577 | if (null == attribute) | 562 | if (null == attribute) |
| 578 | { | 563 | { |
| 579 | throw new ArgumentNullException("attribute"); | 564 | throw new ArgumentNullException(nameof(attribute)); |
| 580 | } | 565 | } |
| 581 | 566 | ||
| 582 | string value = this.GetAttributeValue(sourceLineNumbers, attribute); | 567 | var value = this.GetAttributeValue(sourceLineNumbers, attribute); |
| 583 | 568 | ||
| 584 | // allow for localization of code page names and values | 569 | // Allow for localization of code page names and values. |
| 585 | if (this.IsValidLocIdentifier(value)) | 570 | if (this.IsValidLocIdentifier(value)) |
| 586 | { | 571 | { |
| 587 | return value; | 572 | return value; |
| @@ -589,13 +574,13 @@ namespace WixToolset.Core | |||
| 589 | 574 | ||
| 590 | try | 575 | try |
| 591 | { | 576 | { |
| 592 | int codePage = Common.GetValidCodePage(value, false, onlyAnsi, sourceLineNumbers); | 577 | var codePage = Common.GetValidCodePage(value, false, onlyAnsi, sourceLineNumbers); |
| 593 | return codePage.ToString(CultureInfo.InvariantCulture); | 578 | return codePage.ToString(CultureInfo.InvariantCulture); |
| 594 | } | 579 | } |
| 595 | catch (NotSupportedException) | 580 | catch (NotSupportedException) |
| 596 | { | 581 | { |
| 597 | // not a valid windows code page | 582 | // Not a valid windows code page. |
| 598 | this.Write(ErrorMessages.IllegalCodepageAttribute(sourceLineNumbers, value, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); | 583 | this.messaging.Write(ErrorMessages.IllegalCodepageAttribute(sourceLineNumbers, value, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); |
| 599 | } | 584 | } |
| 600 | catch (WixException e) | 585 | catch (WixException e) |
| 601 | { | 586 | { |
| @@ -805,7 +790,7 @@ namespace WixToolset.Core | |||
| 805 | 790 | ||
| 806 | if (0 < value.Length) | 791 | if (0 < value.Length) |
| 807 | { | 792 | { |
| 808 | if (!this.IsValidShortFilename(value, allowWildcards) && !Common.ContainsValidBinderVariable(value)) | 793 | if (!this.parseHelper.IsValidShortFilename(value, allowWildcards) && !Common.ContainsValidBinderVariable(value)) |
| 809 | { | 794 | { |
| 810 | this.Write(ErrorMessages.IllegalShortFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); | 795 | this.Write(ErrorMessages.IllegalShortFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); |
| 811 | } | 796 | } |
