How do you install system fonts in Vista?

Is there anyway for a normal (non-installer) program to install system fonts
without making a separate executable that demands elevation so that it can
write files in the system fonts directory or to be able to write to HKEY_LOCAL_MACHINE\
SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts

Similarly, if you want to install a font permanently for one user only it seems like
you have to use the virtualization stuff (which seems like a hack that will break
someday, and might not even work now, since it would only be visible to
programs running in compatibility mode) or just have an application re-add it
everytime that they run. Is there a better way





Answer this question

How do you install system fonts in Vista?

  • bhaskar27in

    Hello wbardwel,

    In Vista UAC and Windows Resource Protection (WRP) work together in protecting system files, folders and registry keys. TO be able to write to the HKLM hive you must be elevated. The same goes for the Fonts directory as it is a system directory, note that if you are installing, you can mitigate these issues by using the Windows Installer Detection feature which automaticaly elevates an installer program due to "setup" being in either the file name or somewhere in the files metadata. As for installing files per user you do not have to rely on virtualization. Since the user is always running within their own context they will always have permissions to access their user directory. You can store required files/folders in the users AppData\local directory at C:\Users\<%userName%>\AppData\Local . I would suggest using the Standard User Analyzer tool to see where your application is requiring elevation. Virtualization in Vista mitigates applications that require their files to be written to say Program Files, usualy the applications themselves do not need to run in an elevated context, therefore potentialy avoiding rewriting certain sections of your application. I would suggest reading over the Vista Application Compatibility Cookbook for more information on some of the new features in Vista.

    Thanks!

    Matthew Braun



  • JocularJoe

    I was having the same problem as the people who have fonts that would work in XP or below but not in vista. After beating my head against my desk for a while, I figured out that my PS fonts needed to be converted since they had a .pfb ext and needed a .pfm. There is a handy little tool out there called CrossFont which will convert your older font from .pfb to .pfb+.pfm.

    The following settings worked for me:

    When you are converting, select the following:

    Convert from: PFB – PC PS Type 1 Font

    Convert to: PFB+PFM – PC PS Type1 Font, AFM – ASCII Font Metric, INF – Font Information File.

    Select an Output folder in your User folder (I used my Download folder and created a fonts folder) so you have access to write to it.

    After the conversion, just go to your fonts folder in the control panel. Right click and add your fonts. (Yes, they are still using the Windows 95 GUI to add your files L )

    Good Luck.


  • JKovarik

    Hi wbardwel,

    You can install system fonts in Vista however the application installing the fonts must be running in an elevated context. Normaly the only time you would be installing a font would be durring an install or update process which if its an installer (setup.exe) Installer Detection will automatically elevate the installer process and if its an updater, the exe is normaly manifested to run in an elevated context. The only way to install to the C:\WINDOWS\fonts directory is to elevate the application attempting to install. If an unelevated process attempts to write to C:\WINDOWS\Fonts an access denied error will be presented to the user.

    Thanks!

    Matthew Braun




  • Ralph Trickey

    Note that installer detection can be turned off and doesn't apply to 64-bit exes; if you want your setup.exe to elevate, you should try to use a manifest to request it:

    See the 'manifest for vista' thread in the 'Security for Applications in Windows Vista' forum that is peer to this one:

    http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=463884&SiteID=1


  • KimberlyL

    I understand the Vista security model, the question was:
    How do you install system fonts in Vista Is the only option to do an
    elevated installer/program Is there a way to do a permanent font
    install for just the current user, without elevation (Asside from
    virtualization which seems like a nasty hack, but maybe it is the only
    option.)

    If any of the Vista docs discussed font installation specifically I wouldn't
    be asking this. (And maybe them not discussing it is my answer,
    namely 'use an elevated installer'.)

    It kind of seems like Vista's security model is 'you can't do anything
    unless you are administrator, and now it is really annoying
    to become administrator.' Maybe in Vista2 some work will go into
    being able to do things without being administrator, like say, installing
    stuff for just the current user.


  • aguess

    Thank you so much Ironhuff

    Your advice and sending me to crossfonts.com was extremely helpful. I'm glad I scrolled down the page because the other posts didn't help, they even scared me off from trying to help. The Help topics at crossfonts didn't even do too much to help. It's all pretty self-explanatory; the only point I missed and needed come back to see about was designating a folder to send the converted fonts. It all worked like a dream, thanks for your advice.

  • How do you install system fonts in Vista?