Skip to content
⌘ NSIS Forum Archive

NSIS Dialog Designer

156 posts

nicorac#
I'm still missing the point, sorry.
Can't you call fnc_XXX_Create (that doesn't show the dialog) instead of fnc_XXX_Show and do all of your testing outside the .nsi file?

My intent is to keep NSISDialogDesigner as much "code-free" as possible, because it's not a code editor.
The code-related control properties (*CustomScript) are there to take care of very special designer related needings, not covered by the designer itself.

If I missed something, please post a very simple example, maybe with pseudo-code, to explain your needings.
shadowpoa#
some more few little bugs

When changing the attribute readonly on number control I found these errors...

; === ins_txt_cnpj (type: Number) ===
  ${NSD_CreateNumber} 53.32u 158.77u 80.96u 12.92u ""
  Pop $R0
 SetCtlColors $R0 0x000000 0xECE9D8 
TextLimit also doesn't work, nothing happens!
nicorac#
New version 1.3.3 released

Originally Posted by shadowpoa View Post
When changing the attribute readonly on number control I found these errors...
; === ins_txt_cnpj (type: Number) ===
  ${NSD_CreateNumber} 53.32u 158.77u 80.96u 12.92u ""
  Pop $R0
 SetCtlColors $R0 0x000000 0xECE9D8 
TextLimit also doesn't work, nothing happens!
Thanks for reporting it.
I've just released version 1.3.3 that fixes those bugs.

You can download it from here: http://coolsoft.altervista.org/nsisdialogdesigner
shadowpoa#
Hi,

Another little problem:

When creating hline control, nsis wants you to pop his handle from stack, but edit doesn't add the code automatically, it just creates the control but doesn't pop it.

Here´s a sample.


; handle variables
Var hCtl_teste2

; dialog create function
Function fnc_teste2_Create
  
  ; === teste2 (type: Dialog) ===
  nsDialogs::Create 1018
  Pop $hCtl_teste2
  ${If} $hCtl_teste2 == error
    Abort
  ${EndIf}
  !insertmacro MUI_HEADER_TEXT "Dialog title..." "Dialog subtitle..."
  
  ; === HLine1 (type: HLine) ===
  ${NSD_CreateHLine} 42.13u 47.38u 229.06u 1.23u "HLine1"
  
FunctionEnd 
shadowpoa#
ChangeUI

can you add an option to specify other exe for ui than modern.exe?
I know I can change the rect in dialog id field, but not all options are supported..

as say the text below:
ChangeUI
Replaces dialog (IDD_LICENSE, IDD_DIR, IDD_SELCOM, IDD_INST, IDD_INSTFILES, IDD_UNINST or IDD_VERIFY) by a dialog with the same resource ID in ui_file.exe. You can also specify 'all' as the dialog if you wish to replace all 7 of the dialogs at once from the same UI file. For some example UIs look at Contrib\UIs under your NSIS directory.
IDD_LICENSE must contain IDC_EDIT1 (RICHEDIT control).
IDD_DIR must contain IDC_DIR (edit box), IDC_BROWSE (button) and IDC_CHECK1 (checkbox).
IDD_SELCOM must contain IDC_TREE1 (SysTreeView32 control), and IDC_COMBO1 (combo box).
IDD_INST must contain IDC_BACK (button), IDC_CHILDRECT (static control the size of all other dialogs), IDC_VERSTR (static), IDOK (button), and IDCANCEL (button). If an image control (static with SS_BITMAP style) will be found in this dialog it will be used as the default for SetBrandingImage
IDD_INSTFILES must contain IDC_LIST1 (SysListView32 control), IDC_PROGRESS (msctls_progress32 control), and IDC_SHOWDETAILS (button).
IDD_UNINST must contain IDC_EDIT1 (edit box).
IDD_VERIFY must contain IDC_STR (static).
Parameters:
dialog ui_file.exe
Example:
ChangeUI all "${NSISDIR}\Contrib\UIs\sdbarker_tiny.exe" 
nicorac#
Version 1.4.0 released

Just released version 1.4.0.

Originally Posted by shadowpoa View Post
When creating hline control, nsis wants you to pop his handle from stack...
You're right, it will also cause a (small) stack leak.
Now fixed, thanks.

can you add an option to specify other exe for ui than modern.exe?
I know I can change the rect in dialog id field, but not all options are supported..
You can set custom size only if dialogID is different from 1018 and 1040, and some other UIs use these values (but with different sizes).
I added a new property DialogUI: when set to custom you're now free to set any DialogID and Size.
DialogUI default value is "modern" (corresponding to "modern.exe"), so dialogs created with previous versions are still working.

Should be great to have a list of known <DialogUIs, DialogIDs, width, height>, like:
"modern.exe", 1018, <width>, <height>
"modern.exe", 1040, <width>, <height>
"sdbarker_tiny.exe", xxx, <width>, <height>
"sdbarker_tiny.exe", yyy, <width>, <height>
...
but it's a long task and I actually don't have the time to prepare it.

If you could help... I'll add it to next version 😉.
Thanks for your help.
shadowpoa#
thanks!

I´ll be glad to help, what you need me to do?

Other small but annoyng thing, is it possible to make labels transparent on designer window?

Thanks for the fast response and version... 😁
nicorac#
Originally Posted by shadowpoa View Post
I´ll be glad to help, what you need me to do?
Thanks for your offer, but this is not an easy task unless you're a C++ programmer...

You should open each available UI exe with a resource editor (or with VisualStudio, see the attached image), then find contained dialogs (but only the ones used as "containers") and extract their dialogID, width and height. Width and Height are represented in DialogUnits, so they must also be converted to pixels...
Once I have these informations (in a .txt file) I could make DialogID property of the editor show only the dialogs belonging to the given DialogUI.

Not an easy task, I hope I'll find some more spare time to dedicate to this.
shadowpoa#
but...

Thinking of that, I just created the new dialogui with resource hacker, cant I just select the UI I have and the editor show the files instead of "custom" and adds to test script

ChangeUI all "${NSISDIR}\Contrib\UIs\sdbarker_tiny.exe" 
for example... and then we can test with our own UI instead of creating one?

Sure, creating new UI´s on dialog designer would be a Cool option, but this should be good enough to test out own code...

Other thing that would be cool to support is the great plugin nswindows:

Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
shadowpoa#
little bug... and suggestion.

CreateFuncionCustomScript and FooterCustomScript are inverted...

And to be more understandable fields should appear in the order that are included in the script, and not in alphabetical order.
nicorac#
Originally Posted by shadowpoa View Post
CreateFuncionCustomScript and FooterCustomScript are inverted...
What you mean?
CreateFuncionCustomScript is meant con contain custom code to be added at the end of Create function, when all controls have been created. Property description (show them by right-clicking the property grid and check "Descriptions") says "NSIS script you want to append to the *Create function of generated .nsdinc script".
FooterCustomScript is custom code added at the end of the .nsdinc file.

As for the properties ordering, that's out of my control.
PropertyGrid is a .NET Framework component and properties are self read by that component through reflection... VisualStudio has the same... issue.
shadowpoa#
my mistake!

sorry... dont have read the description "CreateFuncionCustomScript" sends me to "create a function" that is done by "FooterCustomScript


PropertyGrid is a .NET Framework component and properties are self read by that component through reflection... VisualStudio has the same... issue.
I understand that... but thanks for always fast reply...

and on the suggestion of ChangeUI?
shadowpoa#
New little bug:

when saving an archive with another name, titlebar doesn't update, making difficult to have sure of what archive is being written...

In print attached I "saved as" from "tela_lalala.nsdef" to "tela_uninst.nsdef", but the name have been updated only in tab...

See attachment...

Thanks!!
shadowpoa#edited
Just one Label RTL

After some testing, I figured out that Ex Style for just one label RTL is ${WS_EX_LAYOUTRTL} not ${WS_EX_RTLREADING}.. please fix or add this stype, its already included on nsdialogs.nsh by default.

Here some reference... https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx

for me, just add WS_EX_LAYOUTRTL did the trick... below and example.

  ; === sr_lbl_prcnt (type: Label) ===
  ${NSD_CreateLabel} 487 263 111 23 ""
  Pop $lbl_prcnt
  ${NSD_AddExStyle} $lbl_prcnt ${WS_EX_LAYOUTRTL} 
Thanks!
nicorac#
Originally Posted by shadowpoa View Post
and on the suggestion of ChangeUI?
Still working on it, but actually I'm a bit... out of spare time 😉
shadowpoa#
Hi,

I am doing some cleanup in my code, i have noticed the code below:

nsDialogs::Show $hCtl_dialog 
What is the problem:

Using like this, a memory leak, NSIS will put on the top of stack the dialog's Handle..

Using like this the problem is not shown anymore:
nsDialogs::Show 
Looking at NSDialogs docs, I dont see a handle passed to the show function.

Here's the doc:


Correct If I am wrong... thanks!
shadowpoa#
If I use !include on HeaderCustomScript it gets ommited from generated script, but it appears on below panel...

See prints to better understand..

print1.jpg - script opened with hm nsis editor
print2.jpg - script being visualized on coolsoft editor.

Thanks!
shadowpoa#
Other little thing

for vline and hline we can have it visible true or false... but cant do it on designer...

thanks!
Squirre1#
It there anything I can do that is similar to an "OnLoad" function, unless I am just missing the fact that I can do it already...

Once the form becomes visible, I would like it to go ahead an start kicking off a particular function, not requiring user interaction. If I try to do it in the ControlCustomScript, it has to wait for that execution to finish before it loads/shows the dialog, and the function may take a few minutes to execute. Not to mention, I would like that function to be able to report status back to the dialog and it has to exist first...

Thanks...
aerDNA#
This doesn't belong in the Dialog Designer thread. You can use a timer:

Function PageCreatorFunction
; ...
${NSD_CreateTimer} BgStuff 1
nsDialogs::Show
FunctionEnd

Function BgStuff
${NSD_KillTimer} BgStuff
; do your stuff here
FunctionEnd
nicorac#
Version 1.4.1 released

v.1.4.1 - 2015-09-07
  • FIX: Fixed small memory leak in generated NSIS script (dialog handle left on the stack when calling nsDialogs::Show).

New version can be found here, as usual.
Mircea M#
Can't get a &quot;post&quot; function to be called...

Hi,

First off, thanks for this great tool! It saved a lot of time for me.

I do have one "small" issue with it. I am trying to add a "post" function to the page that gets the values from the elements selected / entered in the function created by the designer:
Name "IDI Remote Installer"
OutFile "IDI_Remote_Installer.exe"

!include Sections.nsh
!include MUI2.nsh
!include nsDialogs.nsh
!include LogicLib.nsh
!include Remote_Installer.nsdinc

Var arg

Page custom fnc_Remote_Installer_Show fnc_Remote_Installer_Leave
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"

Function fnc_Remote_Installer_Leave
StrCpy $arg "/S"
${NSD_GetText} $hCtl_Remote_Installer_dbcacheValue_Txt $0
StrCpy $arg '$arg /dbcache="$0"'
DetailPrint "Argument is: $arg"
FunctionEnd

Section
SectionEnd
Problem is, the fnc_Remote_Installer_Leave function is never called. The dialog is displayed, the "Install" button is there but when I click it, the installation just "completes". Nothing is written with DetailPrint.

Any ideas what I'm doing wrong?

Thanks!
Mircea M#
OMG, too early in the morning. I just realized I had actually put the DetailPrint in the "post" instead of in the section.
Never mind me...

Once more, really great tool! Thanks!
nicorac#
NSIS Dialog Designer only generates new .nsi files to be included in your existing NSIS script.
It manages 2 kinds of file: .nsddef which is an XML style dialog definition (used by NSIS Dialog Designer) and a .nsdinc file which is a plain NSIS script to be included in existing scripts (output only, can only be edited with its source .nsddef).

It cannot import existing files, sorry; you have to start your dialogs from scratch.
shirosakichi#
Thanks for fast replay, well, i soppose i'd have to start from scratch(sorry for my bad english). Again, thanks.