Old 2nd August 2004, 01:37   #1
randomperson83
Junior Member
 
Join Date: Aug 2004
Posts: 2
Copyfiles and Variable trouble

Ok, I'm either reading something incorrectly or theres a bug in NSIS somewhere... probably I'm reading it incorrectly...

I have this macro/function thingie, and it produces an error on this line:
code:

CopyFiles "$EXEDIR\Updates\$R1\$R2" "$R0\$R2" "$R3"


And... well I've tried a number of different things. And I can get it to work without the third parameter... but for some reason, with or without quotes, the third parameter doesn't work and it flags a compile error. Any ideas?

Here is the code for the entire macro/function.

code:

Function fCopyAFile

;fType = R1, fName = R2, fSize = R3

Pop $R3
Pop $R2
Pop $R1

StrCpy $R0 "$INSTDIR\Bin"

StrCmp "$R1" "IE" cIsIE
StrCmp "$R1" "XP" cIsNormal
StrCmp "$R1" "2k" cIsNormal

cIsIE:
StrCpy $R0 "$INSTDIR\Bin\IE6"
cIsNormal:

CopyFiles "$EXEDIR\Updates\$R1\$R2" "$R0\$R2" "$R3"
IfErrors "" cEnd

MessageBox MB_RETRYCANCEL "Error copying $EXEDIR\Updates\$R1\$R2! Try again?" IDRETRY cIsNormal
Abort "Could not copy $EXEDIR\Updates\$R1\$R2"
cEnd:

FunctionEnd

!macro CopyAFile fType fName fSize

Push fType
Push fName
Push fSize
Call fCopyAFile

!macroend


randomperson83 is offline   Reply With Quote
Old 2nd August 2004, 02:01   #2
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
I think that's because you aren't using it in a Section (where the "size" parameter is supported). I don't see this information in the documentation either.

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 2nd August 2004, 02:23   #3
randomperson83
Junior Member
 
Join Date: Aug 2004
Posts: 2
Hmm...

a) Just an aside... My macro at the bottom had the actual words in there.. not variables..

b) When I change it to something like:
code:

CopyFiles "$EXEDIR\Updates\$R1\$R2" "$R0\$R2" 1000


It works fine and doesn't complain...


Isn't it supposed to work with variables though?
randomperson83 is offline   Reply With Quote
Old 2nd August 2004, 13:29   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
That bit (1000) is probably set on compile-time only.

-Stu
Afrow UK is offline   Reply With Quote
Old 5th August 2004, 19:08   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
It is compile time. Use SectionSetSize.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump