- NSIS Discussion
- Custom Page with FileSelect-Button
Archive: Custom Page with FileSelect-Button
klopfdreh
12th February 2008 10:02 UTC
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!
Afrow UK
12th February 2008 13:02 UTC
Use nsDialogs it's much easier, otherwise check the testnotify.nsi example.
Stu
klopfdreh
12th February 2008 13:06 UTC
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!
klopfdreh
12th February 2008 13:32 UTC
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!
Afrow UK
12th February 2008 13:46 UTC
Use the macros in nsDialogs.nsh as described in the manual.
Stu
klopfdreh
12th February 2008 13:55 UTC
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.
Afrow UK
12th February 2008 14:03 UTC
nsDialogs is included with NSIS. Just make sure you have the latest version of NSIS.
Stu
fabian.rap.more
12th February 2008 14:05 UTC
nsDialogs.nsh will be in the include folder where you installed NSIS
[edit]Oops..........i should refresh the page more often before posting [/edit]
klopfdreh
12th February 2008 14:08 UTC
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
klopfdreh
12th February 2008 14:29 UTC
Great - Got a button now and when I'm pressing on that button a filerequest-dialog is opening! :)
So still some questions left:
- How can I change the description in the modern ui?
- How can I setup a multiple selection and run throw the result with a loop to copy those files in the installationdirectory?
Thanks for the great help
Afrow UK
12th February 2008 15:35 UTC
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
klopfdreh
13th February 2008 06:55 UTC
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: