As you mentioned, you can launch other executables to install TrueType Fonts for you. I don't know your specific use cases but I'll run down the methods I know of and maybe one will be of use to you.
Windows has a built-in utility called fontview.exe, which you can invoke simply by calling Process.Start("Pathofile.ttf")
on any valid TrueType Font... assuming default file associations. This is akin to launching it manually from Windows Explorer. The advantage here is it's really trivial, but it still requires user interaction per font to install. As far as I know there is no way to invoke the "Install" portion of this process as an argument, but even if there was you'd still have to elevate permissions and battle UAC.
The more intriguing option is a utility called FontReg that replaces the deprecated fontinst.exe that was included on older versions of Windows. FontReg enables you to programatically install an entire directory of Fonts by invoking the executable with the /copy switch:
var info = new ProcessStartInfo()
{
FileName = "PathoFontReg.exe",
Arguments = "/copy",
UseShellExecute = false,
WindowStyle = ProcessWindowStyle.Hidden
};
Process.Start(info);
Note that the Fonts have to be in the root of wherever FontReg.exe is located. You'll also have to have administrator privileges. If you need your Font installations to be completely transparent, I would suggest launching your application with elevated permissions and approve of the UAC up front, that way when you spawn your child processes you wont need user approval Permissions stuff
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…