Old 1st July 2006, 00:58   #1
bnicer
Senior Member
 
Join Date: Feb 2005
Location: London
Posts: 218
Background image

I know how to re-compile 'modern_headerbmp.exe' in Resource Hacker, so the header bitmap image is in the background and the text is on top. I was wondering if you could do the same thing with the welcome & finish page bitmap. Editing the fields in ioSpecial.ini always puts the image on top of the text. It occurs to me that you might be able to swop fields 1 and 3, but would that work, and where would you modify the settings? The bitmap is field 1; field 2 and field 3 are the welcome & finish text.
bnicer is offline   Reply With Quote
Old 1st July 2006, 05:53   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Swapping the fields would work because their order in the INI file sets Z order. You could modify ioSpecial.ini using MUI_INSTALLOPTIONS_READ and MUI_INSTALLOPTIONS_WRITE in functions defined by MUI_PAGE_CUSTOMFUNCTION_PRE. As the MUI readme says:
Quote:
In the Pre function of the Welcome page and the Finish page, you can write to the InstallOptions INI file of the page (ioSpecial.ini)

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 1st July 2006, 09:34   #3
bnicer
Senior Member
 
Join Date: Feb 2005
Location: London
Posts: 218
Changing the z-order works, but you pay a price. The image is gone when you go Back from the next window. And the text assumes a gray background color.

How can I restore the background to white and keep the image from disappearing? Is it possible to do both?
bnicer is offline   Reply With Quote
Old 1st July 2006, 11:13   #4
bnicer
Senior Member
 
Join Date: Feb 2005
Location: London
Posts: 218
I at first thought you could edit 'System.nsh' to change the order of the fields there...
bnicer is offline   Reply With Quote
Old 1st July 2006, 20:26   #5
bnicer
Senior Member
 
Join Date: Feb 2005
Location: London
Posts: 218
I ran a search & replace in notepad to substitute Field 1 with Field 3 and Field 3 with Field 1. Then I renamed the fields in 'ioSpecial.ini'. Now the bitmap image is in the background and it doesn't disappear when you go Back from the next window.

And you can do this:

code:

!define MUI_PAGE_CUSTOMFUNCTION_SHOW font_background
!define MUI_WELCOMEPAGE_TITLE_3LINES
!define MUI_WELCOMEPAGE_TEXT "$(TEXT_WELCOME_INFO)"
!insertmacro MUI_PAGE_WELCOME

Function font_background
GetDlgItem $R0 $MUI_HWND 1200
SetCtlColors $R0 0x000000 0xFFFFFF
FunctionEnd

1200 is Field 1.
0xFFFFFF makes the background white.

Is there is any reason I shouldn't modify 'System.nsh'?
bnicer is offline   Reply With Quote
Old 1st July 2006, 20:31   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It's not really wise as the same changes will be applied to all installers you create. Also when you install a new version of NSIS your changes will be lost.

-Stu
Afrow UK is offline   Reply With Quote
Old 4th July 2006, 10:23   #7
bnicer
Senior Member
 
Join Date: Feb 2005
Location: London
Posts: 218
There is now a better way of changing the 'ioSpecial.ini' field order using MUI_INSTALLOPTIONS_WRITE. The image is visible when you go Back from the next page. To whoever fixed it in NSIS 2.18, thank you. Bad timing on my part.
bnicer is offline   Reply With Quote
Old 10th March 2007, 07:31   #8
bnicer
Senior Member
 
Join Date: Feb 2005
Location: London
Posts: 218
The Welcome/Finish pages display a 497 x 314 image in the background.

I got a PM in January asking me how I fixed the image disappearing when pressing back.

=====================

I didn't check my messages until last week.

=====================

I'm fairly sure it was nothing I did. The issue fixed itself in NSIS 2.18.

Maybe the problem was/is:

To send the bitmap to the back behind the text, the z-order is reversed. You can do that in ioSpecial.ini. The recommended way is with MUI_INSTALLOPTIONS_WRITE. I think I tried (and possibly may have succeeded) only using MUI_INSTALLOPTIONS_WRITE ... Later I returned to editing System.nsh, which I started out attempting, because it was less complicated.

The changes are risky.

Quote:
Afrow UK wrote:

It's not really wise as the same changes will be applied to all installers you create. Also when you install a new version of NSIS your changes will be lost.
If anyone would like to try, I could paste the modified System.nsh code below. It's a long file. NSIS Modern User Interface version 1.75 written by Joost Verburg. 2000+ lines. About 20 characters are changed.

I would suggest just posting the differences, but they're all over the place.

Last edited by bnicer; 10th March 2007 at 09:35.
bnicer is offline   Reply With Quote
Old 10th March 2007, 08:06   #9
bnicer
Senior Member
 
Join Date: Feb 2005
Location: London
Posts: 218
Here's a link to a screenshot:

497x314 Welcome page
bnicer is offline   Reply With Quote
Old 10th March 2007, 08:15   #10
bnicer
Senior Member
 
Join Date: Feb 2005
Location: London
Posts: 218
Actually, here's a link to the changed file:

modified System.nsh
bnicer is offline   Reply With Quote
Old 11th March 2007, 15:52   #11
bnicer
Senior Member
 
Join Date: Feb 2005
Location: London
Posts: 218
System.nsh is the same in NSIS 2.24, 2.23, 2.22 and 2.21. The modified file is for those versions.

The link might be obsolete before long. Sorry about that.

Edit System.nsh yourself by first making a backup copy. Then open System.nsh in a text editor and make these changes:

1) Replace every occurrence of "Field 1" with "Field 999".
2) Replace every occurrence of "Field 3" with "Field 1".
3) Replace every occurrence of "Field 999" with "Field 3".

Save the file.

Images:
Design a 497x314 image with enough area to display text. An orange title won't be visible on an orange background. The Welcome page and Finish page do not have the same text and other languages do not use the same text strings; please bear that in mind.

How to show two checkboxes on the Finish page:
You can customize the following code.

code:
!define MUI_PAGE_CUSTOMFUNCTION_PRE z_order_finish
!define MUI_PAGE_CUSTOMFUNCTION_SHOW font_background
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE post_install_1
!define MUI_FINISHPAGE_TITLE_3LINES
!define MUI_FINISHPAGE_TITLE "$(TEXT_FINISH_INFO_TITLE)"
!define MUI_FINISHPAGE_SHOWREADME
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "$(TEXT_FINISH_RUN)"
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN_FUNCTION post_install_2
!insertmacro MUI_PAGE_FINISH

Function z_order_finish
!insertmacro MUI_INSTALLOPTIONS_READ $R1 "ioSpecial.ini" "Field 3" "Text"

!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 1" "Top" 80
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 1" "Bottom" 185

!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 2" "Top" 15
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 2" "Bottom" 80

!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Text" "$(TEXT_FINISH_SHOW)"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Type" Checkbox
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Left" 78
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Right" 258
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Top" 150
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Bottom" 160
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "State" 0
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Flags" ""

!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Left" 78
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Right" 258
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" 130
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" 140

!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Text" $R1
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Type" Bitmap
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Left" 0
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Right" 331
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Top" 0
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Bottom" 193
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "Flags" RESIZETOFIT
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 5" "State" ""
FunctionEnd


The bitmap is Field 3 before and Field 5 afterwards.

Last edited by bnicer; 11th March 2007 at 16:36.
bnicer is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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