3

hi im getting a weird error on few machines in my nsis installer while installing. Its is giving "Invalid win32 file handle" while installing fonts using fontreg.nsh

i've tried google but didnt got an answer to this issue. now im thinking to suppress this message, so is there any way to suppress the message or if possible suggest me solution to the issue.

heres my code

!include "FontReg.nsh" !include "FontName.nsh" !include "WinMessages.nsh"

StrCpy $FONT_DIR $FONTS

!insertmacro InstallTTFFont 'calibri_0.TTF' !insertmacro InstallTTFFont 'calibrib.TTF' !insertmacro InstallTTFFont 'calibriz.TTF' !insertmacro InstallTTFFont 'calibrii.TTF'

SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000

please help its urgentt

Apurva Saxena
  • 448
  • 1
  • 5
  • 13
  • How does this error show up, in a messagebox or in the nsis details window? Can you confirm that we are talking about http://nsis.sourceforge.net/Register_Fonts ? – Anders Oct 27 '10 at 18:20
  • I can't find the "Invalid win32 file handle" string anywhere, can you confirm that this is the exact string? The default langstring used by the fontname plugin header is "Invalid file handle", is this what you are talking about? – Anders Oct 27 '10 at 18:26
  • 1
    the exact message is 'Invalid File handle 32' and its coming in message box. and yes im talking bout register fonts. – Apurva Saxena Nov 01 '10 at 13:32

2 Answers2

1

as far I see, robertinventor has a fix here (11th March 2010, 23:16):

http://forums.winamp.com/showthread.php?t=209326

boj
  • 10,935
  • 5
  • 38
  • 57
  • I'm getting the exact same problem, and the advice on that forum didn't help. Some of the fonts install, some don't, and there's nothing obviously wrong with the font files (they install manually fine). Very odd. – Nick Shaw Jun 03 '15 at 15:03
  • Hmm, I worked around it by renaming the font files to something else. Must be a clash somewhere on the system with the original font file names or something! – Nick Shaw Jun 03 '15 at 15:09
0

In answer to your original question ("is there any way to suppress the message"), it's not actually an exception, FontReg is displaying a MessageBox.

I edited FontReg.nsh and replaced line 84.

Old:

MessageBox MB_OK "$R2"

New:

DetailPrint "[ERROR] InstallTTFFont"
DetailPrint "[ERROR]     error: $R2"
DetailPrint "[ERROR]     FontFile: ${FontFile}"
DetailPrint "[ERROR]     FontFileName: ${FontFileName}"
DetailPrint "[ERROR]     Index: ${Index}"
Andy Nugent
  • 859
  • 7
  • 21