|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
|
#1 |
|
Junior Member
Join Date: Feb 2013
Posts: 43
|
Shifting the default text position in NSIS installer pages
I am using a background image for my installer pages, I have set all the other controls transparent.
There is a logo in the background image , which is overlapping with text on installer pages like the text on welcome page, license page etc. So is it possible that I can shift the position of this text from default to the one suitable for me, so that my background logo remains visible? Please Help. Thanks. |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
For all pages except the welcome and finish pages, I would recommend you modify the UI itself using Resource Hacker. The UI is Contrib\Graphics\UIs\modern.exe - copy to your script directory. You can apply it using !define MUI_UI modern_new.exe. You can just delete a load of controls that you are currently hiding. Be careful though... deleting some controls will result in a compile error so check your script still compiles when you do. For those that you cannot delete, I give them a size of 0, 0 and position them outside the dialog.
As for the welcome and finish pages, you must either resize the controls at run time using the System plug-in and SetWindowPos or you could make a copy of the MUI source code and modify that instead. In either case it's quite messy. Stu |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Feb 2013
Posts: 43
|
What control contains the text ? I used resource hacker but couldn't actually move the text position.
|
|
|
|
|
|
#4 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You haven't said which text you are trying to resize so my guess is as good as yours. If you modify it in Resource Hacker make sure you click Compile before saving.
Stu |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Feb 2013
Posts: 43
|
I am trying to reposition text on Welcome page, Install directory page and Finish Page.
And I am compiling and then saving in resource hacker. But couldnt find the right controls I guess. |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
As I said the welcome and finish pages need to be repositioned by modifying the Modern UI source code or by moving them at run time using the SetWindowPos API. The welcome and finish pages are not standard dialogs - they are created at run time using the nsDialogs plug-in. The directory page is dialog 103 (the main text control is #1006).
Stu |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Feb 2013
Posts: 43
|
Ok..Thanks Stu. I was able to reposition the text on $instdir page using resource hacker.
But , I am still confused about welcome/finish page.. Even if I use SetWindowPos API as you suggested, I still need to know the Handle of the control that contains the text, isnt it ? Or am I missing something here. |
|
|
|
|
|
#8 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
I'm working on a small plug-in which will make control resizing easier. It will be ready in an hour.
Stu |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Feb 2013
Posts: 43
|
Wow. Thats great.
|
|
|
|
|
|
#10 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Sorry I ran out of time and I want to make sure it works for RTL languages.
For the welcome/finish page control handles, check Contrib\Modern UI 2\Pages\*. There are variables defined for each control. Stu |
|
|
|
|
|
#11 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Finished the plug-in:
http://nsis.sourceforge.net/NsResize_plug-in You can use the nsResize::Add function to increase the size of controls using the same units as nsDialogs (pixels, dialog units or percent). I've also added an example script which increases the size of the entire NSIS installer and uninstaller UI along with all wizard pages without any hacking of the UI with Resource Hacker. Stu |
|
|
|
|
|
#12 | |
|
Junior Member
Join Date: Feb 2013
Posts: 43
|
Hey Stu.. Many thanks for this plugin.
But I am not able to use it properly. For example, I am trying to resize the text on Directory page so I am doing this: Quote:
Can you pls give me an example for resizing controls? |
|
|
|
|
|
|
#13 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
It wants a window handle rather than an id. Also I would use dialog units over pixels and I would use Add rather than Set if you just want to make a control bigger.
For example: This will make the control 20 dialog units higher.code: Stu |
|
|
|
|
|
#14 |
|
Junior Member
Join Date: Feb 2013
Posts: 43
|
Ok. Great. It worked!!! Thanks.
And regarding the text on welcome page I checked Contrib\Modern UI 2\Pages\welcome.nsh as you suggested, the MUI_WELCOMEPAGE_TEXT is defined for text control but when I used it to resize, nothing happened. code: |
|
|
|
|
|
#15 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
That is just a compile time define for the label text. The handle is stored in $mui.WelcomePage.Text:
Stucode: |
|
|
|
|
|
#16 | |
|
Junior Member
Join Date: Feb 2013
Posts: 43
|
Well I tried this too earlier..but Nsis is not recognizing it, text size is not changing and this warning is showing up :
Quote:
(Sorry for bugging you this much. ) |
|
|
|
|
|
|
#17 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
You must be using MUI1. Switch to MUI2.nsh.
Stu |
|
|
|
|
|
#18 | |
|
Junior Member
Join Date: Feb 2013
Posts: 43
|
You're right. I was using MUI1.nsh. Now I switched to MUI2.nsh , found out that it doesnt support MUI_HWND so modified the code according to MUI2 , and finally it Worked. Thanks a lot Stu.
Similarly it worked for Finish page. (Wow) But I dont why , there are coming these same warnings, as below: Quote:
|
|
|
|
|
|
|
#19 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
Do you have MUI_FUNCTION_DESCRIPTION_BEGIN but with no MUI_PAGE_COMPONENTS?
Stu |
|
|
|
|
|
#20 |
|
Junior Member
Join Date: Feb 2013
Posts: 43
|
Yeah.. removed it and all is working fine now. A big thanks to you for all the help.
|
|
|
|
|
|
#21 |
|
Member
Join Date: Jun 2011
Posts: 52
|
I do know that is an old thread, but information is always useful for someone.
To do this, i've added this piece of code: PHP Code:
PHP Code:
Also it is possible to get the current column size with this define and sendmessage: PHP Code:
|
|
|
|
|
|
#22 | |
|
Senior Member
Join Date: Nov 2012
Posts: 166
|
shadowpoa
Did as you recommended - but does not work ... Why? Quote:
|
|
|
|
|
|
|
#23 |
|
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
LVM_GETCOLUMNWIDTH/LVM_SETCOLUMNWIDTH is used for LISTVIEW controls only. If you want to resize the welcome page text, use the nsResize plug-in.
Stu |
|
|
|
![]() |
|
|||||||
| Tags |
| default text position, nsis |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|