Old 22nd July 2006, 17:57   #1
T.Slappy
Senior Member
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 432
Send a message via ICQ to T.Slappy
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:

code:
!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?
Attached Images
File Type: jpg background.jpg (58.5 KB, 699 views)
T.Slappy is offline   Reply With Quote
Old 22nd July 2006, 20:00   #2
T.Slappy
Senior Member
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 432
Send a message via ICQ to T.Slappy
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
code:
GetDlgItem $0 $HWNDPARENT 1037
SetCtlColors $0 0xFFFFFF transparent



function for labels, but it does not work with that gray area
Any ideas?
Attached Images
File Type: jpg background.jpg (54.7 KB, 677 views)
T.Slappy is offline   Reply With Quote
Old 22nd July 2006, 20:52   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,338
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
Afrow UK is offline   Reply With Quote
Old 23rd July 2006, 06:13   #4
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
'skinned' forum search http://forums.winamp.com/search.php?...der=descending wansis works with MUI (but I never used it )
Takhir is offline   Reply With Quote
Old 23rd July 2006, 20:08   #5
T.Slappy
Senior Member
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 432
Send a message via ICQ to T.Slappy
redraw button

@Afrow UK:

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

... 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?

Create cool looking Graphical Installers in NSIS: www.graphical-installer.com -see below
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned-softworks.com
Develop NSIS projects directly in Visual Studio 2005-2013: www.visual-installer.com
T.Slappy is offline   Reply With Quote
Old 24th July 2006, 21:20   #6
onad
Senior Member
 
onad's Avatar
 
Join Date: Dec 2004
Location: Turkey
Posts: 447
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

"Just do it"
onad is offline   Reply With Quote
Old 30th July 2006, 21:20   #7
T.Slappy
Senior Member
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 432
Send a message via ICQ to T.Slappy
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
Attached Images
File Type: jpg background.jpg (49.2 KB, 714 views)

Create cool looking Graphical Installers in NSIS: www.graphical-installer.com -see below
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned-softworks.com
Develop NSIS projects directly in Visual Studio 2005-2013: www.visual-installer.com
T.Slappy is offline   Reply With Quote
Old 28th September 2006, 17:22   #8
T.Slappy
Senior Member
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 432
Send a message via ICQ to T.Slappy
working script

After few questions I modify my script for other users

Try download this rar:
code:
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)

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

Create cool looking Graphical Installers in NSIS: www.graphical-installer.com -see below
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned-softworks.com
Develop NSIS projects directly in Visual Studio 2005-2013: www.visual-installer.com
T.Slappy is offline   Reply With Quote
Old 28th September 2006, 19:33   #9
zeeh3
Senior Member
 
Join Date: Aug 2005
Location: Brazil
Posts: 121
Cool... have you tried ebanner plugin to use JPGs instead of those big BMPs?
zeeh3 is offline   Reply With Quote
Old 29th September 2006, 16:01   #10
T.Slappy
Senior Member
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 432
Send a message via ICQ to T.Slappy
Quote:
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...

Create cool looking Graphical Installers in NSIS: www.graphical-installer.com -see below
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned-softworks.com
Develop NSIS projects directly in Visual Studio 2005-2013: www.visual-installer.com
T.Slappy is offline   Reply With Quote
Old 21st July 2007, 17:22   #11
Trexian
Junior Member
 
Join Date: Jul 2007
Posts: 7
Re: working script

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

Try download this rar:
code:
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...
Trexian is offline   Reply With Quote
Old 25th October 2007, 21:31   #12
T.Slappy
Senior Member
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 432
Send a message via ICQ to T.Slappy
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:
code:
http://www.oblivion.sk/slappy/slappys_script.rar
cca 730kB (this is the same version)

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

Create cool looking Graphical Installers in NSIS: www.graphical-installer.com -see below
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned-softworks.com
Develop NSIS projects directly in Visual Studio 2005-2013: www.visual-installer.com
T.Slappy is offline   Reply With Quote
Old 18th November 2010, 07:40   #13
T.Slappy
Senior Member
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 432
Send a message via ICQ to T.Slappy
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!

Create cool looking Graphical Installers in NSIS: www.graphical-installer.com -see below
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned-softworks.com
Develop NSIS projects directly in Visual Studio 2005-2013: www.visual-installer.com
T.Slappy is offline   Reply With Quote
Old 18th May 2011, 14:11   #14
T.Slappy
Senior Member
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 432
Send a message via ICQ to T.Slappy
Question 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:


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!

Create cool looking Graphical Installers in NSIS: www.graphical-installer.com -see below
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned-softworks.com
Develop NSIS projects directly in Visual Studio 2005-2013: www.visual-installer.com
T.Slappy is offline   Reply With Quote
Old 20th May 2011, 03:45   #15
gfm688
Junior Member
 
Join Date: Jul 2010
Posts: 12
Quote:
Originally Posted by T.Slappy View Post
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:

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

gfm688 is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump