Check for available disk space and required disk space in NSIS


Get available disk space:
We use the macro DriveSpace

Section
    ${DriveSpace} "C:\" "/D=F /S=M" $R0
    ; $R0="2530"
SectionEnd

Get the required disk space of your program
To do this, you will in turn get the required disk space of every section in your script, then we will plus all of the results. We use the SectionGetSize instruction to get the required disk space

Section "plink" secPlink
    File "plink.exe"
SectionEnd
SectionGetSize ${secPlink} $R1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.