say_ook
6th April 2007 19:14 UTC
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?
Anders
6th April 2007 19:28 UTC
BASE_CONTENT_SIZE is a define not a variable, use ${BASE_CONTENT_SIZE}
say_ook
6th April 2007 19:45 UTC
Thanks! That did it. I keep thinking of ${} in bash terms.
pinolo
13th June 2007 17:25 UTC
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.
kichik
13th June 2007 19:17 UTC
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.
pinolo
13th June 2007 21:09 UTC
Thanks a lot! That worked for me.