Archive: Change the total space required variable


Change the total space required
Hi All,

I want to change change the minumum space required for installation to a prefix value instead of the size of installer. How i can do that?


I'm not sure what you mean by "prefix value".
There's an AddSize command which you can use to increase the space reported as being required for a given section:

AddSize sizeInKb

http://nsis.sourceforge.net/Docs/Chapter4.html#4.6.1.1


I mean to say that in the installer page, there are two static text

Space required: 50MB
Space available: 30GB

I want to change this Space required to 250MB by default. HOw can i do that?


Then you should put AddSize 204800 in the applicable section. That'll add the 200MB (since 1MB=1024KB) you're after, and you're not going to suddenly have 100MB jump to 2100MB.


But that was just an example of 50 MB, it can be 60 or 70 or 100 anything i dont know what is the size of my installer, I tried to get the size of my installer also but its not working, I am getting error in the code i have mentioned below.

Section GetInstallerSize
System::Call 'kernel32::GetModuleFileNameA(i 0, t .R0, i 1024) i r1'
${locate::GetSize} $R0 "/G=0" $var1 $var2 $var3
SectionEnd


I have include locate.sch and I have also downloaded the locate.nsh and locate.dll


The thing is, it's never going to make sense to just add a digit. There's a *huge* difference between changing 50 to 250, vs. changing 100 to 2100. I strongly fail to see why it is you need a *prefix*, instead of just adding the amount you're really after.

If you're really desperate, you could probably change the text using a Windows message, but I don't have the code that would be required for that


Changing the text is impossible as NSIS will change it back for every change of the installation directory by the user. What you should do is use SectionSetSize to set the exact size you want for your sections.