How do I disable font registration in an Installshield (2011) basic msi project?

旧时模样 提交于 2019-12-01 17:18:24

问题


How can I stop installshield from registering fonts?

I've got a number of installshield projects deploying web applications, which all feature GlyphIcons and FontAwesome fonts. Installshield automatically registers these files (*.ttf, *.eot, *.otf) with the operating system.

This is a problem because the file can't be removed for uninstalls or upgrades.

The instructions here or here don't work since those fields simply don't exist in my version of installshield/project type.

Is there another way to disable this behaviour without renaming the files?


回答1:


I found a suggestion on the Installshield forums that seems to work.

To disable font registration:

  1. Go to "Custom Actions and Sequences"
  2. Locate the "RegisterFonts" action under Sequences, Execute
  3. Set the "Conditions" to 0




回答2:


Just want to add that the Font Table in your release MSI file is used to specify fonts that should be registered on the system.

Font entries added here will register the font on the system. You could try to remove the entries from this table to disable the font registration. Check your final, release MSI and not your ISM (Installshield source file).

The registration that happens to the fonts listed in the Font table mirrors what happens when you paste a font into the system's font folder using Windows Explorer - the font is then automatically registered on the system.

It is also possible that font registration can happen via a custom action in your MSI (maybe you took over the project from someone else), and if this is the case you must disable that custom action as well.


There is some information on the font registration process here: http://windowsitpro.com/scripting/trick-installing-fonts-vbscript-or-powershell-script

Essentially:

  • Font files copied to the "Fonts folder" via Windows Explorer are registered automagically (the shell copy operation triggers the registration process).
  • Font files copied directly to the "Fonts folder" via a batch file or a VBScript are not automatically registered (use the Shell.Application COM object to register them).
    • UPDATE: September 2018 - Not sure if the above applies to all new OS versions? I haven't taken the time to test.
  • Font files installed to the "Fonts folder" via an MSI are registered as long as they are listed in the MSI's Font table (or they are registered via a custom action).

Let me just duplicate the sample VBScript to register a font from the link above in case the link dies:

Set sa = CreateObject("Shell.Application")
Set fonts  = sa.NameSpace(20)
fonts.CopyHere "C:\tmp\SomeFont.ttf"

in PowerShell (hex 0x14 = 20 dec):

$sa =  new-object -comobject shell.application
$Fonts =  $sa.NameSpace(0x14)
$Fonts.CopyHere ("C:\tmp\SomeFont.ttf")

Those scripts don't impress me much, to put it like that. But there they are :-).




回答3:


I'm really late to the game.

I've been having the same problems with the same fonts (awesome and glyphicons and others from 3rd party) and having the same problem of them being registered automatically.

You have to manually remove them from the Font table under the Direct Editor section.

See this HOWTO: https://flexeracommunity.force.com/customer/articles/en_US/HOWTO/Installing-Fonts-Without-Registering-Them-in-the-Registry



来源:https://stackoverflow.com/questions/30080832/how-do-i-disable-font-registration-in-an-installshield-2011-basic-msi-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!