@joebigelow / wix-1 / commits / 9607c3ae

Ensure the Font actions are scheduled for TrueType fonts

TrueType fonts are denoted by the empty string in the FontTitle field of the FileSymbol. That means a non-null FontTitle field value means a font is being installed. Fixes 7593

Rob Mensching committed Aug 7, 2023 at 12:07 UTC 9607c3aec6d99662d9efbd2f14fa5ae285c0aac6
3 files changed +13 -5
src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs
+2
@@ -678,6 +678,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind
678 attributes |= (symbol.Attributes & FileSymbolAttributes.Vital) == FileSymbolAttributes.Vital ? WindowsInstallerConstants.MsidbFileAttributesVital : 0;
679 row.Attributes = attributes;
680
681 + // Note that TrueType fonts are denoted by the empty string in the FontTitle
682 + // field. So, non-null means a font is present.
683 if (symbol.FontTitle != null)
684 {
685 var fontRow = this.CreateRow(symbol, "Font");
src/wix/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs
+3 -1
@@ -446,7 +446,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind
446 var foundBindPath = false;
447 foreach (var file in this.Section.Symbols.OfType<FileSymbol>())
448 {
449 - if (!foundFont && !String.IsNullOrEmpty(file.FontTitle))
449 + // Note that TrueType fonts are denoted by the empty string in the FontTitle
450 + // field. So, non-null means a font is present.
451 + if (!foundFont && file.FontTitle != null)
452 {
453 set.Add("InstallExecuteSequence/RegisterFonts");
454 set.Add("InstallExecuteSequence/UnregisterFonts");
src/wix/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs
+8 -4
@@ -488,11 +488,13 @@ namespace WixToolsetTest.CoreIntegration
488 result.AssertSuccess();
489
490 Assert.True(File.Exists(msiPath));
491 - var results = Query.QueryDatabase(msiPath, new[] { "Font" });
491 + var results = Query.QueryDatabase(msiPath, new[] { "Font", "InstallExecuteSequence" });
492 WixAssert.CompareLineByLine(new[]
493 {
494 "Font:test.txt\tFakeFont",
495 - }, results);
495 + "InstallExecuteSequence:RegisterFonts\t\t5300",
496 + "InstallExecuteSequence:UnregisterFonts\t\t2500",
497 + }, results.Where(l => l.Contains("Font")).ToArray());
498 }
499 }
500
@@ -521,11 +523,13 @@ namespace WixToolsetTest.CoreIntegration
523 result.AssertSuccess();
524
525 Assert.True(File.Exists(msiPath));
524 - var results = Query.QueryDatabase(msiPath, new[] { "Font" });
526 + var results = Query.QueryDatabase(msiPath, new[] { "Font", "InstallExecuteSequence" });
527 WixAssert.CompareLineByLine(new[]
528 {
529 "Font:TrueTypeFontFile\t",
528 - }, results);
530 + "InstallExecuteSequence:RegisterFonts\t\t5300",
531 + "InstallExecuteSequence:UnregisterFonts\t\t2500",
532 + }, results.Where(l => l.Contains("Font")).ToArray());
533 }
534 }
535