Archive: AddBrandingImage


AddBrandingImage
  Hello,

short question. I would make a classic installer with
a top image on each page.
I've use

AddBrandingImage top 58

but how I've to add the image?

I hope someone can help me.

rien


Hi rien :)

Well, the instruction "AddBrandingImage" sets the "placeholder" for future images, but there are not set at this point.

First you have to copy the image(s) in the temporary directory :

Function .onInit

Initpluginsdir
SetOutPath $PLUGINSDIR
File "MyImagePath\\MyImage.bmp"
>FunctionEnd
>

Then you've got to add this instruction at the beginning of your dialog's "Show function":


SetBrandingImage "$PLUGINSDIR\\MyImage.bmp" 

If it's not clear enough, you might want to check these examples:

- Without the ModernUI:
NSIS\Examples\gfx.nsi

- With the ModernUI:

NSIS\Examples\Modern UI\Basic.nsi


I hope that helps :)

evilO/Olive

Hi evilO,

first thank you for your help, the compiler don't list errors, but I can't see "MyImage.bmp".
.

I read the examples, but I don't recognize your code.

Here my use of your posting:



...

AddBrandingImage top 58
WindowIcon off
Function .onInit
Initpluginsdir
SetOutPath $PLUGINSDIR
File "D:\MyImage.bmp"
FunctionEnd

Section "MyApp"

SetBrandingImage "$PLUGINSDIR\MyImage.bmp"
; Set Section properties
SetOverwrite on

; Set Section Files and Shortcuts
SetOutPath "$INSTDIR\"
File "..."
File "..."
File "..."
CreateShortCut "$DESKTOP\MyApp.lnk" "$INSTDIR\MyApp.exe"
CreateDirectory "$SMPROGRAMS\MyApp"
CreateShortCut "$SMPROGRAMS\MyApp\MyApp.lnk" "$INSTDIR\MyApp.exe"

SectionEnd

...


I think it's to complicated.

Rien

try:



...

AddBrandingImage top 58
WindowIcon off
Function .onInit
Initpluginsdir
SetOutPath $PLUGINSDIR
File "D:\MyImage.bmp"
FunctionEnd

Function .onGUIInit
SetBrandingImage "$PLUGINSDIR\MyImage.bmp"
FunctionEnd

Section "MyApp"

; Set Section properties
SetOverwrite on

; Set Section Files and Shortcuts
SetOutPath "$INSTDIR\"
File "..."
File "..."
File "..."
CreateShortCut "$DESKTOP\MyApp.lnk" "$INSTDIR\MyApp.exe"
CreateDirectory "$SMPROGRAMS\MyApp"
CreateShortCut "$SMPROGRAMS\MyApp\MyApp.lnk" "$INSTDIR\MyApp.exe"

SectionEnd

...


Hello zimsms,

perfect! Now the script works perfect.

Thank you to all helpers!

I ask me, why these kinds of examples Nsis not
have in his documentation.