rmccue
15th March 2006 08:13 UTC
CopyFiles not copying in sub dirs
I am trying to copy all zips in all sub directories. I am using:
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?
RobGrant
15th March 2006 08:51 UTC
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.
Instructor
15th March 2006 09:08 UTC
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
rmccue
16th March 2006 07:46 UTC
Thanks Instructor, but I just want it to put all in the same directory. What do I change?
rmccue
16th March 2006 07:49 UTC
I changed:
CopyFiles /SILENT '$R9\$R2' '$R1$1\$R7'
to
CopyFiles /SILENT '$R9\$R2' '$INSTDIR'