Function .onInit
CreateFont $HEADLINE_FONT "$(^Font)" "14" "700"
InitPluginsDir
SetOutPath "$PLUGINSDIR"
; SetOutPath "."
; File /oname=$PLUGINSDIR\welcome.bmp "${NSISDIR}\Contrib\Graphics\Wizard\orange-nsis.bmp"
; File "setup.ini"
#prevent multiple instances of the installer running
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "myMutex") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
Abort
FunctionEnd
this is re-entrancy prevention code I got off of the forum and I used with older NSIS to install with NSIS 2.2 or NSIS 2.16 I think or maybe earlier I don't remember. anyway, now I installed NSIS 2.44. when I do Help|About in NSIS 2.4.4 it says 2.3. strange.
anyway, when I comment out the innards of this function and test it the installer shows up. when I uncomment the code, the UI never shows and all the sections get executed in sequence. without asking. I get no change to check or unckeck checkboxes at the MUI_PAGE_COMPONENTS page because it never shows. mui disappears and what it seems we have is a silent install.
Jim Michaels
offending file. .oninit is the problem.
the specific line causing the problem is CreateFont.
workaround:
!include "WinMessages.nsh"
Function .onInit
...
GetDlgItem $0 $HWNDPARENT 1
CreateFont $1 "$(^Font)" "14" "700"
...
FunctionEnd
still do not know what caused this. possibly $HEADLINE_FONT is the wrong value or not defined?
when I do this
MessageBox MB_OK|MB_ICONEXCLAMATION "$HEADLINE_FONT"
I get a messagebox that says $HEADLINE_FONT
Jim Michaels
changed title to reflect bug.
from
old .oninit code to prevent reentering causes silent install
to
CreateFont $HEADLINE_FONT in .oninit causes silent install
Jim Michaels
HEADLINE_FONT is not declared and CreateFont doesn't verify it is. Fixed, thanks.