On the modern UI directory page it reports disk space needed and available can report wrong at times
My installer needs 42GB to install and the hard drive i am installing to has over 4TB free
It is reporting that i have 5.6GB free and will not let me click install as the space is to small
I bloated my hard drive by copying over some data just to have less than 4TB free and then it reported that i had 3950GB free and i could continue.
From what i can tell this is due to the usage of a 32bit int for the disk space calculation here. Hopefully there is a way to make this use 64bit address space so we can report larger drives or change the math to use MB or GB instead of KB to get more bits to use.
There are some drive space calculation plugin's that use system::Int64Op to find drive size so maybe similar methods can be used here?
Similar issue was reported in 2.44
https://sourceforge.net/p/nsis/bugs/896/
The free space is read as a 64-bit number but is then right shifted by 10 to convert to KB and then stored in a 32-bit variable.
This prints
I guess when NSIS was originally written even having gigabytes of free space was a luxury. All jokes aside, doing 64-bit math and then displaying the result on Win95 without using the CRT is not fun which is probably why it was designed like this.
Thank you for looking in to this, Can this be fixed then? 6TB drives are not that expensive at this point, seems like large drives are becoming more and more normal. I think it could become a bigger problem for other people.
We could leave the 64 bit value as is, and then when we do the formatting for MB, GB, etc, we do a compare for this 32 bit overflow, and bit shift it to convert to KB, MB, or whatever. So something like this (my bit shifting and limits are probably wrong):
This counts up so the bigger the free space the longer it takes. The logic can be swapped too, so the bigger the free space the less time it takes.
Last edit: Jason 2015-04-17
The size texts are in the language files and we currently don't have texts for anything beyond GiB. For smaller sizes with also want to maintain the "floating point" calculation...
It now uses the full 64 bits for the size check while the display code is limited to 4194303 TiB and will display the wrong value if you have more free space than that.