Menu

#681 MUI_HEADERIMAGE

closed-invalid
Modern UI (97)
5
2014-12-17
2007-09-23
Anonymous
No

I use nsis 2.30.
If I define "MUI_HEADERIMAGE" and "MUI_HEADERIMAGE_BITMAP" the uninstaller doesn't have a headerimage.

Discussion

  • Nobody/Anonymous

    The Script

     
  • Amir Szekely

    Amir Szekely - 2007-09-28

    Logged In: YES
    user_id=584402
    Originator: NO

    You must insert the page macros before you insert the language macros. That includes both the installer pages and the uninstaller pages. Notice how many warnings the compiler gives you because of this.

     
  • Amir Szekely

    Amir Szekely - 2007-09-28
    • assigned_to: joostverburg --> kichik
    • status: open --> closed-invalid
     
  • Heiko Schäfer

    Heiko Schäfer - 2014-12-17

    I have the same problem, while I have the language macros BEFORE the pages.

    I use 2.46 on Gentoo and the installer shows the image fine on Wine, but not on Win7.

    I use a Makefile to prepare all, convert the image to BMP and to call makensis. I've attached both, the Makefile and my script.

     

    Last edit: Heiko Schäfer 2014-12-17
    • Anders

      Anders - 2014-12-17

      netmaumau.nsi has MUI_LANGUAGE after the page macros which is correct. Could it be a problem with the generated BMP?

      !include "MUI2.nsh"
      !define MUI_HEADERIMAGE
      !define MUI_HEADERIMAGE_RIGHT
      !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
      !define MUI_HEADERIMAGE_UNBITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall.bmp"
      
      !insertmacro MUI_PAGE_LICENSE "${__FILE__}"
      !insertmacro MUI_PAGE_COMPONENTS
      !insertmacro MUI_PAGE_DIRECTORY
      !insertmacro MUI_PAGE_INSTFILES
      
      !insertmacro MUI_UNPAGE_CONFIRM
      !insertmacro MUI_UNPAGE_INSTFILES
      
      !insertmacro MUI_LANGUAGE "English"
      
      InstallDir "$Temp\Example"
      
      Section
      SetOutPath "$InstDir"
      WriteUninstaller "$InstDir\Uninstall.exe"
      SectionEnd
      
      Section Uninstall
      Delete "$InstDir\Uninstall.exe"
      RMDir "$InstDir"
      SectionEnd
      
       
      • Heiko Schäfer

        Heiko Schäfer - 2014-12-17

        It seems you are right. I tested the BMP on another PC and it seemed to be invalid :-O

        Maybe I need to re-emerge ImageMagick on my Gentoo, because there it was displayed correct, but also in Wine.

        I'l check it and will give feedback.

         

        Last edit: Heiko Schäfer 2014-12-17
  • Heiko Schäfer

    Heiko Schäfer - 2014-12-17

    It was the BMP! But NSIS seems to be very pendant in the format. For the docs (FAQ/WIKI?) this is how to generate a BMP out of any image with ImageMagick suitable for NSIS:

    convert -background white -alpha remove -alpha off /path/to/in.img -resize x57 -gravity center -extent 150x57 BMP3:/path/to/out.bmp

    Important are -alpha off AFTER -alpha remove and BMP3: directly prepended to the output image filename.

     

    Last edit: Heiko Schäfer 2014-12-17
    • Anders

      Anders - 2014-12-17

      NSIS (Modern UI) will usually just call USER32!LoadImage with the LR_LOADFROMFILE flag so if the image does not load you have to blame Windows. 32bpp ARGB bitmaps are really only supported when they use the v4 or v5 bitmap header IIRC and the static control that is used to display the image can probably only handle ARGB on WinXP+.

      If you look at the MSDN documentation for BITMAPV4HEADER you will see this for 32bpp BI_RGB: "The value for blue is in the least significant 8 bits, followed by 8 bits each for green and red. The high byte in each DWORD is not used." Some people probably store alpha data there anyway but it might not always work. You are probably supposed to use 32bpp BI_BITFIELDS so you can set bV4AlphaMask but even this is not officially supported AFAIK.

       
  • Heiko Schäfer

    Heiko Schäfer - 2014-12-17

    It is a miracle for me that there are people out who voluntary LIKE to develop for Winf*ck (sorry). The installer itself is for a port of a Linux program to Windows and I can tell horror stories about my #if _WIN32 uses.

    Windows has such a strange and in many points almost unusable API...

    My provided command just evaluates the Alpha channel to use the white background and afterward removes it. The final BMP has no more Alpha channel. But interesting was, without BMP3 prepended the Photo Viewer shipped with Win7 displayed the BMP while NSIS not.

     

Log in to post a comment.