Old 24th October 2007, 00:15   #1
wag2639
Junior Member
 
Join Date: Oct 2007
Posts: 16
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?
wag2639 is offline   Reply With Quote
Old 24th October 2007, 00:20   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,356
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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 24th October 2007, 18:06   #3
wag2639
Junior Member
 
Join Date: Oct 2007
Posts: 16
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?
wag2639 is offline   Reply With Quote
Old 24th October 2007, 18:58   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Extract the file to $PLUGINSDIR at run time as said and write the exact path into the INI file with MUI_INSTALLOPTIONS_WRITE.

Stu
Afrow UK is offline   Reply With Quote
Old 24th October 2007, 19:55   #5
wag2639
Junior Member
 
Join Date: Oct 2007
Posts: 16
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.
wag2639 is offline   Reply With Quote
Old 24th October 2007, 20:25   #6
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,356
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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 6th November 2007, 20:09   #7
wag2639
Junior Member
 
Join Date: Oct 2007
Posts: 16
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"
wag2639 is offline   Reply With Quote
Old 6th November 2007, 20:45   #8
wag2639
Junior Member
 
Join Date: Oct 2007
Posts: 16
i got it to work by replacing $pluginsdir with $TEMP
wag2639 is offline   Reply With Quote
Old 6th November 2007, 20:46   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
code:

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



Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump