Skip to content
⌘ NSIS Forum Archive

How to move the Licence text box to top in NSIS

5 posts

DivyaArun#

How to move the Licence text box to top in NSIS

Hi,

I have updated the licence page such that the text on top of the Licence text box now appears along with the text at the bottom. I would like to move the Licence text box to bit upper in order to remove the unwanted space. Please help!!!

Thanks
Anders#
How tall should it be? The same size (with more space on the bottom) or a bit taller so the bottom of the control stays in the same place?
DivyaArun#
Hi,

I have moved the top text "Scroll down or press Page Down... " text to the bottom area along with "If you accept... " such that they are read as 2 lines. Hence there is a lot of blank space in the portion where "Scroll down" text was originally present and Licence text box. I want to reduce this blank area by either moving the Licence text box to bit upper or by increasing the height of Licence text box, whichever is easy. I was thinking to relocate the Licence text box to bit upper.
Anders#
How did you move the top text label? Just use the same method.

Just editing the .exe UI in Resource Hacker and apply it with ChangeUI/MUI_UI is the easy solution. You can also move it at run-time:

!include MUI2.nsh
!define MUI_PAGE_CUSTOMFUNCTION_SHOW ModifyLicenseOnShow
!insertmacro MUI_PAGE_LICENSE "${__FILE__}"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE English

Function ModifyLicenseOnShow
System::Call 'USER32::GetWindowRect(p$mui.LicensePage.LicenseText,@r3)' ; NSIS 3+
System::Call '*$3(i.r4, i.r5, i.r6, i.r7)'
IntOp $6 $6 - $4
IntOp $7 $7 - $5
System::Call 'USER32::GetParent(p$mui.LicensePage.LicenseText)p.s'
System::Call 'USER32::MapWindowPoints(p0, ps, p$3, i 1)i.r9'
System::Call '*$3(i.r4, i.r5)'
IntOp $5 0 + 2 ; Adjust these
IntOp $7 $7 + 10 ; if desired
System::Call 'USER32::SetWindowPos(p$mui.LicensePage.LicenseText, p0, i $4, i $5, i $6, i $7, i 0x14)'
FunctionEnd
DivyaArun#
Originally Posted by Anders View Post
How did you move the top text label? Just use the same method.

Just editing the .exe UI in Resource Hacker and apply it with ChangeUI/MUI_UI is the easy solution. You can also move it at run-time:
Hi,

I was able to move the Licence box using the following code

Function LicenseShow

FindWindow $R0 `#32770` `` $HWNDPARENT
GetDlgItem $R0 $R0 1000
nsResize::Set $R0 0 0 100% 180

FunctionEnd