Skip to content
⌘ NSIS Forum Archive

Custom Page Images

9 posts

wag2639#

Custom Page Images

I was able to make a custom page with using MUI and custom pages. I put an image in it (bmp) and it seemed to work while the compiled installer and the image are in the same directory, but if I move the installer, it no longer shows the image. Any suggestions?
Anders#
Your image needs to be in $pluginsdir (extract it before you create the custom page), so the path to the image should look something like "$pluginsdir\someimage.bmp" and NOT a path on your local machine "c:\myinstaller\someimage.bmp" etc
wag2639#
Thanks. It makes sense but where do I acutally put my image file then and where do I define the image path to "$pluginsdir\someimg.bmp", in the MUI_INSTALLOPTIONS_EXTRACT line or in my ini file?
Afrow UK#
Extract the file to $PLUGINSDIR at run time as said and write the exact path into the INI file with MUI_INSTALLOPTIONS_WRITE.

Stu
wag2639#
Thanks guys. I still don't know to do it with the $PLUGINSDIR. This is for others who might read this later. My coworker who did most of the programming for the installer anyway (I'm just skinning it) told me to just put in this:
'File "plugins\soldier.bmp"' into the init function. Then you can just say Text=soldier.bmp in your ini file.
Anders#
that should probably be File "/oName=$pluginsdir\soldier.bmp" "pathonbuildsystem\soldier.bmp"

and you should also use MUI_INSTALLOPTIONS_WRITE or WriteIniStr to set the full path ("$pluginsdir\soldier.bmp") instead of just soldier.bmp
wag2639#
Hey guys, I'm back at this and it isn't working. I'm not even sure if it worked last time or if it was just a fluke on my computer.

Right now, in my function for my custom page, I have:
!insertmacro INSTALLOPTIONS_EXTRACT "$PLUGINSDIR\soldier.bmp"
!insertmacro INSTALLOPTIONS_WRITE "welcome.ini" "Field 3" "Text" "$PLUGINSDIR\soldier.bmp"
Afrow UK#

ReserveFile `soldier.bmp`
File `/oname=$PLUGINSDIR\soldier.bmp` `soldier.bmp`
!insertmacro MUI_INSTALLOPTIONS_WRITE "welcome.ini" "Field 3" "Text" "$PLUGINSDIR\soldier.bmp"
Stu