Archive: Uninstall header images not showing


Uninstall header images not showing
  My installer works great, with all images showing. The uninstaller on the other hand is showing no header or side image whatsoever. I don't quite understand it as the syntax seems correct, the graphics are in the directory quoted and the uninstaller icon is correct.

Extracted from my code:


; -----------------------------

;Includes & Defines

>!include "..\common\src\GlobalDefines.nsh"
>!include "MUI.nsh"

(...)

; -----------------------------
;Modern Interface

; MUI Settings
>!define MUI_ABORTWARNING

>; MUI Settings / Icons
>!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
>!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"

>; MUI Settings / Header
>!define MUI_HEADERIMAGE
>!define MUI_HEADERIMAGE_RIGHT
>!define MUI_HEADERIMAGE_BITMAP "${GRAPHICS_DIR}\installtop.bmp"
>!define MUI_HEADERIMAGE_UNBITMAP "${GRAPHICS_DIR}\uninstalltop.bmp"

>; MUI Settings / Wizard
>!define MUI_WELCOMEFINISHPAGE_BITMAP "${GRAPHICS_DIR}\installside.bmp"
>!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${GRAPHICS_DIR}\uninstallside.bmp"

>(... including section writing the uninstaller ...)

; ========================
; Uninstaller

>!insertmacro MUI_UNPAGE_CONFIRM
>!insertmacro MUI_UNPAGE_INSTFILES
>!insertmacro MUI_UNPAGE_FINISH

>Function un.onGUIInit
; get instance from the uninstall.ini file
ReadIniStr $INSTANCE "$INSTDIR\Uninstall.ini" "Uninstall" "Instance"

; TODO - close application if it is running

FunctionEnd

Section "un.Uninstall all"

; Media
ReadIniStr$0 "$INSTDIR\Uninstall.ini" "Uninstall" "MediaDir"
${If} $0 != ""
Delete "$0\*.*"
RMDir "$0"
${EndIf}

; Database
ReadIniStr$0 "$INSTDIR\Uninstall.ini" "Uninstall" "DatabaseDir"
${If} $0 != ""
Delete "$0\*.*"
RMDir "$0"
${EndIf}

; Settings
ReadIniStr$0 "$INSTDIR\Uninstall.ini" "Uninstall" "InstanceType"
${If} $0 == "/reg"
DeleteRegKey HKLM "${IS_REGKEY}\${APP_NAME}\$INSTANCE"
${ElseIf} $0 == "/xml"
ReadRegStr $1 HKLM "${IS_REGKEY}\Paths" "AppConfigRoot"
Delete "$1\${APP_NAME}\Config-$INSTANCE.xml"
${EndIf}

; Launcher
; TODO - remove registration with launcher via LauncherManager

; Program Files
Delete "$INSTDIR\*.*"
RMDir "$INSTDIR"

; remove uninstaller entry from registry
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APP_NAME}-$INSTANCE"

; TODO - offer to remove Firebird as well...

>SectionEnd
>

see help for uninstall 4.6.2

The first Delete instruction works (deleting the uninstaller), because the uninstaller is transparently copied to the system temporary directory for the uninstall.

Check if your paths, especially ${GRAPHICS_DIR} are absolut. If not uninstaller will not find your background image. uninstall icon works with ${NSISDIR}. That will build an absolut path.

Try to put your images into $NSISDIR. If that works, you know its a common path error.


My ${GRAPHICS_DIR} is an absolute path, and is the same as the one used in the installer part, which works.
I also tried copying the images in ${NSISDIR} and change the code accordingly, to no avail.

Does anyone have another idea why my uninstaller wouldn't show the images?

Thanks


Please attach your code from your installer that works and of uninstaller that does not work. My first intention is that you have to tell to MUI that you want to extract the file to a path during un.onInit of Uninstaller. You have to use that path for dialogs. Your installer approach works, because you have NSIS installed and and those MUI macros insert and extract the graphic files during installation. During installtion on customer system there is (most probably) no NSIS installtion. That's why you have to care for extraction to proper/known path on customer system. MUI_INSTALLOPTIONS_EXTRACT and $PLUGINSDIR are two good keywords for your readings. I know my example is for custom dialogs, but it explains the idea as well.

Function un.onInit
;bitmap as background image
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "wizard.bmp"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "uninstallpage.ini"

define a custom page for uninstaller:
UninstPage custom un.ChooseUninstallationType un.CheckUninstallationType

When you do this you can refer to this picture in a custom function for custom dialogs:

Function un.ChooseUninstallationType

;needs to be done before initialising dialog - otherwise bitmap is missing
!insertmacro MUI_INSTALLOPTIONS_WRITE "uninstallpage.ini" "Field 1" "Text" "$PLUGINSDIR\wizard.bmp"

sorry for bad insertion of code snippets, but its just from my code. read 'Using InstallOptions for custom pages' in NSIS-MUI help for explanation of ressource file handling in installers/uninstallers!

Good luck!


This is not resolving my problem. the unistaller still doesn't show the image.