Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   CopyFiles not copying in sub dirs (http://forums.winamp.com/showthread.php?t=240899)

rmccue 15th March 2006 07:13

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?

RobGrant 15th March 2006 07:51

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 08:08

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


rmccue 16th March 2006 06:46

Thanks Instructor, but I just want it to put all in the same directory. What do I change?

rmccue 16th March 2006 06:49

I changed:
code:

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


to
code:

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



All times are GMT. The time now is 17:56.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.