Topic: Bonk: NSIS: How to have a BrandingImage  (Read 7798 times)

0 Members and 1 Guest are viewing this topic.

Offline FireSoul

  • Modder of shiplists
  • Lt. Commander
  • *
  • Posts: 1306
  • mew.
    • http://klingon.lostexiles.net/
Bonk: NSIS: How to have a BrandingImage
« on: September 14, 2004, 02:45:16 pm »
Hey Bonk. This is how I got the branding image for the directory server installer:

special note: the image used has to be installed on the HD for it to load up.


1- You need a custom 'page' that calls a function to set the brandimage.

Code: [Select]
;--------------------------------
Page custom brandimage "" ": Brand Image"
Page license
Page components
;Page directory
Page instfiles

UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------

2- Still at the top, you need to set the size of the brandimage window:
Code: [Select]
AddBrandingImage top 200



3- At the end of the script, have this function (which is called by the custom page). It installs the image into the standard windows temp directory, and sets it as the current image to show.
Code: [Select]
Function brandimage
  SetOutPath "$TEMP"

  SetFileAttributes mainlogo5.bmp temporary
  File mainlogo5.bmp
  SetBrandingImage "$TEMP\mainlogo5.bmp" /resizetofit
FunctionEnd



-- FIN --


Bonk: You own me a splash image howto.  ;D



Author: OP+ Mod
Maintainer: Coopace
Author: Fests+ for OP
Creator: SFC-OP Mini Updater
Maintainer: SFC-EAW for OP Campaigns
Kitbash: SFC2 models

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Bonk: NSIS: How to have a BrandingImage
« Reply #1 on: September 14, 2004, 10:58:30 pm »
Coolness, thanks! I got the easy part of the deal...

I'm using the following lifted right from one of the examples (in Contrib\Splash\Example.nsi in your NSIS installation):

Code: [Select]

Function .onInit
# the plugins dir is automatically deleted when the installer exits
InitPluginsDir
File /oname=$PLUGINSDIR\splash.bmp "blackhole.bmp"
#optional
#File /oname=$PLUGINSDIR\splash.wav "C:\myprog\sound.wav"

splash::show 3000 $PLUGINSDIR\splash

Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normal, and '-1' if some error occured.
FunctionEnd

I placed the .onInit function in my installer script then I specified my source image filename instead of the one in the example and edited the time to show it to 3000ms.

The advsplash.dll looks like fun too but have not played with it yet (Contrib\AdvSplash\Example.nsi). Lots of other neat stuff in that Contrib folder too...

Looks like you could use the "pluginsdir" for your brandimage function as well (as an alternative) like so:

Code: [Select]
Function brandimage
        # if not already done:
InitPluginsDir
File /oname=$PLUGINSDIR\mainlogo5.bmp "mainlogo5.bmp"
        SetBrandingImage "$PLUGINSDIR\mainlogo5.bmp" /resizetofit
FunctionEnd