Archive: SetBrandingImage error


SetBrandingImage error
Hi everybody. It's been a long time since I was around here last time, so I welcome you all in 2006 :- D.

I've been trying to add a branding image to my installer. But the NSIS compiler issues the following error:
"Error: no branding image found in chosen UI".

I tried putting this in .onInit and didn't work.. then I put it like this:

< CODE >
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd

Section "My main installation" SEC01
SetOutPath "$INSTDIR"
File "ASD.bmp"
SetBrandingImage "$INSTDIR\ASD.bmp"
SetOverwrite on
< CODE >

Then I tried putting it in onGUIInit but it says "Error: Function named ".onGUIInit" already exists" allthough I only declared it once.

Secondly, what size should the branding image be? I put 164 x 314, as I saw that the original was... is this correct?

Thank you in advance for your help :- ).

How can I make it work?? :- ).


Hm
I just saw something after I searched the forum, but I don't know if it'll work. Anyway, my question about the size remains. If I put that size will NSIS still auto-calculate stuff?


Before using SetBrandingImage, you must use AddBrandingImage or add your own branding image control to the UI. AddBrandingImage accepts a size parameter and prints out the size that eventually came out.


Thanks
Hi again kichik ::- ). You do know you're in my "Thanks to" file right? ::- D. This is for the installer for the Beta 2 of my freeware application and I mentioned in the thanks section (almost) everybody that helped in any area of the project.

Hm. I suspected something about AddBrandingImage. But hey, I searched through this forum and investigated some posts and stuff like this really makes me dizzy:

< CODE >

!macro BIMAGE IMAGE PARMS
Push $0
GetTempFileName $0
File /oname=$0 "${IMAGE}"
SetBrandingImage ${PARMS} $0
Delete $0
Pop $0
!macroend

[...]

!insertmacro BIMAGE "${NSISDIR}\pics\tmp1.bmp" "/RESIZETOFIT"

< CODE >

So what's all this? I don't see any use of AddBrandingImage, just SetBrandingImage. This code is taken from:

http://forums.winamp.com/showthread....ding+AND+image


I apologize for not reading quite so much from the NSIS documentation as I would have liked too, but you are a developer so you MUST now how hard it is to do everything on your own :- ). I barely have time to eat due to the deadlines I self-impose to myself.


That thread doesn't contain a complete example. Examples\gfx.nsi contains a complete example that uses both AddBrandingImage and SetBrandingImage.


Yes
And where can I see the image that the installer will use for a picture? It will output it at compilation time?


No, you set that using SetBrandimgImage. AddBrandingImage adds the image control to the UI and SetBrandimgImage sets the image on the control.


Size
There were lots of discussions around here about picture size. I would prefer to dictate a size for the image control and put in that a picture of the same size. For example if I say 200x50, to keep it that way. But as far as I saw, it's more complicated than that.

Anyway, I did my important stuff for now with
MUI_WELCOMEFINISHPAGE_BITMAP

I'll probably leave this as is for the time being because on 25 January I got to release Beta 2 for my freeware application and this is really pressing me.