How to use try catch in NSIS
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 $FO开发者_运维技巧NTS
!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
as far I see, robertinventor has a fix here (11th March 2010, 23:16):
http://forums.winamp.com/showthread.php?t=209326
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}"
精彩评论