Geeks With Blogs


Google My Blog

Catch me at: The List!

My InstallScript Utility Belt My Amazon Wishlist
My Standard Disclaimer

Chris G. Williams Beware: I mix tech and personal interests here.

The short answer is, you can't... at least not directly. ClickOnce is designed to be a noninvasive deployment technology, which is a fancy way of saying it won't let you stick files just anywhere you like. It also won't let you specify an install path, or muck about in the registry, etc.

So what do you do if you need to install a font as part of a ClickOnce deployment?

Anytime your ClickOnce application has a prerequisite, like .NET 3.5 or SQL Server CE for example, you need a bootstrapper. (These are separate packages that can be included in a ClickOnce installation. They run prior to your application install, if needed.)

There's no "font bootstrapper" that I know of, so you have to go a step further and create a setup package in Visual Studio that installs your font. This is pretty straightforward. Just add the Fonts folder to your setup package and browse out to the font file you need. (Actually, this is a little misleading since if you browse to the font in the Fonts folder, it will just open the font instead of adding it to the folder. You need to point to a copy of the font file that isn't in the Fonts folder.)

Then you can use David Guyer's Bootstrapper Manifest Generator (available here: to build a bootstrapper.  Here's where it gets a little tricky. By default, the Bootstrapper Manifest Generator (BMG) points the build output to the VS2005 "Packages" folder. So, if you're using VS2008, you need to point the build output to the VS2008 "Packages" folder. Unfortunately, Microsoft changed the location with VS 2008. Instead of being in a path similar to this one:  "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages" you need to look here: "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages"  I know... not very obvious, is it?

Once you build your setup package in Visual Studio, point the BMG at the .msi file you created (not the Setup.exe file.) Build your bootstrapper (with the right output folder, as described above) and then you'll be able to set your font installer as a prerequisite for your ClickOnce application.

That's it.

Posted on Tuesday, July 29, 2008 12:08 AM | Back to top

Comments on this post: How To Install a Font with ClickOnce

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Chris G. Williams | Powered by: