1

We create a MSP patch that update a TrueType font (.TTF) file but it is causing 1603 (a reboot is required after installation.) Here is the MSI log:

MSI (s) (5C:48) [23:33:56:432]: Executing op: FileCopy(SourceName=TestFont.ttf,SourceCabKey=testfont.ttf,DestName=TestFont.ttf,Attributes=20480,FileSize=34880,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,Version=1.3.0.0,,InstallMode=58982400,HashOptions=0,HashPart1=1022639218,HashPart2=1170530421,HashPart3=1359995143,HashPart4=-948212544,,)
MSI (s) (5C:48) [23:33:56:432]: File: C:\Program Files (x86)\TESTDIR\TestFont.ttf;  Overwrite;  Won't patch;    Existing file is a lower version
MSI (s) (5C:48) [23:33:56:433]: Source for file 'passtrue.ttf' is compressed
InstallFiles: File: TestFont.ttf,  Directory: C:\Program Files (x86)\TESTDIR\,  Size: 34880
MSI (s) (5C:48) [23:33:56:434]: Re-applying security from existing file.
Info 1603. The file C:\Program Files (x86)\TESTDIR\TestFont.ttf is being held in use.  Close that application and retry.
MSI (s) (5C:48) [23:33:57:765]: Verifying accessibility of file: TestFont.ttf

I am sure the file is not in use. (rebooted the machine before applying this patch.)

Thanks!

Rex Hui
  • 71
  • 1
  • 7
  • Nothing is coming to mind. Assuming you are right, you might need to open a support case with Microsoft. – Christopher Painter Aug 23 '15 at 02:47
  • @ChristopherPainter: actually, that's the expected behaviour (as of MS14-045) if the font is installed in the relevant registry key but the file isn't located in the system fonts folder. – Harry Johnston Aug 23 '15 at 04:24
  • Good to know. It should would be nice if MSFT had that documented in the MSI SDK doco somewhere without having to know that it's some underlying GDI behavior that changed with a certain hotfix in the past year. I've been doing installers for 20 years but not many fonts recently to be honest. – Christopher Painter Aug 23 '15 at 11:32

1 Answers1

3

The most likely cause is that the font is installed as a permanent font, i.e., it is listed in the registry. The relevant registry key is:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

As described in Font Installation and Deletion:

A font installed from a location other than the %windir%\fonts folder cannot be modified when loaded in any active session, including session 0. Any attempt to change, replace, or delete will, therefore, be blocked. [...] Permanent fonts remain installed after reboot and are loaded by all created sessions.

You can resolve the problem by installing the font in the %windir%\fonts directory or by making it a temporary font.

(Note that this behaviour is relatively recent, having been introduced in security update MS14-045.)

Harry Johnston
  • 35,639
  • 6
  • 68
  • 158
  • Wow you are so knowledgeable! Thank you so much Harry. So why is my font installed as a permanent font? How do make it a temporary font while still being installing in our application folder? – Rex Hui Aug 23 '15 at 09:20
  • Maybe you could write up a community edition at: https://msdn.microsoft.com/en-us/library/aa368606(v=vs.85).aspx – Christopher Painter Aug 23 '15 at 11:33
  • I don't know much about the installer, @Christopher may be able to help on that aspect. But presumably all fonts named in the [Font table](https://msdn.microsoft.com/en-us/library/aa368606(v=vs.85).aspx) are installed as permanent fonts, and you can make it a temporary font simply by leaving it out of this table. Of course you would then have to modify your application so that it loads the font at runtime. – Harry Johnston Aug 23 '15 at 21:20
  • If he's creating a patch it's too late. The already deployed MSI would have already included it. – Christopher Painter Aug 23 '15 at 21:25
  • Thank you both! For the patch, I will add a custom action to remove those registry values in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts, and also remove the font table, so any future patches that updates the fonts will not have the reboot prompt. And for the next release, it will not have the font table. – Rex Hui Aug 24 '15 at 10:18