Old 3rd February 2011, 16:29   #1
vjrabanelly
Junior Member
 
Join Date: Feb 2011
Posts: 7
Question Resize nsDialogs window

Hi!

I've been looking for it a lot in this forum and in Google and didn't find the exact answer I was looking for...

I created an installer using nsDialogs after reading that InstallOptions got deprecated. Everything went well so far but now I'd like to resize the window. I did modify dialog 105 in modern.exe with ResHacker, but it doesn't change anything in nsDialogs.

So, is it possible to modify the size of the window in any way for nsDialogs? Where does nsDialogs gets its dimensions from?

Thank you.

Valentin
vjrabanelly is offline   Reply With Quote
Old 3rd February 2011, 20:10   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,263
IIRC nsDialogs gets its size from the child control id you pass when you create the dialog, normally 1018

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 3rd February 2011, 23:07   #3
ZmAn3
Senior Member
 
Join Date: Oct 2003
Posts: 178
if you know how to use res hacker resize control 1018 i also usaully resize 1044 too
ZmAn3 is offline   Reply With Quote
Old 4th February 2011, 06:54   #4
vjrabanelly
Junior Member
 
Join Date: Feb 2011
Posts: 7
Thanks for your replies.

I do know how to use ResHacker, but I didn't find the file I need to hack. In NSIS\Contrib\UIs, I tried every executable and only found 1033 controls.

It looks like there are no such things as 1018 or 1044 controls in modern.exe or standard.exe or even nsDialogs.dll...

Could you please tell me where I find these controls?
vjrabanelly is offline   Reply With Quote
Old 4th February 2011, 13:45   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You missed it. 1018 is in dialog 105 of modern.exe.

Stu
Afrow UK is offline   Reply With Quote
Old 4th February 2011, 14:42   #6
vjrabanelly
Junior Member
 
Join Date: Feb 2011
Posts: 7
I found it now. So I modify the dimensions from ResHacker, only for 1018 and 1044 in C:\%ProgFiles%\NSIS\Contrib\UIs\modern.exe, dialog 105.

But when I launch my NSIS script (which uses nsDialogs::Create 1018), nothing changes. It looks like it doesn't take into account any changes in modern.exe because even if I delete it, it doesn't say anything and opens always with the same dimensions.

Anders and ZmAn3, are you talking about nsDialogs or MUI?
Do I have to do something more to indicate to NSIS to take new changes into account?
Do I have to modify other values than just 1018 and 1044 width and height?

Thank you! Your help is much appreciated!
vjrabanelly is offline   Reply With Quote
Old 4th February 2011, 14:45   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Did you Compile and save?

Stu
Afrow UK is offline   Reply With Quote
Old 4th February 2011, 14:54   #8
vjrabanelly
Junior Member
 
Join Date: Feb 2011
Posts: 7
Yes. I can even see the result in opening the modern.exe directly after my modifications.
vjrabanelly is offline   Reply With Quote
Old 6th February 2011, 23:56   #9
ZmAn3
Senior Member
 
Join Date: Oct 2003
Posts: 178
i could be wrong but i think it uses both uis when compiling with mui2 anyways grab this it has a resized ui and sample script i have a few more if you need them

http://zman3.deviantart.com/#/d35wzxk
ZmAn3 is offline   Reply With Quote
Old 7th February 2011, 13:09   #10
vjrabanelly
Junior Member
 
Join Date: Feb 2011
Posts: 7
Thumbs up Adding MUI2 and an instFiles page resolved my problem!

Thank you very much ZmAn3! Your script helped me a lot!

I wasn't using an InstFiles page, so NSIS didn't execute the install section. I did it on purpose since I didn't want any instFiles page, but I didn't know it wouldn't accept to show a custom UI in this case. So I added some lines to add an InstFiles page with MUI and it did the trick :

code:
!include "MUI2.nsh"

!define MUI_UI "myCustomUI.exe"

!insertmacro MUI_PAGE_INSTFILES



Then, to go back to where I was before (no instFiles page), I added a code which makes my installer quit before loading instFiles page, just as it was doing before :
code:
!define MUI_PAGE_CUSTOMFUNCTION_PRE instFilesPre ; Just before "!insertmacro MUI_PAGE_INSTFILES"

Function instFilesPre
Quit
FunctionEnd



All my code is executed in the leave function of my previous custom page, not in install section.
So now I can resize the UI with ResHacker or ResEdit the way I want it and NSIS takes it into account when compiling!

Thanks again!

Bye

Valentin
vjrabanelly is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
dimensions, nsdialogs, resize, window

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