Skip to content
⌘ NSIS Forum Archive

Select folders dialog with checkboxes

9 posts

SkywalkerY#

Select folders dialog with checkboxes

Hi. I need dialog for multiple select folders. In google i'm not found anything helpful. How can i do or find this dialog?
MSG#
Actually it does. You can use:

!insertmacro MUI_PAGE_DIRECTORY ;normal directory page, uses $instdir
!define MUI_DIRECTORYPAGE_VARIABLE $YourVar
!insertmacro MUI_PAGE_DIRECTORY

But I agree that a custom nsDialogs may may be more appropriate.
SkywalkerY#
No. I need this not for $instdir. I want a button, which opens dialog. User selects several working folders and they saved into config of my program. A count of working folders is unknown. So, I need select folders dialog with checkboxes (like in Explorer of Windows 7).
MSG#
Aha, you want a listview element with checkboxes, containing folders... Hmm, I don't think I've ever seen anyone doing that before. There's this header: http://nsis.sourceforge.net/Header_file_for_Listview that might help out. But how to populate it with a nested folder view... I can't help you with that. Wait for one of the win32 gurus to jump in.
Anders#
While it might be possible to implement a treeview or listview with checkboxes and item's from the file system, the amount of system code with be huge. You might want to consider writing a plugin or maybe rethink your options...
T.Slappy#
!insertmacro MUI_PAGE_DIRECTORY ;normal directory page, uses $instdir
!define MUI_DIRECTORYPAGE_VARIABLE $YourVar
!insertmacro MUI_PAGE_DIRECTORY
Hehe, nice, I did not know about this!
Writing custom plugin is probably the best solution, but as we are in NSIS forum I suggest to write own header and use nsDialogs 😁
SkywalkerY#
So, I'm cheeting🙂 I added listbox and two buttons: add and del. Add button opens standart select folder dialog and selected folder add in listbox. Del button removes item from listbox. That's all.