Everything is fine but I have few problems:
I am creating a button that user can choose directory:
${NSD_CreateButton} 265u 49u 60u 14u "Browse..."
Pop $BUTTON
${NSD_OnClick} $BUTTON .OnClick_BROWSE_BUTTON Now, lets add some action... I am using SelectFolderDialog control. Function .OnClick_BROWSE_BUTTON
NsDialogs::SelectFolderDialog "Select directory" "C:\"
Pop $0
${If} $0 == error
Abort
${Else}
; $0 <--- this is our new directory
${EndIf}
FunctionEnd Seems to be easy, but...Here are the problems:
1. We don't want to see Network drives (\\SOMETHING) in select folder dialog. How to create SelectFolderDialog control without Network drives?
2. We want to see network drives (\\SOMETHING) in select folder dialog. But how to get size of this (available disk space of network disk)?
To get disk space of local disk I use this code:
(I also check if drive is local or removable etc, but it is not related to my issues (System::Call "kernel32::GetDriveType(t R0) i.R1"))
; $0 <-- Our directory path
; First, I get drive root of selected directory
${GetRoot} $0 $R0 ; -> $0 = C:\My Path\Test, $R0 = C:
; So, I have got, for example $R0 = 'C:'
; Now I get drive available disk space (bytes)
ClearErrors
${DriveSpace} "$R0\" "/D=F /S=B" $R1
; I have got available disk space in $R1
${If} ${Errors}
StrCpy $R1 0
MessageBox MB_OK "Drive Space: $R1 -> SOME ERROR"
Abort
${EndIf}
;MessageBox MB_OK "Drive Space: $R1" This works fine. But when I try to use this for Network directory on network drive it returns nowthing...What am I doing wrong? Maybe ${GetRoot} fails? For sure ${DriveSpace} need a drive letter and get something like '\\blablabl\...
If someone could show some working example I would be happy 🙂
I am sure I am missing something...
I forgot to mention - NSIS directory page (built-in) do it correctly!
Regards,
-Pawel