Archive: How do I check disk size?


How do I check disk size?
If disk size is not enough big,how i justify?
Thank everyone answer!


This function checks free disk space. But why would you want to do that? NSIS doesn't let the user install if there isn't enough disk space on the directory page.


I found this useful because I'm writing a massive uninstaller and I want to calculate the amount of free space before and after my uninstaller runs to show the user how much space they got back, I hope it works.


This could be useful when the user is going to install to a different drive other than C: because then it will check the disk space say on the D: drive but will not check the C: drive space and you still need temporary space on the C: drive to extract the files to do the install so if your C: drive was totally full you could not do the install to E: even though it would appear you had enough space.


Also what could happen is say the user installs to the D: drive but there are dll's installing to the C: drive. The installer calculates the space of all the files being installed to drive D: instead of calculating how much space is required on each drive