Skip to content
⌘ NSIS Forum Archive

Addsize command

5 posts

gugaliashashank#

Addsize command

Is it possible to assign the value to addsize command at run time, or through a variable. I tried this

push 256000
pop $R0
addsize $R0


but this does not work. Only thing which works is giving a constant value with addsize

addsize 256000
gugaliashashank#
SectionSetSize is also not working for me see the code below which i am using

Function .onInit
push 256000
pop $R0
sectionsetsize sec01 $R0


I am not directly giving 256000 because i want to use a variable instead of constant value. The above code is not working for me, It is not giveing any error during compliation but its not giving me the correct result
gugaliashashank#
infact giving constant value is not working

Section "SCLinks" SEC01
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\Application\ Media.lnk" "$INSTDIR\Media\Media.exe"
SectionEnd


Function .onInit
sectionsetsize sec01 $R0
FunctionEnd
Comperio#
You need to use the proper syntax when referring to sections.
From the previous example, it should be this:
Section "SCLinks" SEC01
SetOutPath "$INSTDIR"
CreateShortCut "$SMPROGRAMS\Application\ Media.lnk" "$INSTDIR\Media\Media.exe"
SectionEnd

...

Function .onInit
StrCpy $R0 256000
SectionSetSize ${SEC01} $R0
FunctionEnd