Archive: How to disable the "Make new folder"


How to disable the "Make new folder"
Hello

Can any one tell me how to disable the "Make new folder" button on directory browse dialog.

I am using Moden UI.

Also in my installer I use folder browse dialog to select a folder on the system by user and I check for a particluar file.Is there any option to keep the folder browser dialog util the user selects a valid Folder(cotaining the required file).(he can close the dialog using cancel button if required)

Can any one show me the code how to do this using Modern UI?

I am creating acustom page using moden UI in this case.

Best Regards

Joseph


To disable it, you have to change the source code, add the BIF_NONEWFOLDERBUTTON flag and recompile NSIS. There was a recent thread about this in InstallOptions.

Without a custom page, use the .onVerifyInstDir callback function to keep the user on the browse dialog until the selected directory is valid. With a custom page, it's not possible, maybe with InstallOptionsEx.


Here's a suggestion that might work, if you were up to coding it:

The DialogsEX plugin has a 'Classic Folder Box" that doesn't include a 'create new folder' dialog that you might be able to use.

However, since this plugin isn't a 'page' (it's actually a pop-up folder browser), you'd have to make your own custom page using a text box and a button. Using the page's leave function, you could look for a button click and display the folder browse screen. Use SendMessage to update the text box with the return value of the folder box. You could also let the user type directly into the text box and then check in the page's leave function to see that the folder name they type actually exists.

I know, it's probably easier to just hack the source code, (which may be what you'll do anyway), but I thought I'd at least offer an alternative.


Hi all thank you for your quick reply,

Hi kichik
I got the new Installoptions.dll from the other thread.Why this option can be part of standard source and can be enabled by seting some paramets?

Hi Comperio,

I tried the link you pointed.But it only goes to your site.But no file was available for download

http://plugins.joelito.net/descargas...=dialogsex.zip

best regards

Joseph


You can also try the DirPage plugin:
http://forums.winamp.com/showthread....hlight=dirpage

-Stu


Do these answers still stand? I would like to do exactly the same (in fact just greying out the "Make New Folder" button should be OK) in MUI2.

At the moment the thread Kichik refers to in the second post uses InstallOptions which I'd rather not use as it is now described as deprecated, and it seems an overkill: MUI_PAGE_DIRECTORY is so straightforward to use! DirPage is not ideal (see developers comment section on that page) and I wonder how to call DialogEx when pressing the Browse button instead of the default Browse dialog.

What would the solution of recompiling the source code (with a greyed out "Make New Folder") consist of?

Thank you,

Eric


Why do you want to add pointless restrictions?

The user could just create a new folder in explorer or run your installer as setup.exe /S /D=c:\whatever\they\want


How to disable "Make new folder"
Thank you for your reply Anders.

I understand that what I'm trying to do is not what the installer was exactly created for, however in my case (very controlled environment) the user cannot set where he wants to install my software.

I'm using the Directory page/Browse to folder dialog only to look for the folder where the user has copied files that are required in a very specific upgrade type.

In that context I would wish not to give the user the ability to make a new folder as this is not useful in this case.

It's not a major problem, but surprisingly everything else can be changed to make the Directory page used not to set the output folder (which is what the control was created for), but as some kind of user input.

As I'm not the only who's asked something along those lines, I thought that this is a case that might happen again in the future.

Great work on that page and control by the way, it has literally saved me hours (if not days) and the solution was there in only 4 lines of additional NSIS code!

Many thanks!

Eric