Just a quick post to explain how to fix an annoying issue I ran into today when trying to install some font files (.FON extension) as part of a visual studio 2010 setup project. I thought it would be a simple case of adding the fonts to the C:\Windows\Fonts directory and setting the register property of the FON files to vsdrfFont but when I tried this I just got an error during install saying something like “failed to register font. ensure you have permission” etc etc.
It seems that with TrueType fonts everything works fine using the method described above, but the font files I wanted to install were made in 1995 and as such are unsurprisingly not TrueType. What I ended up doing to fix this problem was as follows:
1. In your VS setup project, add the fonts to the Fonts folder and set the register property of each font file to vsdrfFonts
2. Build the project and then go and find the MSI file that was created and open it in InstEd (which is a free MSI editor you can get here)
3. In Insted, go to the Font table and you should see that for each of the GUIDs in here there is nothing in the FontTitle column – this is the problem. What you need to do is set the FontTitle for each GUID to the title specified in the relevant font file, so first of all we need to find out which font file each GUID in this table relates to. You can do this by clicking on one of the GUIDs and then if you look at the bottom of the screen you should see a table that shows where this row is referenced elsewhere in the MSI, so just double click this and it will take you to the relevant row in the File table so you can see which font file this one relates to. Once you know this, you can go and find the actual font file on your file system and right click on it and go to Properties, then Details, and you should see a “font title” in there. Make a note of this and then go back to the Font table in Insted and type the font title into the FontTitle column for the relevant row in there.
4. Repeat step 3 for each of the font files you want to install
5. Save the updated MSI and now try to install it again and you should find the fonts get registered successfully
Hope that saves other people from all the googling, log reading, and messing about that I had to do to figure this out! 🙂