Archive: Change the installer size

Change the installer size

I've made an online installer using NSIS. I calculate what should be installed during the installation. However, when I select destination folder, the installation size is all wrong. I have the correct size in a variable - how do I change the installer size in the destination folder window?

Can I create a custom destination folder window?

I use code similar to this, which you might have to tweak in some places to make it work for you.



Section"InstallFiles" id1
SetOutPath "-"
File "${SRCDIR}\*.*"

>; False section
Section"New_Size" id2

>!define SetSize "Call SetSize"

>Function SetSize
StrCpy $SIZE"6474381" # ; size in bytes
; bytes to kilobytes
IntOp$0 $SIZE % 1024
IntOp $SIZE $SIZE/ 1024 ; rounded down
IntCmp$0 512 0 +2 0
IntOp $SIZE $SIZE+ 1 ; rounded up
SectionSetSize${id1} 0 ; clear size estimate
SectionSetSize${id2} $SIZE ; reset the size

>; Directory Page
>Function DirectoryPageShow
SectionGetSize${id2} $2
; Required space (reset)
${if} $
2 == 0
SectionSetSize ${id2} $SIZE
Originally posted by empezar
Can I create a custom destination folder window?
Why not? The NSIS directory page is pretty good though.

Thank you! It worked fine.