Archive: IO bitmap


IO bitmap
  I'm using normal installoptions2, and for some reason my code keeps on crashing if I try to display the bitmap.


"XPUI.nsh"


>Name "InstallOptions"
>OutFile "InstallOptions.exe"
>!define XPUI_ABORTWARNING

Page custom CustomPageA
>!insertmacro XPUI_PAGE_INSTFILES

>!insertmacro XPUI_LANGUAGE "English"

>ReserveFile "welcome.ini"
>ReserveFile "..\support\heading_welcome.bmp"
>!insertmacro XPUI_RESERVEFILE_INSTALLOPTIONS

Section"Dummy Section" SecDummy
SectionEnd

>Function .onInit
!insertmacro XPUI_INSTALLOPTIONS_EXTRACT "welcome.ini"
File "/oname=$PLUGINSDIR\image.bmp" "..\support\heading_welcome.bmp"
>FunctionEnd

>Function CustomPageA
!insertmacro XPUI_HEADER_TEXT "" ""
!insertmacro XPUI_INSTALLOPTIONS_WRITE "welcome.ini" "Field 1" "Text" "$PLUGINSDIR\image.bmp"
!insertmacro XPUI_INSTALLOPTIONS_WRITE "welcome.ini" "Field 2" "Text" "asdf asdf"
!insertmacro XPUI_INSTALLOPTIONS_DISPLAY "welcome.ini"
>FunctionEnd
>
Any ideas? Thanks!

And please ignore missing backslashes in the pathnames... for some reason they don't show up in the forum.

What happens if you use MUI and not XPUI?

Stu


If I change everything to MUI the same thing happens... so it's probably not XPUI's fault.


Double posting because it won't let me edit my old message...

I'm starting to suspect the bmp file itself. It used to be 24-bit, but I changed it to a 256 color bmp and it still doesn't work. Is there some special format the file itself needs to be in?

For the record, the pathname is properly written into the INI file and the image also extracts correctly. Using other bmps doesn't work either... I even tried a bmp that was being used by XPUI itself.

Thanks.


Try InitPluginsDir on .onInit


It still crashes even with InitPluginsDir


Please attach your INI file.

Stu


NSI:

!include "XPUI.nsh"

Name "InstallOptions"
OutFile "InstallOptions.exe"
!define XPUI_ABORTWARNING

Page custom CustomPageA
!insertmacro XPUI_PAGE_INSTFILES

!insertmacro XPUI_LANGUAGE "English"

ReserveFile "welcome.ini"
ReserveFile "heading_welcome.bmp"
!insertmacro XPUI_RESERVEFILE_INSTALLOPTIONS

Section "Dummy Section" SecDummy
SectionEnd

Function .onInit
InitPluginsDir
FunctionEnd

Function CustomPageA
!insertmacro XPUI_INSTALLOPTIONS_EXTRACT "welcome.ini"
File "/oname=$PLUGINSDIR\image.bmp" "heading_welcome.bmp"
!insertmacro XPUI_HEADER_TEXT "" ""
!insertmacro XPUI_INSTALLOPTIONS_WRITE "welcome.ini" "Field 1" "Text" "$PLUGINSDIR\image.bmp"
!insertmacro XPUI_INSTALLOPTIONS_DISPLAY "welcome.ini"
FunctionEnd


INI:

[Settings]
NumFields=1

[Field 1]
Type=Bitmap
Left=0
Right=140
Top=0
Bottom=300
Flags=TRANSPARENT


What happens if you don't use Flags=TRANSPARENT?

Stu


Oh, there we go... it works now! *kicks himself for not trying out something so simple first*

It's cut off on the left but I'm pretty sure I can fix that with a bit of tweaking the left/right arguments in the INI.

Thanks!


What exactly do you mean by crashing? Can you attach the bitmap?