From 92bd26dab11023a0c4c787945fd87b23aa0a78c8 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Wed, 13 Nov 2019 11:04:59 +1000 Subject: Fix parsing Shortcut/@Name and detect duplicate in GetMsiFilenameValue. --- .../Bind/CreateOutputFromIRCommand.cs | 2 +- src/WixToolset.Core/Compiler_2.cs | 1 - .../MsiQueryFixture.cs | 4 +-- .../WixlibQueryFixture.cs | 30 ---------------------- 4 files changed, 3 insertions(+), 34 deletions(-) (limited to 'src') diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs index d7056bb8..75eee3b6 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateOutputFromIRCommand.cs @@ -1146,7 +1146,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind private static string GetMsiFilenameValue(string shortName, string longName) { - if (String.IsNullOrEmpty(shortName)) + if (String.IsNullOrEmpty(shortName) || String.Equals(shortName, longName, StringComparison.OrdinalIgnoreCase)) { return longName; } diff --git a/src/WixToolset.Core/Compiler_2.cs b/src/WixToolset.Core/Compiler_2.cs index 3e50a32d..4b6839f1 100644 --- a/src/WixToolset.Core/Compiler_2.cs +++ b/src/WixToolset.Core/Compiler_2.cs @@ -4328,7 +4328,6 @@ namespace WixToolset.Core if (null == shortName) { shortName = name; - name = null; } else { diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index 83f53aca..81f780dc 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs @@ -384,7 +384,7 @@ namespace WixToolsetTest.CoreIntegration } } - [Fact(Skip = "Test demonstrates failure")] + [Fact] public void PopulatesDirectoryTableWithValidDefaultDir() { var folder = TestData.Get(@"TestData"); @@ -648,7 +648,7 @@ namespace WixToolsetTest.CoreIntegration } } - [Fact(Skip = "Test demonstrates failure")] + [Fact] public void PopulatesMsiShortcutPropertyTable() { var folder = TestData.Get(@"TestData"); diff --git a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs index 53bc5910..7f9b9686 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/WixlibQueryFixture.cs @@ -12,36 +12,6 @@ namespace WixToolsetTest.CoreIntegration public class WixlibQueryFixture { - [Fact(Skip = "Test demonstrates failure")] - public void ShortcutNameWithPreprocessorVariableIsResolved() - { - var folder = TestData.Get(@"TestData\Shortcut"); - - using (var fs = new DisposableFileSystem()) - { - var baseFolder = fs.GetFolder(); - var intermediateFolder = Path.Combine(baseFolder, "obj"); - var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib"); - - var result = WixRunner.Execute(new[] - { - "build", - Path.Combine(folder, "ShortcutProperty.wxs"), - "-intermediateFolder", intermediateFolder, - "-o", wixlibPath - }); - - result.AssertSuccess(); - - var intermediate = Intermediate.Load(wixlibPath); - var allTuples = intermediate.Sections.SelectMany(s => s.Tuples); - var shortcutTuple = allTuples.OfType() - .SingleOrDefault(); - Assert.NotNull(shortcutTuple); - Assert.Equal("d", shortcutTuple.Name); - } - } - [Fact] public void UpgradeProducesReferenceToRemoveExistingProducts() { -- cgit v1.2.3-55-g6feb