Quantcast
Channel: wixsharp Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1354

New Post: How to install fonts?

$
0
0
No, the path cannot be the cause of the problem. If it was then candle would complain that the file could not be found.

I actually managed to test it and found that the solution works. I even updated the code with a specialized class FontFile and the corresponding sample (you can get it from here: "https://wixsharp.codeplex.com/SourceControl/latest#src/WixSharp.Samples/Wix# Samples/Install Font/setup.cs"). The whole working sample is as follows:
staticpublicvoid Main()
{
    var project =
        new Project("MyProduct",
            new Dir(@"%ProgramFiles%\My Company\My Product",
                new File("readme.txt")),
            new Dir("%Fonts%", 
                new FontFile("FreeSansBold.ttf")));
        
                //The same can be achieved with File and custom attributes//new File("FreeSansBold.ttf") { AttributesDefinition="TrueType=yes"}));

    project.UI = WUI.WixUI_ProgressOnly;
    project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");
    project.PreserveTempFiles = true;

    project.BuildMsi();
}
Note that you don't have to use FontFile and you can use extra attributes with the File class.

The sample installs the test font properly:
Image

Viewing all articles
Browse latest Browse all 1354

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>