fishsauce
27th June 2007 21:49 UTC
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.
Afrow UK
27th June 2007 21:54 UTC
What happens if you use MUI and not XPUI?
Stu
fishsauce
28th June 2007 00:26 UTC
If I change everything to MUI the same thing happens... so it's probably not XPUI's fault.
fishsauce
28th June 2007 04:11 UTC
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.
Joel
28th June 2007 04:58 UTC
Try InitPluginsDir on .onInit
fishsauce
28th June 2007 09:15 UTC
It still crashes even with InitPluginsDir
Afrow UK
28th June 2007 11:35 UTC
Please attach your INI file.
Stu
fishsauce
28th June 2007 19:38 UTC
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
Afrow UK
28th June 2007 22:38 UTC
What happens if you don't use Flags=TRANSPARENT?
Stu
fishsauce
28th June 2007 23:46 UTC
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!
kichik
29th June 2007 08:17 UTC
What exactly do you mean by crashing? Can you attach the bitmap?