Archive: Custom Page with FileSelect-Button


Custom Page with FileSelect-Button
  Hello,

I want to create a Custom Page with InstallOptions. On this page there should be a button and when the user clicks on it he can select some files, that are copied in a folder located in the installationfolder. What I finished is to create the InstallOption and to show the Custom Page via Macros in my Installer.

The problem still left is to popup the filerequest dialog when the user clicks on the button. Im using a Dialog-Plugin that is working already:

Dialogs::Open "Jar Files (*.jar)|*.jar|" "4" "Choose a file from the list" $EXEDIR ${VAR_6} 
I'm new to NSIS and I don't know how to handle the click event, so is anyone able to help filling the two functions

TestStart

>...
>FunctionEND

>Function TestLeave
>..
>FunctionEND
>
The last thing I think I should post is the InstallOption ini File:

***93;

>NumFields=1

>***91;Field 1***93;
>Type=Button
Left
=244
Top=121
Right=294
Bottom=136
Text=Button
Flags=
>State=DirBrowseButton
>
Thanks a lot!

Use nsDialogs it's much easier, otherwise check the testnotify.nsi example.

Stu


Ok, thanks a lot! I will look the manual of nsDialogs and if there are any Questions I'll post it here!

Nice Support here!


How can I place the button in the center space in the Custom Page? I used this for now:


    nsDialogs::CreateItem /NOUNLOAD BUTTON Test ${BS_LEFT}|${BS_TOP} 150 100

Pop $BUTTON
GetFunctionAddress$0 OnClick
nsDialogs
::OnClick /NOUNLOAD $BUTTON $0
>

OnClick

MessageBox MB_OK clicky
FunctionEnd
>
But there is only an error when I click on cancel.

Thanks!

Use the macros in nsDialogs.nsh as described in the manual.

Stu


Can you give me the URL to the correct download - I thinks I got an older ZIP File there is no nsDialogs.nsh or a manual.


nsDialogs is included with NSIS. Just make sure you have the latest version of NSIS.

Stu


nsDialogs.nsh will be in the include folder where you installed NSIS

[edit]Oops..........i should refresh the page more often before posting [/edit]


I'm using 2.34 2.35 is the newest. I read the changelog. There is no entry about nsDialogs, so I think I can use it as well as in the newest.

Edit: Ok got the manuel and my first page running with nsDialogs! I'll make some tests furtheron


Great - Got a button now and when I'm pressing on that button a filerequest-dialog is opening! :)

So still some questions left:


Thanks for the great help

Dialogs plug-in probably doesn't allow multi-select but DialogsEx may do. nsDialogs also has a file selection macro I believe if you haven't tried it.

Do you mean MUI_HEADER_TEXT for the description?

Stu


Great, MUI_HEADER_TEXT was exactly what I was looking for and furtheron I will get the Multiselection Dialog running for me with DialogsEx!

Thanks so far!

Edit: There is no documentation about how to get DialogsEx can select multiple files, anyone here know how to do? :igor: