Old 15th March 2006, 07:13   #1
rmccue
Member
 
Join Date: Aug 2005
Location: Australia
Posts: 71
Unhappy CopyFiles not copying in sub dirs

I am trying to copy all zips in all sub directories. I am using:
code:

CopyFiles "$EXEDIR\*.zip" "$INSTDIR\"


Why isn't it working?
Also, I want to include skinning with Wansis as optional so someone can download the skinning pack, unzip it and skin away. How would I do this?
rmccue is offline   Reply With Quote
Old 15th March 2006, 07:51   #2
RobGrant
Senior Member
 
Join Date: Sep 2004
Location: Nottingham
Posts: 263
You're telling it to copy all zip files in $EXEDIR to the install directory; your command doesn't mention subdirectories. Just as CopyFiles "$EXEDIR\hello.txt" "$INSTDIR\" won't try and find hello.txt in any subdirectories in $EXEDIR.

You want to use something like the Locate function, and put a CopyFiles in the callback.
RobGrant is offline   Reply With Quote
Old 15th March 2006, 08:08   #3
Instructor
Major Dude
 
Join Date: Jul 2004
Posts: 671
code:
Name "Output"
OutFile "Output.exe"

!include "FileFunc.nsh"
!insertmacro Locate

Section
StrCpy $R0 "C:\ftp" ;Directory copy from
StrCpy $R1 "C:\ftp2" ;Directory copy into
StrCpy $R2 "*.zip" ;Wildcard
StrLen $R3 $R0
CopyFiles /SILENT '$R0\$R2' '$R1'

${Locate} "$R0" "/L=D" "LocateCallback"

IfErrors 0 +2
MessageBox MB_OK 'error'
SectionEnd

Function LocateCallback
StrCpy $1 $R8 '' $R3
CreateDirectory '$R1$1\$R7'
CopyFiles /SILENT '$R9\$R2' '$R1$1\$R7'

Push $0
FunctionEnd


Last edited by Instructor; 15th March 2006 at 08:28.
Instructor is offline   Reply With Quote
Old 16th March 2006, 06:46   #4
rmccue
Member
 
Join Date: Aug 2005
Location: Australia
Posts: 71
Thanks Instructor, but I just want it to put all in the same directory. What do I change?
rmccue is offline   Reply With Quote
Old 16th March 2006, 06:49   #5
rmccue
Member
 
Join Date: Aug 2005
Location: Australia
Posts: 71
I changed:
code:

CopyFiles /SILENT '$R9\$R2' '$R1$1\$R7'


to
code:

CopyFiles /SILENT '$R9\$R2' '$INSTDIR'

rmccue 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