Skip to content
⌘ NSIS Forum Archive

Puting an image into a custom page

14 posts

Potz#

Puting an image into a custom page

I am using the HM NIS Edit program and I see there is a Bitmap icon to insert an image I am assuming... but how would you set the image?
Potz#
so I use something like this
File /oname=$PLUGINSDIR\iw.ico iw.ico

then how would I set that to a custom page?
Potz#
Well I thought I was set but when I run the script it is blank... I can see the icon on the ini file when I am editing it in HM NIS Edit. You said something about extracting the image before but I wasn’t exactly sure what you meant.
Afrow UK#
The File instruction code you posted will work.
Make sure you use are using MUI_INSTALLOPTIONS_EXTRACT as well.

-Stu
Potz#
ok I am sure this is wrong... but I am not sure if I am putting the code in the right spot. When you are talking about using the MUI_INSTALLOPTION_EXTRACT you mean for the image right?

here is my code... I probably butchered this really good lol.

Function IconPage

!insertmacro MUI_HEADER_TEXT "Choose an Icon" "From the selection below"
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "iw.ico"


!insertmacro MUI_INSTALLOPTIONS_EXTRACT "iconPage.ini"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "iconPage.ini"
File /oname=$PLUGINSDIR\iw.ico iw.ico



FunctionEnd

this is just my custom page. It is all working like it should just not showing the image.
Afrow UK#
MUI_INSTALLOPTIONS_EXTRACT is for INI files only.
Remove the MUI_INSTALLOPTIONS_EXTRACT "iw.ico" line.
Move the File instruction above the DISPLAY line.
Logically, you can't display the image if you're extracting it after you show the page?

-Stu
Potz#
ok... I did have it that way before and it wasn't working... I tried that again with the fixes you told me and it still is not showing up.
Afrow UK#
Try this before the DISPLAY call:
SetOutPath $PLUGINSDIR
If that doesn't work, then try this before the call instead:
!insertmacro MUI_INSTALLOPTIONS_WRITE "iconPage.ini" "Field #" "Text" "$PLUGINSDIR\iw.ico"
Where # is the Bitmap control Field number.

And if that doesn't work, then please attach your INI file.

-Stu
Potz#
I just realized that when I use the Icon box it works but if I use the Bitmap it dosen't. I guess I have figured out the problem now... thanks for helping 🙂