Archive: localized MUI_WELCOMEFINISHPAGE_BITMAP


localized MUI_WELCOMEFINISHPAGE_BITMAP
I'm writing a multi-language installer with MUI2 and everything is working except that I'm having problems getting a localized banner graphic to work. I'm using a string called $LangCode to determine which directory to pull localized resources from. When I use something like:

!define MUI_WELCOMEFINISHPAGE_BITMAP "c:\srcDir\$(LangCode)\banner.bmp"

I'm getting a compile error about banner.bmp not being found. I'm using a language dialog to select the language. So my question is how do I get the welcome / finish pages to show a localized graphic without writing separate exes for each language?

Thanks,

Brian


That won't work. How can the compiler compress a file at compile time that is under a path that you determine at run time?

You need to extract a different bitmap depending on the language before the welcome page is displayed. Define your own MUI_PAGE_CUSTOMFUNCTION_SHOW and in that function you can set the new bitmap with this code:

${NSD_SetImage} $mui.WelcomePage.Image $PLUGINSDIR\modern-wizard.bmp $mui.WelcomePage.Image.Bitmap

Just extract the localized bitmap as $PLUGINSDIR\modern-wizard.bmp first. To extract a bitmap depending on the language, use a ${Switch} or ${If} ... ${ElseIf} with $LANGUAGE.

Stu


Thanks for the help, but I think I'm missing a few steps here. I'm pretty new to NSIS and although I have a complex installer working, I'm still slow. I'm not sure how to define the custom function MUI_PAGE_CUSTOMFUNCTION_SHOW. Can you give me a little more detail? Also, which function do I use to extract a bitmap?

On a related note, I can use runtime variables in !define statements at compile time, right? For example, this seems to work:

!define MUI_LANGDLL_REGISTRY_KEY "Software\MyCompany\$(AppName)"

Where $(AppName) is determined by the language selection.

-- Brian


Hi,

It looks like I finally got this working after struggling all day. But I'm using CopyFiles to copy the modern-wizard.bmp file to $PLUGINSDIR inside of my custom SHOW function. This works but doesn't seem exactly right. I think I should be using the File command to extract it. Where would I put the File command so that it extracts the file before the first call to SHOW?

Thanks,

Brian


Just use the File instruction with the /oname= switch like so:

${Switch} $LANGUAGE
${Case} ${LANG_ENGLISH}
File /oname=$PLUGINSDIR\modern-wizard.bmp english.bmp
${Break}
${Case} ${LANG_FRENCH}
...
${Default}
...
${EndSwitch}

Edit: You may also want to use ReserveFile on those bitmaps so they are extracted quickly.

Stu