Archive: CopyFiles with defined size_of_files_in_kb


CopyFiles with defined size_of_files_in_kb
I'm trying to set the size_of_files_in_kb of CopyFiles with a defined value but it's not working. This is the last thing standing in the way of me scripting the build.


# This results in a compile error on the CopyFiles line
!define BASE_CONTENT_SIZE 155351
CopyFiles "$EXEDIR\DATA\*" "$APPDATA" $BASE_CONTENT_SIZE


# But this works
CopyFiles "$EXEDIR\DATA\*" "$APPDATA" 155351

Is it a bug, or am I doing something wrong?

BASE_CONTENT_SIZE is a define not a variable, use ${BASE_CONTENT_SIZE}


Thanks! That did it. I keep thinking of ${} in bash terms.


I re-open this because it's tightly related.

I'm trying to make the same thing but I always get compilation errors for the CopyFiles command.
I have this $R1 coming out of Locale::GetSize and want to use it as optional size argument for the CopyFiles command. How do I pass the value of $R1?

As for say_ook's example, passing the $R1 doesn't work,

CopyFiles "$EXEDIR\*" "$INSTDIR" $R1


while passing a hardcoded integer works.

You can't use variables there. That parameters of CopyFiles changes the size of the section in compile-time. To change it at runtime, use SectionGetSize and SectionSetSize.


Thanks a lot! That worked for me.