Old 6th September 2013, 17:55   #1
kevingale
Junior Member
 
Join Date: Sep 2013
Posts: 1
Installer Banner Being Stretched

Hi.

When we run our NSIS installer that uses MUI under Japanese and Korean systems the custom installer banner is being stretched. It is okay under English systems.

Does anybody know the cause of this and how we can fix it?

NOTE. We are using the Unicode version of NSIS so not sure if the problem is related to this version or is a generic NSIS issue.


Thanks.
Kev.
kevingale is offline   Reply With Quote
Old 7th September 2013, 04:08   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,505
The different font for CJK will probably cause the dialog units to change. I believe there is a MUI define you can set to disable the stretching...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 9th September 2013, 13:14   #3
kevin_gale
Junior Member
 
Join Date: Jun 2009
Posts: 12
Hi.

Thanks for your reply.

There is the "MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH" option but according to the documentation we should not use it if the images are the correct size (which we don't because they are).

"Do not stretch the bitmap for the Welcome and Finish page to fit the size of the field. Use this option only if you have an image that does not use the whole space. If you have a full size bitmap that fits exactly, you should not use this option because the size of the field will be different if the user has a custom DPI setting."


I'll give this a go but I guess either the documentation is wrong or there is a bug somewhere.
kevin_gale is offline   Reply With Quote
Old 9th September 2013, 14:47   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,505
Mui_headerimage_bitmap_nostretch?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 11th September 2013, 09:22   #5
kevin_gale
Junior Member
 
Join Date: Jun 2009
Posts: 12
Using the nostretch options does solve the stretching problem. However, it has introduced the following issues:
1. The welcome banner is now cropped even though the image is the correct size (we are missing quite a few pixels from the bottom).

2. The header now has a grey bar at the bottom that runs from the end of the header image to the end of the dialog.


I would attach some screen shot but every picture I try to attach is deemed as invalid even though they are the correct format (PNG / JPEG) and below the maximum file size.


Kev.
kevin_gale is offline   Reply With Quote
Old 11th September 2013, 10:19   #6
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 564
Send a message via ICQ to T.Slappy
PNG and JPEG are not supported! Use Windows bitmpa (.bmp) only.

Cool looking installers with custom design: www.graphical-installer.com
Create Setup Pages easily: www.install-designer.com
Build installers in Visual Studio 2005-2022: www.visual-installer.com
or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 11th September 2013, 12:33   #7
kevin_gale
Junior Member
 
Join Date: Jun 2009
Posts: 12
I've just tried a bmp image and that also has failed.

The exact message is "This is not a valid image file.".

Not sure if this is related to my browser but I am using Firefox 23.01 under Mac OS X 10.8


Kev.
kevin_gale is offline   Reply With Quote
Old 11th September 2013, 14:31   #8
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
I don't think there's need for screenshots anyway. You're getting an expected result and you even quoted the explanation yourself. Page elements are scaled with regard to dpi. The image is resized to fit the size of the field. If you disable stretching, the proportion to the rest of the page will not be maintained; the image will fill just a part of the field or be croppped if it's larger. That's why you shouldn't disable stretching.
I'm guessing the cause of your initial problem is that with CJK fonts, which obviously have different dpi, the width and height of the header image are not scaled with the same factor and the aspect ratio gets distorted. If so, the only fix that springs to mind is to use a different image on those systems.

PostEnd:
aerDNA is offline   Reply With Quote
Old 11th September 2013, 15:50   #9
kevin_gale
Junior Member
 
Join Date: Jun 2009
Posts: 12
Hi.

I wish I could upload the screen shots as this seems like madness.

In summary...

1. If we allow the banners and headers to stretch then on CJK systems the height of images appears to be correct and only the width is stretched by some strange amount! Our images are the recommended sizes so I don't understand why any resizing should be occurring.

2. If we do not allow the banners and headers to stretch then on CJK systems their proportions are correct but the banner is cropped at the bottom and a visual glitch appears to the right of the header all the way to the end of the dialog.


Using different images for each language would be an unbelievably bad solution. For starters, we do not even know the dimensions that are required for each language and would the dimensions be the same for all operating systems?

This is definitely one area of NSIS that could (should) be improved as it really limits it's use.



Kev.
kevin_gale is offline   Reply With Quote
Old 11th September 2013, 16:28   #10
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
I believe 1. & 2. are clear and I don't know how to explain it any better than I already have.
My suggestion doesn't require you to use a separate image for each language, just one extra for CJK. It shouldn't be difficult to determine the appropriate dimensions. Then you can use something like this:
code:
!define MUI_CUSTOMFUNCTION_GUIINIT ChkCJK
Function ChkCJK
StrCmp $LANGUAGE ${LANG_JAPANESE} +2
StrCmp $LANGUAGE ${LANG_KOREAN} 0 +3
File /oname=$PLUGINSDIR\modern-header.bmp Header_CJK.bmp
SetBrandingImage /IMGID=1046 /RESIZETOFIT "$PLUGINSDIR\modern-header.bmp"
FunctionEnd


PostEnd:
aerDNA is offline   Reply With Quote
Old 11th September 2013, 16:34   #11
kevin_gale
Junior Member
 
Join Date: Jun 2009
Posts: 12
I guess that is better than all languages but what is the recommended dimensions?
kevin_gale is offline   Reply With Quote
Old 11th September 2013, 17:01   #12
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
Those that fit the control. Use e.g. WinExplorer to examine Static controls on the page. The size of the header image control should normally be 150x57 (which is also the officially recommended bitmap size); check its dimensions with CJK.

PostEnd:
aerDNA is offline   Reply With Quote
Old 11th September 2013, 17:11   #13
kevin_gale
Junior Member
 
Join Date: Jun 2009
Posts: 12
ok.

This whole approach seems badly designed. There should be no reason why the images are scaled according to the font DPI.

Is there any way to log enhancement requests?
kevin_gale is offline   Reply With Quote
Old 11th September 2013, 17:37   #14
aerDNA
Senior Member
 
aerDNA's Avatar
 
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
You can disable the scaling, and you did, and you witnessed the effect, and you wanted to post screenshots of it...

PostEnd:
aerDNA is offline   Reply With Quote
Old 11th September 2013, 18:18   #15
kevin_gale
Junior Member
 
Join Date: Jun 2009
Posts: 12
mmm.... we appear to be going around in circles here.

My point is that NSIS should be displaying the images correctly when scaling is switched off. I do not see any reason why the bottom of the side banner should be clipped by a few pixels and for the header (not header image) to appear with a visual glitch.

If it is 'by-design' then ok but the design of this needs improving (correcting) which is why I wanted to know if there was anywhere to log enhancements.
kevin_gale is offline   Reply With Quote
Old 11th September 2013, 18:21   #16
DrO
 
Join Date: Sep 2003
Posts: 27,873
there's the bug tracker on sourceforge for the project.
DrO is offline   Reply With Quote
Old 13th September 2013, 16:33   #17
kevin_gale
Junior Member
 
Join Date: Jun 2009
Posts: 12
Thanks,

I've logged this as an enhancement (with screen shots showing the problem) as:

https://sourceforge.net/p/nsis/feature-requests/521/
kevin_gale is offline   Reply With Quote
Old 17th September 2013, 19:01   #18
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,505
Quote:
!include MUI2.nsh
!define MUI_PAGE_CUSTOMFUNCTION_SHOW SizeWelcomeFinish
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE Korean

Function SizeWelcomeFinish
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R0 $R0 0x4B0
System::Call *(i,i,i,i)i.r0
System::Call 'USER32::GetClientRect(i$R0,ir0)'
System::Call *$0(i,i,i.r1,i.r2)
System::Free $0
StrCpy $R2 $2
${DoWhile} $1 > 164
IntOp $1 $1 - 1
IntOp $2 $2 - 1
${Loop}
${DoWhile} $2 < $R2
IntOp $2 $2 + 1
${Loop}
System::Call 'USER32::SetWindowPos(i$R0,i0,i,i,i$1,i$2,i0x16)'
FunctionEnd
Does some stretching but should look better...

IntOp $PostCount $PostCount + 1
Anders 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