Archive: Bitmap in the background


Bitmap in the background
Hi
I would like to add image to my installers.
I tried to do it, but without success
I saw similiar function in Setup Factory (see atachment)
I tried several methods and the best was this one:

!ifndef LR_LOADFROMFILE
!define LR_LOADFROMFILE 0x0010
!endif
!ifndef LR_CREATEDIBSECTION
!define LR_CREATEDIBSECTION 0x2000
!endif
!ifndef STM_SETIMAGE
!define STM_SETIMAGE 370
!endif
!ifndef IMAGE_BITMAP
!define IMAGE_BITMAP 0
!endif

!ifndef sysLoadImage
!define sysLoadImage "user32::LoadImageA(i, t, i, i, i, i) i"
!endif

!ifndef sysDeleteObject
!define sysDeleteObject "gdi32::DeleteObject(i) i"
!endif

!define MUI_UI "${NSISDIR}\Contrib\UIs\modern_instpic.exe"
ShowInstDetails nevershow

!macro DisplayImage IMG_NAME
Push $0
Push $1
Push $6
GetTempFileName $1
File /oname=$1 "${IMG_NAME}"
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 2000
System::Call '${sysLoadImage} (0, s, ${IMAGE_BITMAP}, 0, 0, ${LR_CREATEDIBSECTION}|${LR_LOADFROMFILE}) .r6' "$1"
SendMessage $HWNDPARENT ${STM_SETIMAGE} ${IMAGE_BITMAP} $6
System::Call "${sysDeleteObject} (r6)"
Delete $1
Pop $6
Pop $1
Pop $0
!macroend

(I found this code somewhere in the forum)

But it works only with classic UI, not modern (after my edit)

I tried to rewrite it to work with MUI, but I could not draw image on each NSIS page, only in installing files page

Can anybody help me?

progress
I searched forums and found several goood topics.
I make great progress, but there are still few problems:

a) how to update labels after clicking on Next/Back button?
b) how to set transparent color to gray area in the middle of the window?

(I use the

GetDlgItem $0 $HWNDPARENT 1037
SetCtlColors $0 0xFFFFFF transparent


function for labels, but it does not work with that gray area
Any ideas?

1) When you set label backgrounds to transparent new text is drawn over old text. You need to refresh the label yourself. The easiest way to do this is to show and hide the label with ShowWindow.
2) See FindWindow in the manual. It shows you how to get the handle of the inner dialog.

-Stu


'skinned' forum search http://forums.winamp.com/search.php?...der=descending wansis works with MUI (but I never used it :) )


redraw button
@Afrow UK:

I tried to redraw labels, but no success.
I created my own ONGUIINT function, but it does not help


... load bitmap ... ; works fine

FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $HWNDPARENT 1037
SetCtlColors $0 0xFFFFFF transparent ; till now works fine
ShowWindow $0 ${SW_HIDE} ; no effect
ShowWindow $0 ${SW_SHOW} ; no effect


Shall I create PRE/SHOW/LEAVE functions for each page and redraw labels there or what?

Try to use the lates NSIS version, I have not tried yet myself but I think transparant text handling in MUI improved. see Changelog of v2.17 or v2.18


Finished
Hi all
Tonight I finished work on installer with full background image. (enjoy !)
It requires some small fixes, but it is almost done.
Have a look on attachment.

I wrote it with help of InstallOptions, manual, Skinned button plugin, ResHacker and some other articles on NSIS forums...

It is similar to Ultra modern skin and XPUI skin, but these ones are not suitable for me.

In few days I will publish full script.

Known bugs:
- not redrawing label on Install page
- XPStyle must be off
- some flickering


working script
After few questions I modify my script for other users

Try download this rar:

www.oblivion.sk/slappy/stiahni/slappys_script.rar


725 kB

There is few files like images, custom pages, UI.exe, .nsi script, readme

You need http://forums.winamp.com/showthread....=skinnedbutton

this plugin for proper working of buttons

Just try it and then ask....

here is an image of working installer (if you compile files from upper rar you should get the same)

http://www.oblivion.sk/images/lotr2.jpg

Cool... have you tried ebanner plugin to use JPGs instead of those big BMPs?


Originally posted by zeeh3
Cool... have you tried ebanner plugin to use JPGs instead of those big BMPs?
Ok, I will try to fix it...

Re: working script

Originally posted by T.Slappy
After few questions I modify my script for other users

Try download this rar:
www.oblivion.sk/slappy/stiahni/slappys_script.rar


725 kB

There is few files like images, custom pages, UI.exe, .nsi script, readme

You need http://forums.winamp.com/showthread....=skinnedbutton

this plugin for proper working of buttons
Does anyone still have the script for this? I've searched but cannot find it.

TIA.

---------------
Sic semper...

new server
I did not work on this script for some time, I did not have time etc...
Anyway: my server moved, so the new address for script is:

http://www.oblivion.sk/slappy/slappys_script.rar
cca 730kB (this is the same version)

If you have any suggestions write me a PM...

I am back to the forum!
I could not login for several years :)
Anyway I made a great step ahead with this plugin, you can now find all info about it at http://www.unsigned-softworks.sk/installer page!


Inst page static control not refreshing
Hi

I found a bug? which really disturbs me I am would like to hear some ideas how to get rid of it.

Static control on install page (#1006) is not drawn correctly. This is normal behaviour:
http://www.unsigned-softworks.sk/en/...er/correct.jpg

But when another text is sent to this control (using DetailPrint or via some plugin) this happens: (there are multiple texts writen over them)
http://www.unsigned-softworks.sk/en/...ther/wrong.jpg
As you can see the text "This message is shown incorrectly..." is not readable.

Why is this happening and how to repair it?
I used SetDetailsPrint listonly to not print to this control, but that is not a solution.
Do I need to catch some WM_ERASEBACKGROUND message and repaint control manually or what should I do? :(
Thanks for all ideas!


Originally posted by T.Slappy
Hi

I found a bug? which really disturbs me I am would like to hear some ideas how to get rid of it.

Static control on install page (#1006) is not drawn correctly. This is normal behaviour:
But when another text is sent to this control (using DetailPrint or via some plugin) this happens: (there are multiple texts writen over them)
As you can see the text "This message is shown incorrectly..." is not readable.

Why is this happening and how to repair it?
I used SetDetailsPrint listonly to not print to this control, but that is not a solution.
Do I need to catch some WM_ERASEBACKGROUND message and repaint control manually or what should I do? :(
Thanks for all ideas!
Subclass the Static control on install page (#1006), then catch WM_SETTEXT message and refresh the control like this:

${If} $MSG = ${WM_SETTEXT}
ShowWindow $HWND ${SW_HIDE}
ShowWindow $HWND ${SW_SHOWNA}
${EndIf}