Fstreit
16th May 2008 07:29 UTC
Background image
Hi
I'm trying to make a installation CD for my program. My installation is based on the NSIS Example (Example.nsi) that includes a background image. The original path is <<File /oname=$PLUGINSDIR\2.bmp "${NSISDIR}\Contrib\Graphics\Checks\modern.bmp">>. When I change the path to my installation directory <<...."$EXEDIR\mydirectory\Graphics\image.bmp">> I've got the error that it wasn't able to find my image, but it's there and the path is written right. It only works when I type in a unique path like <<"$E:\my...\..\image.bmp">>. But thats not possible because the device letter might change according to different pcs. How can I solve this problem? Please help me
pospec
16th May 2008 07:34 UTC
Path to BMP should be relative to directory where is your script.
e.g. File "/oname=pic.bmp" "Art\pic.bmp"
Afrow UK
16th May 2008 10:41 UTC
$EXEDIR is a run time constant. You are trying to use it at compile time for the source path when you should only use it with /oname in the destination path. As pospec says, use a source path relative to where the script is located.
Stu
Fstreit
16th May 2008 12:21 UTC
I tryed it but it didn't work. Maybe I've still got a mistake in it.
The directory of my istaller is <<E:\Install>>. This is where my Example.nsi is located. The image is under <<E:\Install\Graphics\image.bmp>>. I worte:
File /oname=$image.bmp "$Graphics\image.bmp"
and a bit later:
BgImage::AddImage /NOUNLOAD $Graphics\image.bmp 150 0
!insertmacro GetReturnValue
pospec
16th May 2008 12:23 UTC
Why do you prefix directory name with '$'?
Fstreit
16th May 2008 12:25 UTC
I thought it is a good idea :)
Fstreit
16th May 2008 12:32 UTC
I'm quite new in using Nsis. I didn't know it better.
But how do I have to write it then?
Afrow UK
16th May 2008 12:55 UTC
Remove the $.
Stu
Fstreit
16th May 2008 13:40 UTC
Now it works. Thanks for your help