diff options
| author | Rob Mensching <rob@firegiant.com> | 2021-03-19 11:15:12 -0700 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2021-03-19 11:31:45 -0700 |
| commit | 1fa3b2f3c3e1380a5ae5ed76cdf028f221473da3 (patch) | |
| tree | 11c5fbfacd0aba0d97405c8ccac9555126523f6f /src/test/WixToolsetTest.CoreIntegration/ShortcutFixture.cs | |
| parent | 84d70d16e4ab2051d881251440fe4729f301b265 (diff) | |
| download | wix-1fa3b2f3c3e1380a5ae5ed76cdf028f221473da3.tar.gz wix-1fa3b2f3c3e1380a5ae5ed76cdf028f221473da3.tar.bz2 wix-1fa3b2f3c3e1380a5ae5ed76cdf028f221473da3.zip | |
Update tests to validate Shortcut Name/ShortName handling
Resolves wixtoolset/issues#4227
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/ShortcutFixture.cs')
| -rw-r--r-- | src/test/WixToolsetTest.CoreIntegration/ShortcutFixture.cs | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/ShortcutFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ShortcutFixture.cs new file mode 100644 index 00000000..3b6c50c0 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/ShortcutFixture.cs | |||
| @@ -0,0 +1,78 @@ | |||
| 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 WixToolsetTest.CoreIntegration | ||
| 4 | { | ||
| 5 | using System.IO; | ||
| 6 | using WixBuildTools.TestSupport; | ||
| 7 | using WixToolset.Core.TestPackage; | ||
| 8 | using Xunit; | ||
| 9 | |||
| 10 | public class ShortcutFixture | ||
| 11 | { | ||
| 12 | [Fact] | ||
| 13 | public void CanBuildShortcutNameWithShortname() | ||
| 14 | { | ||
| 15 | var folder = TestData.Get(@"TestData"); | ||
| 16 | |||
| 17 | using (var fs = new DisposableFileSystem()) | ||
| 18 | { | ||
| 19 | var baseFolder = fs.GetFolder(); | ||
| 20 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 21 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
| 22 | |||
| 23 | var result = WixRunner.Execute(new[] | ||
| 24 | { | ||
| 25 | "build", | ||
| 26 | Path.Combine(folder, "Shortcut", "ShortcutSameNameShortName.wxs"), | ||
| 27 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 28 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 29 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 30 | "-intermediateFolder", intermediateFolder, | ||
| 31 | "-o", msiPath | ||
| 32 | }); | ||
| 33 | |||
| 34 | result.AssertSuccess(); | ||
| 35 | |||
| 36 | var results = Query.QueryDatabase(msiPath, new[] { "Shortcut" }); | ||
| 37 | WixAssert.CompareLineByLine(new[] | ||
| 38 | { | ||
| 39 | "Shortcut:sctzJpBYlrhdx4Mm9Xh41X0KPWYiX0\tINSTALLFOLDER\tDaName\tShortcutComp\t[#filcV1yrx0x8wJWj4qMzcH21jwkPko]\t\t\t\t\t\t\t\t\t\t\t", | ||
| 40 | }, results); | ||
| 41 | } | ||
| 42 | } | ||
| 43 | |||
| 44 | [Fact] | ||
| 45 | public void PopulatesMsiShortcutPropertyTable() | ||
| 46 | { | ||
| 47 | var folder = TestData.Get(@"TestData"); | ||
| 48 | |||
| 49 | using (var fs = new DisposableFileSystem()) | ||
| 50 | { | ||
| 51 | var baseFolder = fs.GetFolder(); | ||
| 52 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
| 53 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
| 54 | |||
| 55 | var result = WixRunner.Execute(new[] | ||
| 56 | { | ||
| 57 | "build", | ||
| 58 | Path.Combine(folder, "Shortcut", "ShortcutProperty.wxs"), | ||
| 59 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
| 60 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
| 61 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
| 62 | "-intermediateFolder", intermediateFolder, | ||
| 63 | "-o", msiPath | ||
| 64 | }); | ||
| 65 | |||
| 66 | result.AssertSuccess(); | ||
| 67 | |||
| 68 | Assert.True(File.Exists(msiPath)); | ||
| 69 | var results = Query.QueryDatabase(msiPath, new[] { "MsiShortcutProperty", "Shortcut" }); | ||
| 70 | WixAssert.CompareLineByLine(new[] | ||
| 71 | { | ||
| 72 | "MsiShortcutProperty:scp4GOCIx4Eskci4nBG1MV_vSUOZt4\tTheShortcut\tCustomShortcutKey\tCustomShortcutValue", | ||
| 73 | "Shortcut:TheShortcut\tINSTALLFOLDER\td\tShortcutComp\t[#filcV1yrx0x8wJWj4qMzcH21jwkPko]\t\t\t\t\t\t\t\t\t\t\t", | ||
| 74 | }, results); | ||
| 75 | } | ||
| 76 | } | ||
| 77 | } | ||
| 78 | } | ||
