I am working on my first NSIS script and I have it working to install my Windows form project, but now I also want it to install a specific font during the installation. I keep getting the following error, even though my code appears to match every example I can find.

Invalid command: FontName::Name

Error in macro FontName on macroline 3

Error in macro InstallTTFFont on macroline 30

Here is the code I have added for the install of the font:

!include FontReg.nsh
!include FontName.nsh
!include WinMessages.nsh
Section "Fonts"
  StrCpy $FONT_DIR $FONTS
  !insertmacro InstallTTFFont "myFont-B.TTF"
  SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000
SectionEnd
有帮助吗?

解决方案

Invalid command: xxx::yyy means it cannot find the xxx plugin. Did you put the FontName plugin .dll in the correct plugin directory?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top