Archive: problem with umui


problem with umui
i tried to create a setup with umui but it looks like this :D
http://bildupload.sro.at/a/images/umui.jpg



here is the script:


SetCompressor lzma


;MUI SETTINGS
!include "UMUI.nsh"


!define UMUI_SKIN blue
!define MUI_ICON "GRM_48.ico"

;Installer Pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "licence.rtf"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

;Uninstaller Pages
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_COMPONENTS
!insertmacro MUI_UNPAGE_DIRECTORY
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH



;Languages
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "English"




;--------------------------------
Name "Gothic Reloaded Mod"
OutFile "GRM.exe"
InstallDir "$PROGRAMFILES\PiranhaBytes\Gothic"
;--------------------------------

Function .onGUIInit
;/////////////////////////////////////////
InitPluginsDir
SetOutPath $PLUGINSDIR
File "background.bmp"
BgImage::setBg /NOUNLOAD /FILLSCREEN "$PLUGINSDIR\background.bmp"
BgImage::Redraw /NOUNLOAD
;/////////////////////////////////////////
FunctionEnd





Function .onInit

!insertmacro MUI_LANGDLL_DISPLAY
InitPluginsDir



;--------------------------------
; SetOutPath $PLUGINSDIR
; File "Installer_loop.mp3"
; System::Call 'msvfw32.dll::MCIWndCreate(i 0, i 0,i 0x0070, t "$PLUGINSDIR\Installer_loop.mp3") i .r0'
; StrCpy $hmci $0
; SendMessage $hmci 0x0490 0 0 $0
; IntCmp $0 0 nosup
; ShowWindow $hmci SW_HIDE
; SendMessage $hmci 0x0465 0 "STR:play repeat"
; nosup:
;--------------------------------


FunctionEnd


;Sections
;/////////////////////////////////////////////////////
;/////////////////////////////////////////////////////
Section "Gothic1-mod" G1
SectionIn RO

;Icon und INI in System kopieren
SetOutPath "$INSTDIR\System"
File ".\install\System\GRM.ini"
File ".\install\System\GRM_48.ico"

;.mod in modvdf kopieren
SetOutPath "$INSTDIR\Data\modvdf"
File ".\install\Data\modvdf\GRM.mod"


;Uninstaller
WriteUninstaller "$INSTDIR\GRM-Uninstall.exe"

;Save Ordner
CreateDirectory "$INSTDIR\saves_GRM\current"
SectionEnd




Section "Gothic Reloaded Mod" GRM
;Icon und INI in System kopieren
SetOutPath "$INSTDIR\System"
File ".\install\System\GRM.ini"
File ".\install\System\GRM_48.ico"
SectionEnd
;/////////////////////////////////////////////////////
;/////////////////////////////////////////////////////




LangString DESC_G1 ${LANG_ENGLISH} "Gothic 1 Modification for the game Gothic 2"
LangString DESC_GRM ${LANG_ENGLISH} "More detailed meshes and better textures to improve the graphics of the game"

LangString DESC_G1 ${LANG_GERMAN} "Gothic 1 Mod für Gothic 2"
LangString DESC_GRM ${LANG_GERMAN} "Detailreichere Meshes und bessere Texturen für Gothic 1"

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${G1} $(DESC_G1)
!insertmacro MUI_DESCRIPTION_TEXT ${GRM} $(DESC_GRM)
!insertmacro MUI_FUNCTION_DESCRIPTION_END








Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "Gothic Reloaded wurde erfolgreich deinstalliert."
FunctionEnd







Section "Uninstall"

Delete "$INSTDIR\System\GRM.ini"
Delete "$INSTDIR\Data\modvdf\GRM.mod"
Delete "$INSTDIR\DS-Uninstall.exe"


RMDir "$INSTDIR\Data\modvdf"
SectionEnd



also the window to select the language doesnt show up
and the part to play background music isnt working -> error while compiling in line: "StrCpy $hmci $0"


thx for all help i may will get :D
and sorry for the bad english

Calling the language dialog/page is a bit different in UMUI:

In your ".onInit" function, instead of

!insertmacro MUI_LANGDLL_DISPLAY


you must use this code:

!insertmacro UMUI_MULTILANG_GET


Also you must use this as your very first page:

!insertmacro UMUI_PAGE_MULTILANGUAGE



BTW: Is that variable $hmci defined anywhere?

If not, you'll have to add this at the top of your script:

Var $hmci

Var hmci


ohhhh :D ... i forgot to copy the variable xD

anyway
the compiler says

"macro named UMUI_PAGE_MULTILANGUAGE not found"


i also searched in files with an editor for "UMUI_PAGE_MULTILANGUAGE" but found nothing


It's definitely there. It's in the following file:
NSIS\Contrib\UltraModernUI\UMUI.nsh (Line 4813)

Maybe you use an outdated version of UMUI ???

Get the latest release here:
http://sourceforge.net/project/showf...ease_id=608330


it realy was an older version^^

the display-problem with the gui is also fixed now

thx :)

edit: it seems when i select a language and hit "next"
the .onGuiInit function is called again so the musik starts from the beginning ^^

edit2: strange :D the problem only appears when i choose german language


The language cannot be changed when the installer is already running. That is why MUI shows the language dialog before the installer window appears. In contrast to MUI, UMUI uses an integrated language selection page. So it starts the installer with the default language. In case you keep that language, the installer simply continues with the next page. But in case you switch language, UMUI will have to restart your installer executable and pass the new language via commandline parameter. If you keep that in mind, the behavior you describe is not strange at all...


thx for the explanation

is there a way to set german standart language?
so the drop down list will not look like this at the beginning
http://bildupload.sro.at/a/images/la...-dialogbox.jpg


There is no need to set the default language explicitly. The first language (German in your script) will be the default language. And it should be selected by default.

Maybe you should have a closer look at:
NSIS\Examples\UltraModernUI\MultiLanguage.nsi ;)


yes i thought so too
but the default language is still english ^^


thx i will have a look at the example :)


Originally posted by EvilTwin1
yes i thought so too
but the default language is still english
Maybe your installer stored the language that was selected on a previous install in the registry. So now it will load the default language from the registry, instead of defaulting to the first language. Simply delete all reg values written by the installer to test the behavior on a "fresh" system...

!define UMUI_PARAMS_REGISTRY_ROOT "HKLM"
!define UMUI_PARAMS_REGISTRY_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MyApplication"
!define UMUI_LANGUAGE_REGISTRY_VALUENAME "Language"
!define UMUI_LANGUAGE_ALWAYSSHOW