简体   繁体   English

如何使用inno设置安装字体

[英]how to install fonts using inno setup

I want to pre install the fonts for inno setup. 我想为inno setup预安装字体。 I have made a custom inno setup installer with font Aller Light.Now when i run my inno setup for the first time on a client machine. 我已经用字体Aller Light制作了一个自定义的inno安装程序安装程序。现在,当我第一次在客户端计算机上运行我的inno安装程序时。 The design is not coming proper due to fonts.. but when installer is run once again then design comes proper. 由于字体的原因,该设计不正确。但是当再次运行安装程序时,该设计就正确了。

Just to make it more clear,this font is used in the design of my installer,and not in the application which is deployed using this installer. 为了更清楚一点,此字体用于我的安装程序的设计中,而不是用于使用此安装程序部署的应用程序中。 I just need a way to install the fonts on the client machine before installer executable opens the welcome page,so that design i made for custom setup is proper. 在安装程序可执行文件打开欢迎页面之前,我只需要一种在客户端计算机上安装字体的方法,这样我为自定义安装进行的设计是正确的。

This is a bad idea; 这是一个坏主意; it's bad practice to modify the user's system prior to the start of the "real" installation phase. 在“实际”安装阶段开始之前修改用户的系​​统是一种不好的做法。 You should strongly consider a redesign to use a system standard font or to use bitmap images of your text in the desired style rather than trying to install a font. 您应该强烈考虑进行重新设计,以使用系统标准字体或以所需样式使用文本的位图图像,而不是尝试安装字体。

Inno has a mechanism to install a font as part of the installation itself, which will be sufficient for your application (see FontInstall ). Inno具有一种将字体作为安装本身的一部分进行安装的机制,这对于您的应用程序已经足够了(请参阅FontInstall )。

If you really want to go down the bad-practice path, you can probably get something to work with some InitializeSetup code that calls ExtractTemporaryFile and the AddFontResource WinAPI . 如果您确实想走坏习惯的道路,则可以使用一些调用ExtractTemporaryFileAddFontResource WinAPI的 InitializeSetup代码来工作。 (Don't forget to send the broadcast message too.) (不要忘了发送广播消息。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM