Hi,
Is there a way to display the available space on the
Components page instead of the Directory page since I am
not using the Directory page (MUI)?
Thanks in advance.
Rishi.
Available Disk Space on Components page.
6 posts
NSIS doesn't show the available space on the Components page because the user has not yet selected a drive to install the program on at that point in the installer. If you wanted to put a disk space counter on the Components page, you could use System.dll to get the available space on C: and then use SendMessage to set the text on the Components page. However this might require modifying the UI file with Resource Hacker or similar.
Here's a simple example of setting the text:
Here's a simple example of setting the text:
-dandaman32
!define MUI_PAGE_CUSTOMFUNCTION_SHOW SetText
Function SetText
; Here you want to put code to get the abount of disk space available on C:.
; This example assumes that the value is stored in $0, and that the value is in MB.
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1023
SendMessage $0 0xC 0 "STR:Space Required: replace_with_space_required$\nSpace Available: $0MB"
FunctionEnd
Hi dandaman32, in the quot, you mentioned "use System.dll to get the available space". Could you guide me to do that? Thank so muchOriginally Posted by dandaman32 View PostNSIS doesn't show the available space on the Components page because the user has not yet selected a drive to install the program on at that point in the installer. If you wanted to put a disk space counter on the Components page, you could use System.dll to get the available space on C: and then use SendMessage to set the text on the Components page. However this might require modifying the UI file with Resource Hacker or similar.
Here's a simple example of setting the text:
-dandaman32
!define MUI_PAGE_CUSTOMFUNCTION_SHOW SetText
Function SetText
; Here you want to put code to get the abount of disk space available on C:.
; This example assumes that the value is stored in $0, and that the value is in MB.
FindWindow $0 "#32770" "" $HWNDPARENT
GetDlgItem $0 $0 1023
SendMessage $0 0xC 0 "STR:Space Required: replace_with_space_required$\nSpace Available: $0MB"
FunctionEnd
Hi jp deruiter, thank for your link.Originally Posted by jpderuiter View Post
Would you mind helping me for another problem?
I want to add a text "Space avaialble" under the text "Space required" in the component page. I tried to customize the page with MUI_PAGE_CUSTOMFUNCTION_SHOW.
But it didn't work to me.
!define MUI_INSTALLOPTIONS_INITDIALOG CreateLabel
Function CreateLabel
${NSD_CreateLabel} 2u 110u 66u 13u "Space available:"
FunctionEnd
Just like in the post you quoted before.