Menu ▾ ▴

#905 CreateFont $HEADLINE_FONT on .oninit causes silent install

2.0 Series
closed-fixed
General (291)
5
2009-06-06
2009-06-04
No

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

Discussion

  • Jim Michaels

    Jim Michaels - 2009-06-04

    offending file. .oninit is the problem.

     
  • Jim Michaels

    Jim Michaels - 2009-06-04

    the specific line causing the problem is CreateFont.

     
  • Jim Michaels

    Jim Michaels - 2009-06-04

    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

     
  • Jim Michaels

    Jim Michaels - 2009-06-06
    • summary: old .oninit code to prevent reentering causes silent install --> CreateFont $HEADLINE_FONT on .oninit causes silent install
     
  • Jim Michaels

    Jim Michaels - 2009-06-06

    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

     
  • Amir Szekely

    Amir Szekely - 2009-06-06
    • assigned_to: nobody --> kichik
    • status: open --> closed-fixed
     
  • Amir Szekely

    Amir Szekely - 2009-06-06

    HEADLINE_FONT is not declared and CreateFont doesn't verify it is. Fixed, thanks.

     

Log in to post a comment.