oleg-shilo / wixsharp

Framework for building a complete MSI or WiX source code by using script files written with C# syntax.
MIT License
1.12k stars 175 forks source link

Fonts are not installed for all users #1572

Closed kotsopoulosd closed 4 months ago

kotsopoulosd commented 4 months ago

Hi,

I currently new to the WixSharp and I am trying to install an msi that uses some fonts. Below is a sample of the code I use. image

I set also the install scope "PerMachine" and during installation I clicked "Run as Administrator" but again after installation the fonts were missing for other users and had to install them manually I came across to this article : https://blog.flowpoint.ai/post/v2/solved-installscopepermachine-in-wix-makes-no-difference/

Am I missing something ?

Thanks in advance

Torchok19081986 commented 4 months ago

hiho, there is example of wixsharp , how to install it. I had same issue. solved by adding codeline

new File("FreeSansBold.ttf") { AttributesDefinition="TrueType=yes"}));

works for me.

If you use wix toolset v4. There is possiblity to set it. Link : https://wixtoolset.org/docs/schema/wxs/packagescopetype/

kotsopoulosd commented 4 months ago

The constructor of the FontFile does exactly the same thing if you check the source code.

image

The installScope = PerMachine, thought sets this value.

I will try your way to see if this solves the issue but inside the sample there are two ways to set the fonts. https://github.com/oleg-shilo/wixsharp/blob/master/Source/src/WixSharp.Samples/Wix%23%20Samples/Install%20Font/setup.cs

Torchok19081986 commented 4 months ago

hm. May be. I solved my issue with second way. At First it doesnt work. After i set AttributeDef , it works.

kotsopoulosd commented 4 months ago

FYI @Torchok19081986, both cases are working actually fine actually. I noticed that the font installation fails per machine only if the license of the windows machine is outdated/expired and/or if there are any restrictions for this machine that do not allow such actions.