Archive: Dialogs.dll: My new plugin.


Dialogs.dll: My new plugin.
Hello dudes!

I just create Dialogs.dll. A plugin for call the Open and Folder browse dialogs.

Test it. Please post your opinions.
Thanks ;)

PS: See the readme file for details!


Yeah, basically it works, but how about adding more options, like to add support to appear the "Save File" dialog for example...

But I'll continue to try the System way, I'm planning to make a new header file using all the codes with System plugin... Now, about the Open dialog for my program, I'll use your plugin. Thanks.

Your DLL size is too small I think you just used 2 API for dialogs, am I right?


I use like 10 APIs, but mostly...yeah... for those two.
I could add the "Save" dialog.... ;) is not hard...

*Add it in the TODO list.

Thanks


Updated to versions 1.1:
Add it the "Save" dialog.


2Lobo Lunar
Did you add source and binary of your plugin in nsis development snapshot?


Lobo Lunar is in "da house"
Done it!
Now you can add you custom filter as many you want. :D
Updated to version 1.2:

Please see the readme file for the updated syntax.
Comments, please!!! Specially from users with Win95/Win98/NT

@KirillKr: No. This is my personal work. If the dev's want it, sure.... why not :)

>> No. This is my personal work. If the dev's want it, sure.... why not
Yes. I meant this too.


So... no comments? Than later today I'll put it in the Archive...


>> So... no comments?

Sorry, no app for that moment now...
Maybe in my experimental when i finished current update..


A comment :
I have used your dll for folder with success. It help me to remove the Page Directory that can not be executed inside the sections. Now my installation is more user friendly.

A feature request :
Could you had the possibility to select a disk only after selection of a file or a folder.


And know...
You can get it from the Web Archive. :cool:
Thanks to all the members that test the plugin. Thanks :)

@benchetrit: I didn't quite understand. Do you want to select a Drive unit?


Exactly, I want the user will be able to select a drive unit only. Moreover, if you could had some filters or exclusion list, it will be great. For instance, exclude a list like "C,D". Filters to exclude or include like : exclude "cdrom,networkdrive" or include "localdisk,removabledisk,floppy".


Ok, now I understand... However I think that will be adding another dialog, I have in mind "Drive Dialog".
And yeah, maybe some filters too, although I don't know how do that, yet :igor:.

I'll work in that tonight :)


@lobo lunar

If you continue in that direction, I will appreciate to have a string dialog for asking the user for a string, and a selection list for asking a user to select a (and why not multiple) value.


Hi benchetrit!

I try the Drive list, and there's isn't like a special dialog for units. There's an API for detect the phisical installed drives, but It can be done using system plugin. The code for this is simple, or I can point you in the right direction (and API).

Now, I can make the "asking" string dialog but, whay kind of values the users will select? Maybe some example of it will be handy...

TODO:
I will make a dialog-style like those InputBoxes that come with Visual Basic. This will be handy if you'd like to password protect your installer without the INI thing. :)

Good luck to me! :D


When I tell string dialog I mean input text.

I have a question concerning Open. Is it possible to select the list of the files to display in the file selector. For instance, if I put *.txt, *.txt will be in the file name input, and only *.txt file and obviously folders of the initial folder wil be displayed for selection.


oh, do you mean multiple selection files?
Is possible! :)

[edit]
I try a simple code snipet and NSIS doesn't give more features in looping and string manipulation. I should try another way to make NSIS outputing the multiple selection.
[/edit]


There is a little thing called "Callback Function", it loops everytime when a result is returned, but to return to the original function, you have to end pushing something to stack to the original function know you want to continue...

Have some examples like "Detect Drives" Archive page (see my signature) of that.


Well...that little thing is the easy part, dude ;)
The plugin have the callback function for the user selected outputvar.
That's not important, the important is get out the files since all are store in one var. Is not the "loop", is the handle for each file. I need separator, is not a typical "String function" or "Callback function", a separator to get path of the file in some place.
Nsis, as my begin question here is very limited. :(
Yes, there some ways to get that! I just need time. :rolleyes:


If I understood right:

the important is get out the files since all are store in one var.
Has a function called "StrTok" inside "StrFunc.nsh" in the include directory, it returns the string you want to be returned from a complex string. Like "Text" from string "Number|Variable|Text|GUID". It is not included on Archive (that is my AdvStrTok).

Hi Lobo Lunar

I do not want multiple selection for files, I just wants that the dialog Open only displays the files that respect a string for instance *.nsi, like the standard Open File dialog do.


Maybe you should say "Files Filter".


lol :D
Yeah! Filtering....


Dialogs::Open $HWNDPARENT "Nsis Files (*.nsi)|*.nsi|" "1" "Choose a file from the list" "$EXEDIR" .r0

Like this?

Yes like this.

If fact I am sorry I have made a mistake, I did not understood your examples. Now it works.

Bad code :
Dialogs::Open $HWNDPARENT "SYD Licence (*.syd)|" "1" "Select Licence File" "t:\" .r0

Right code :
Dialogs::Open $HWNDPARENT "SYD Licence (*.syd)|*.syd|" "1" "Select Licence File" "t:\" .r0

Thank you. And tell me when I could have a dialog for asking a string to the user.


lol! :)

No problem.
And about that dialog, is in progress now ;)


Updated to version 1.3 :cool:

what's new:
Added the InputBox with password support. Great to password-protect your installer.

Web Archive

Comments, please! :)


Updated to version 2.0.

What's new?
1. New CHM help file.
2. New output syntax style (see examples)
3. Some minor bugs.

The Web Archive.


Lobo Lunar,
I like what you did -
But when I drag the .nsi file into the compiler of the NSIS Application -
I keep getting a compile error. Am I doing something wrong ?
This is my first time using the NSIS Application.
-
Thanks.


Lobo.
Got it to work.
-
How can I specify a specific file that
I want users to save ?
-
This setUp will launch from another .EXE living on a CD-Rom
and the file that I will want to save lives on the CD-Rom as well. Can I use this to perform this task ?
-
I feel like I'm close.
-
Thanks


How can I specify a specific file that
I want users to save ?
I have to change the source code, or you can use the filter telling the user wich one he/she have to use (see Save parameters).
This setUp will launch from another .EXE living on a CD-Rom
and the file that I will want to save lives on the CD-Rom as well. Can I use this to perform this task ?
Since the Installer (EXE) and file (to run) is in the same folder, you can use $EXEDIR with Exec functions from NSIS to execute the file.

Updated to version 2.3

New:
New algorithm in the InputRegCode.
Web archive


no major update, just add the password flag in InputRegCode

Web Archive


I had finally come across a situation where I needed an InputBox and found your plugin. EVERYTHING WORKS GREAT!

But just in case you get "bored", I though I'd throw a few suggestions your way. ;)


1. It would be nice to be able to specify a default button on the InputBox to allow the user to simply press "ENTER" and have it accept the answers.

2. Another nice option would be limit to the number of characters the user would be allowed to type.

I know that I could use a StrLen operation AFTER the InputBox is closed, but I was thinking perhaps the InputBox could me made to just not accept any more characters after x number that you specified. This would then eliminate the need for the extra error checks in the NSIS code. (Of course, it would then be up to the NSIS developer to explain this to the user in the InputBox text promt.)

3. (perhaps more of a challenge) the open/save dialogs have the standard shortcuts for "history" "my Documents", etc. Is there any way to change this and allow a user to specify his/her own icon and folder? I know you're probalby using a standard Windows control which may not have this ability, but I'd thought I'd throw it out there anyway for you to ponder. (I've always thought this might be a useful feature in other applications as well...)

Keep up the great work!
:up:


Hi Comperio :)

Thanks for your post...

1. In my TODO list will be an option to press enter and continue the installation :up:

2. Yes, I can... but than again... will be increasing the parameters procedure....but ok, added in my TODO list :D

3. I don't know... I'll have to check that...


Heya, just come across this excellent plugin.

I am trying to recreate the behaviour of the built-in file select control (a text box and a browse button) with this plugin, so I can have a custom dialog, and thought I could use this.

2 questions:
1) The save dialog takes a variable (e.g. ${VAR_5}) to be used as an output. Do I need to push this before I call and pop it twice (once to get the data, the other to restore the stack) to make my function "clean" in terms of stack management?

2) Can I suppress the automatic messagebox which asks if I want to replace the file? I check this later, on page exit, as this catches filename clashes if the user enters the file in the textbox themselves, as well.


Hi there:

1) No, you don't.

2) No, is a flag that it might come handy if the file is already there. But If you want to overwrite w/o warnings try FileOpen from nsis.


Hi Joel,

I test some examples especially the inputregcode.nsi

Could u increase the examples details on how to add multiple ones and where does the username and key and serial be placed to allow a successful entry


I could...I'll try to work it on this weekend, but those features will be enabled on dialogsEx


Your plugins are interesting especially the nsweb so does this but more details on each example to how can one add more users into it.

Thanks for trying your best


Hm ok thanks, I literally didn't want the word "Open" - I wanted "save". Oh well, I found a (memory-sucking) way of doing it involving an extra global variable.

Thanks for the reply and the plugin!


Archive: Dialogs.dll: My new plugin.


dialogsEx can customize that Open file dialog


Update this plugin:

-Changes:
Just bug fix on keygen.


Proposed file name in Save Dialog
Hi Joel,

I just want to ask you about the adding the possibility of the Dialogs::save control, to be able to give a proposed file name in the File Name textbox? This is very good, because the users sometimes do not know which file name to use for the program, and they can mix the things up.

Or you can post your source code of the control here, so we can try to enhcance it ?


Thanks,
Robert


Hi lobo lunar

Does your plugins inputpass.nsi allow the follow

Loop:
Dialogs::InputBox "Application Protecter" "Application Password Required.$\r$\nPlease enter the correct password:" "OK" "Cancel" "2" ${VAR_5}

## Get MD5 string for password
MD5DLL::GetMD5String $5
Pop $5
;nsis is the password:
StrCmp $5 '${Password1MD5}' OK WRONG
StrCmp $5 '${Password2MD5}' OK WRONG

;Is wrong!
WRONG:
Messagebox MB_YESNO|MB_ICONSTOP "Bad password. $\r$\nDo you want to try it again?" IDYES Loop
goto Exit

;Is correct!
OK:

Exit:
Quit
I am trying to use ur plugin to make a multiple password...
1. it will check StrCmp $5 for to see if user type password correctly.

2. if password wrong it will loop back to Loop:

3. if password exist in the list it will carry on the next thing.

Yes! Right now I don't have the time I want to make more examples, but try a Loop and use the array plugin if you want more than one serials or passwords.


I see, well I not familiar with the arraysplugin though I had gone throught most of the examples. I do not know how to implement it to merge with ur plugin.

but thanks for taking time to reply


Joel,

Forgive me is this is answered elsewhere in the forum. I have been using NSIS for a few years now and have a regularly used installer that implements your Dialogs.dll. It has had over 4k installs without an NSIS related problem until yesterday. A user tried to install on a WinXP box with admin privileges and got the message:

Could not load: C:\DOKUME~1\<...snip...>\Dialogs.dll
No folder was selected by the user.

Do you have any suggestions?

Thanks,
Jeff


Any chances to post the code used?


Here is the snippet that pertains to the Dialogs:
===================================================
Start:
Dialogs::Folder "Working directory" "Choose a working directory:" $EXEDIR ${VAR_1}
StrCmp $1 "" Cancel Ok
Cancel:
DetailPrint "No folder was selected by the user"
MessageBox MB_YESNO|MB_ICONEXCLAMATION \
" No folder was selected by the user. $\n$\n \
Are you sure you want to quit the installation?" \
IDNO Start
quit
Ok:
DetailPrint "User selected working folder: $1"
goto Exit
Exit:
===================================================

The user is using WinXP Pro SP2. Also, the same installer worked on one of his machines (personal) but not the other (work). He says he has the same permissions on both.

The installer was build with NSIS version 2.21
The Dialogs.dll is dated 7/13/06

Thanks,
Jeff


Does his work computer have a %TEMP% folder?
Ask him to open Windows Explorer and put %TEMP% in the path and hit enter (or enter "explorer %TEMP%" in start>run. If he does this while the installer is running, he should find a nsXXX.tmp folder in there. If it's not there, then I'd assume his temp folder is missing some permissions.

-Stu


Stu,

Thank you for your suggestion. I asked the user to monitor %TEMP% while the installer was running. He reported seeing a nsXXX.tmp folder as well as a file. I also asked him to check the space available and there were 50 GB free.

Thanks,
Jeff


I re-test in few xp machines and everything works as should be. I don't understand why in that machine doesn't.
Did you use InitPluginsDir on you ".onInit" function? The error "couldn't load" is because nsis wasn't enable to load the plugin. Something is wrong there.


The next step would be for him to open the nsXXX.tmp folder after the dialogs.dll plugin should have been executed (i.e. when the error is displayed) to see if the plugin is in there.

-Stu


I am not calling InitPluginsDir in the ".oninit". Does it need to be called if I am not accessing the $PLUGINSDIR directly?

I have tested on multiple WinXP Pro SP2 systems like the user’s. Of the many installs to date, probably the majority of them have been on WinXP. The user tested the installer successfully on his home machine with the same OS, so I do not think it an OS specific problem.

I just emailed the user to check for the dialogs.dll in the %TEMP% folder.

Thanks,
Jeff


The user sent me the following information regarding the state of %TEMP% during the installation:

the folder nsXXX.tmp contains follows files:
- Dialogs.dll (12kb)
- ioSpecial.ini (1kb)
- modern-header.bmp (30kb)
- modern-wizard.bmp (155kb)
- Splash.dll (4kb)

The file nsXXX.tmp in the temp-folder has 0 kb
This temp-folder is on the local drive c:\


Well...I'm sure in not the plugin.
As I said, something is wrong there.
:(


I updated to the latest release of NSIS and added exception handling around the call to Dialogs.dll. If there is an error I default the directory value to $DOCUMENTS (I am looking for a working directory for the application). This enabled the user to install.

I apologize for adding the exception handling and not testing the latest release for the error by itself. I did not want the user to loose patience.

Thank you for all of your suggestions and help.

Best regards,
Jeff


i cant get dialogsex working - only dialog...
dialogsex always returns an empty string (samples SAVE/OPEN dont work)

any hints?

XP SP2, NSIS 2.21


It's probably the same as my last post on the DialogsEX thread... :(

Maybe Joel can give us some feedback.


Is I said, is strange...all my examples were tested in Win2k, WinXP and Win2003.