Archive: Mui problem


Mui problem
Hi, can you help me with this one :

When i use MUI_PAGE_FINISH i get

resolving install function "Nsis2Io" in function "mui.FinishPre_159.5.9"
Note: uninstall functions must begin with "un.", and install functions must not
Error - aborting creation process

on compilation

Here's the code :

;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Languages selection
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
!ifdef LANG_EN
!include "lang_en.nsh"
!InsertMacro MUI_LANGUAGE "English"
LicenseLangString license ${LANG_ENGLISH} "..\..\lic\license_en.txt"
!EndIf
!ifdef LANG_FR
!include "lang_fr.nsh"
!InsertMacro MUI_LANGUAGE "French"
LicenseLangString license ${LANG_FRENCH} "..\..\lic\license_fr.txt"
!EndIf
!ifdef LANG_ES
!include "lang_es.nsh"
!InsertMacro MUI_LANGUAGE "Spanish"
LicenseLangString license ${LANG_SPANISH} "..\..\lic\license_sp.txt"
!EndIf
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Interface Configuration for pages and executables
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; UAC Vista
RequestExecutionLevel Admin
;The icon for the installer.
!IfDef MUI_ICON
!UnDef MUI_ICON
!EndIf
!Define MUI_ICON "..\..\bmp\icon_16x16.ico"
;The icon for the uninstaller.
!IfDef MUI_UNICON
!UnDef MUI_UNICON
!EndIf
!Define MUI_UNICON "..\..\bmp\icon_16x16.ico"
;Display settings
;!Define MUI_HEADERIMAGE
;Bitmap image to display on the header of installers pages.
!Define MUI_HEADERIMAGE_BITMAP "..\..\bmp\install_haut_nsis.bmp"
;Do not stretch the installer header bitmap to fit the size of the field.
!Define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
;Bitmap image to display on the header of uninstaller pages.
!Define MUI_HEADERIMAGE_UNBITMAP "..\..\bmp\install_haut_nsis.bmp"
;Do not stretch the uninstaller header bitmap to fit the size of the field.
!Define MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH
;Show a message box with a warning when the user wants to close the installer.
!Define MUI_ABORTWARNING
;Set the Cancel button as the default button on the message box.
!Define MUI_ABORTWARNING_CANCEL_DEFAULT
;Show a message box with a warning when the user wants to close the uninstaller.
!Define MUI_UNABORTWARNING
;Set the Cancel button as the default button on the message box.
!Define MUI_UNABORTWARNING_CANCEL_DEFAULT
;
!Define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!Define MUI_LANGDLL_REGISTRY_KEY "Software\${EDITOR_NAME}\${PRODUCT_NAME}"
!Define MUI_LANGDLL_REGISTRY_VALUENAME "Language"
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Install Pages
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;Welcome Page
!Include "WelcomePage.nsh"
!Define MUI_PAGE_CUSTOMFUNCTION_PRE GetPreRequisites
!IfDef MUI_WELCOMEFINISHPAGE_BITMAP
!UnDef MUI_WELCOMEFINISHPAGE_BITMAP
!EndIf
!Define MUI_WELCOMEFINISHPAGE_BITMAP "..\..\bmp\install_gauche_nsis.bmp"
!Define MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH
!InsertMacro MUI_PAGE_WELCOME
;License Page
!InsertMacro MUI_PAGE_LICENSE $(license)
;Detect Page
!Include "DetectPage.nsh"
Page custom CreatorDetectPage LeaveDetectPage
;Authenticate Page
!ifdef AuthenticateUser
;!Define MUI_PAGE_CUSTOMFUNCTION_LEAVE SaveEMail
!Include "AuthenticateUserPage.nsh"
Page custom AuthenticateUser SaveEMail
!EndIf
;!InsertMacro MUI_PAGE_DIRECTORY
;Start menu Page
!Include "StartMenuPage.nsh"
;The default Start Menu Folder.
!Define MUI_STARTMENUPAGE_DEFAULTFOLDER "${PRODUCT_NAME}"
;The registry keys to store the Start Menu folder
!Define MUI_STARTMENUPAGE_REGISTRY_ROOT HKCU
!Define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${EDITOR_NAME}\${PRODUCT_NAME}"
!Define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!Define MUI_PAGE_CUSTOMFUNCTION_PRE DeletePreviousShortcuts
!InsertMacro MUI_PAGE_STARTMENU "Application" $STARTMENU_FOLDER
;Install Files Page
!InsertMacro MUI_PAGE_INSTFILES
;Finish Page
!Include "FinishPage.nsh"
!Define MUI_PAGE_CUSTOMFUNCTION_PRE PreFinish
!Define MUI_PAGE_CUSTOMFUNCTION_SHOW ShowFinish
!Define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveFinish
!Define MUI_FINISHPAGE_RUN "$INSTDIR\${PRODUCT_NAME}.exe"
!InsertMacro MUI_PAGE_FINISH

Here's the code of the customized finish page :

################################################################################
# FINISHPAGE #
################################################################################
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;install Finish Page functions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
Function PreFinish
; Description : load et show interface
; Parameters : none
!InsertMacro MUI_INSTALLOPTIONS_READ $R0 "ioSpecial.ini" "Settings" "NumFields"
IntOp $R0 $R0 + 1
;update fields count
!InsertMacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "NumFields" "$R0"
;Add Desktop Shortcut checkbox
!InsertMacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field $R0" "Type" "CheckBox"
!InsertMacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field $R0" "Text" "$(txtCreateDesktopShortcut)"
!InsertMacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field $R0" "Left" "120"
!InsertMacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field $R0" "Right" "315"
!InsertMacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field $R0" "Top" "150"
!InsertMacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field $R0" "Bottom" "160"
!InsertMacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field $R0" "State" "1"
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function ShowFinish
; Description : Checks if Windows version is Vista and hide checkbox Launch EXE
; Parameters : none
xtInfoPlugin::GetWindowsVersion
Push "5.99999"
xtInfoPlugin::CompareVersion
Pop $0
${If} $0 == "-1"
;Get windows
;FindWindow $0 "#32770" "" $HWNDPARENT
;Get start program checbox control
GetDlgItem $2 $MUI_HWND "1203"
;Uncheck it
SendMessage $2 ${WM_LBUTTONDOWN} 0 0
SendMessage $2 ${WM_LBUTTONUP} 0 0
;Hide it
ShowWindow $2 ${SW_HIDE}
${EndIf}
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function LeaveFinish
; Description : Read checkboxes and execute (or not)
; - Shortcut creation
; - launch .Exe
; Send message to Server (end install)
; Parameters : none
!InsertMacro MUI_INSTALLOPTIONS_READ $R0 "ioSpecial.ini" "Settings" "NumFields"
!InsertMacro MUI_INSTALLOPTIONS_READ $R0 "ioSpecial.ini" "Field $R0" "State"
StrCmp $R0 "0" ENDCREATESHORTCUT CREATESHORTCUT
CREATESHORTCUT:
CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe" "" "$INSTDIR\${PRODUCT_NAME}.exe" 0
WriteRegDWORD HKCU "Software\${EDITOR_NAME}\${PRODUCT_NAME}" "desktopshortcut" "1"
ENDCREATESHORTCUT:
WriteRegDWORD HKCU "Software\${EDITOR_NAME}\${PRODUCT_NAME}" "desktopshortcut" "0"
SENDFINISHTOSERVER: ;Send request to server
!InsertMacro MUI_INSTALLOPTIONS_READ $R0 "ioSpecial.ini" "Field 4" "State"
IntOp $R0 2 - $R0
Push "URL_ENDINSTALL"
!InsertMacro SetUrlMessage $R0
Pop $0
inetc::get "$0" "$TEMP\End.txt"
Pop $0
StrCmp $0 "OK" SENDFINISHOK
SENDFINISHERR:
SENDFINISHOK:
DELETE "$TEMP\End.txt"
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

I've seen one recent previous post with similar error but the guy changes his code and doesn't reproduce it. I wonder what i'm doing wrong or if there's a bug in MUI ?

thx.


I've found the solution. It's just that i miss the right order of includes (Languages selection after Install Pages and not before)