I have built an installer to install application using inno setup.But i want to display an error message showing that there is not enough space in the drive or path where i am going to install application if there is no space available. By default i am getting inno built in ability to show message when there is no space available in the hard disk or selected path. but it shows YES and NO button to continue or cancel . Here i want to show error message with a OK button and when the user clicks ok button it should stop installation. Please help me on this issue. i could not find any ways to do so. i have called both GetSpaceOnDisk64() and GetSpaceOnDisk() which are not working and throwing exception
i am getting the error . please have a look at the attached image
To determine a free space on a drive of a specific folder (in your case the selected directory), you can call the
GetSpaceOnDisk
orGetSpaceOnDisk64
function. The difference between them is that the first one is able to return space info in bytes as well as in megabytes. The latter returns this info just in bytes. For the following example I chose the first mentioned function, so you can decide in which units you want to operate by modifying a single boolean parameter:Maybe my answer looks like off-topic. I had more or less the same problem.
If you have in the files section a check function made by yourself, setup can only count the number of (Mega)bytes of those files which have "normal" check flags.
A way to avoid this is count-up the bytes by yourself and put the result in the ExtraDiskSpaceRequired directive in the [setup] section