Old 21st July 2008, 11:06   #1
Brewster333
Junior Member
 
Join Date: Jul 2008
Location: Ivanovo, Russia
Posts: 16
Question Multilanguage header

Hello! I need help... I'm trying to create multilanguage setup using MUI2. I'm using defines:

!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "Header.bmp"
!define MUI_WELCOMEFINISHPAGE_BITMAP "Wizard.bmp"

All works perfectly, but I need use different images for each language... Witch way I can do it (if it is possible)???
Thank you for your help.
Brewster333 is offline   Reply With Quote
Old 21st July 2008, 12:34   #2
pospec
Senior Member
 
pospec's Avatar
 
Join Date: Jun 2007
Location: Otrokovice, Czech Republic
Posts: 308
I believe that you can use a variable instead of the filename and fill the variable in onInit with some language string.

I didn't tried it.

EDIT: Ooops, it doesn't work...
pospec is offline   Reply With Quote
Old 21st July 2008, 13:50   #3
Brewster333
Junior Member
 
Join Date: Jul 2008
Location: Ivanovo, Russia
Posts: 16
I trying different ways to solve this problem (image substitution in .onGUIInit, MUI_HEADERIMAGE_BITMAP redefining), but it does not woking... May be ChangeUI function help me? I am a novice in NSIS-script developing and don't know which parameters use for ChangeUI...
Brewster333 is offline   Reply With Quote
Old 21st July 2008, 14:46   #4
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
LanguageString!

code:
LangStr HeaderImage ${LANG_ENGLISH} "Header_EN.bmp"
LangStr HeaderImage ${LANG_GERMAN} "Header_DE.bmp"
LangStr WizardImage ${LANG_ENGLISH} "Wizard_EN.bmp"
LangStr WizardImage ${LANG_GERMAN} "Wizard_DE.bmp"

!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "$(HeaderImage)"
!define MUI_WELCOMEFINISHPAGE_BITMAP "$(WizardImage)"


My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 21st July 2008, 15:28   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Neither will work because it needs to include the image file at compile time. For the header image you can extract a new image depending on $LANGUAGE and set it with SetBrandingImage. For the welcome and finish pages you should be able to extract a new bitmap file to $PLUGINSDIR overwriting the existing one in a function set with MUI_PAGE_FUNCTION_GUIINIT.

Stu
Afrow UK is offline   Reply With Quote
Old 22nd July 2008, 06:21   #6
Brewster333
Junior Member
 
Join Date: Jul 2008
Location: Ivanovo, Russia
Posts: 16
Thanks for help. Solution is simple as usual.
Brewster333 is offline   Reply With Quote
Old 22nd July 2008, 08:18   #7
Brewster333
Junior Member
 
Join Date: Jul 2008
Location: Ivanovo, Russia
Posts: 16
A new trouble. Method with using LangString is not working (as Afrow UK says). I using an image substitution in .onGUIInit. Script fragment:

***
!include MUI2.nsh
***
!define MUI_CUSTOMFUNCTION_GUIINIT GUIInit
***
ReserveFile "HeaderEN.BMP"
ReserveFile "WizardEN.BMP"
***
Function GUIInit
File /oname=$PLUGINSDIR\bg.bmp bg.bmp
BgImage::SetBg /NOUNLOAD /TILED "$PLUGINSDIR\bg.bmp"
BgImage::Redraw /NOUNLOAD

IntCmp $LANGUAGE ${LANG_RUSSIAN} End CopyImages CopyImages
CopyImages:
File /oname=$PLUGINSDIR\modern-header.bmp HeaderEN.bmp
File /oname=$PLUGINSDIR\modern-wizard.bmp WizardEN.bmp
#MessageBox MB_OK $PLUGINSDIR
End:

FunctionEnd

I see that images in $PLUGINSDIR are replaced. Start and Finish pages are using new WizardEN.BMP (substituted bitmap), but header uses old bitmap... May be old header image has been cached? May be I must make it in other place (I try make it on .onInit, but in this case all images are not changed)? Where is problem? Thanks for support.
Brewster333 is offline   Reply With Quote
Old 22nd July 2008, 12:39   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
As I said you have to use SetBrandingImage as well:
SetBrandingImage /IMGID=1046 "$PLUGINSDIR\modern-header.bmp"

Edit: I also recommend using LogicLib:

${If} $LANGUAGE == ${LANG_RUSSIAN}
...
${EndIf}

Stu
Afrow UK is offline   Reply With Quote
Old 22nd July 2008, 14:41   #9
Brewster333
Junior Member
 
Join Date: Jul 2008
Location: Ivanovo, Russia
Posts: 16
SetBrandingImage solves this problem! Now I using LogicLib
BIG thanks for support!
Brewster333 is offline   Reply With Quote
Old 1st September 2013, 02:05   #10
didava
Member
 
Join Date: May 2007
Posts: 98
Greetings

I've tested this

Does not work

Sample code to write the

Thanks...
didava is offline   Reply With Quote
Old 1st September 2013, 12:10   #11
didava
Member
 
Join Date: May 2007
Posts: 98
Professors ؟؟
I'm waiting ؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟؟


Should I open a new Post
didava is offline   Reply With Quote
Old 1st September 2013, 21:56   #12
didava
Member
 
Join Date: May 2007
Posts: 98
no work?

Quote:
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
${if} $LANGUAGE == ${LANG_GERMAN}
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "$EXEDIR\GRheader.bmp"
${ElseIf} $LANGUAGE == ${LANG_ENGLISH}
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "$EXEDIR\ENheader.bmp"
${EndIf}
FunctionEnd
Why not work؟؟
didava is offline   Reply With Quote
Old 1st September 2013, 23:43   #13
didava
Member
 
Join Date: May 2007
Posts: 98
Quote:

LangString HEADER_IMAGE ${LANG_ENGLISH} "misc\dialogs\modern_headerbmpen.exe"
LangString HEADER_IMAGE ${LANG_GERMAN} "misc\dialogs\modern_headerbmpge.exe"



Quote:

!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "misc\images\header.bmp"
!define MUI_UI_HEADERIMAGE "$(HEADER_IMAGE)"
!define MUI_ABORTWARNING

Quote:


Error: Can't open "$(HEADER_IMAGE)"!
Error in macro MUI_INTERFACE on macroline 57
Error in macro MUI_PAGE_INIT on macroline 7
Error in macro MUI_PAGE_LICENSE on macroline 5
Error in script "F:\new system\Setup.nsi" on line 97 -- aborting creation process

didava is offline   Reply With Quote
Old 1st September 2013, 23:51   #14
didava
Member
 
Join Date: May 2007
Posts: 98
PHP Code:


                          LangString HEADER_IMAGE 
${LANG_ENGLISH"misc\images\ENheader.bmp"
                          
LangString HEADER_IMAGE ${LANG_GERMAN"misc\images\geheader.bmp"


                         
!define MUI_HEADERIMAGE
                         
!define MUI_HEADERIMAGE_BITMAP "$(HEADER_IMAGE)" 

I do not know

Somebody could help
Make an example?
didava is offline   Reply With Quote
Old 2nd September 2013, 08:45   #15
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 533
Send a message via ICQ to T.Slappy
I think paths to your images are wrong.
The language is not initialized on .onInit, chcek the language immediately after .onInit function finishes.

Cool looking installer with custom design: www.graphical-installer.com
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned.sk
Develop NSIS projects in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump