Ron.Stordahl
9th September 2011 05:59 UTC
Copy an existing folder to a new location
I need my installer to move an existing folder on the target system to a new location on the same system. All contents including subfolders must be moved.
I believe I could do:
ExecWait '"XCOPY" "Source-Folder" "Dest-Folder" /e /i /y'
But is there an built in command I can put in my installer to do the same thing?
hypheni9
9th September 2011 06:25 UTC
Simple think would be CopyFile.
CopyFiles /SILENT "SourceDir\*.*" "DestDir\"
RMDir /r "SourceDir"
Ron.Stordahl
10th September 2011 15:46 UTC
Thank you...it is exactly what I needed. Here is a snippet of code that I am using:
ClearErrors
>${If} ${FileExists} "$0\*.*" ;Folder $0 exists
CreateDirectory $INSTDIR
CopyFiles/SILENT "$0\*.*" "$INSTDIR"
RMDir /r $0
>${Else} ;Folder $0 does not exist
;-----
${Endif}
Afrow UK
10th September 2011 16:26 UTC
If you are going to delete the original folder, why not use Rename? Rename can move folders.
Stu