FileCopy: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(SF: Cleaned page.)
(split infinitive)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{PageAuthor|Joel}}
== Description ==
== Description ==
This macro makes "CopyFiles" to don't set the error flag when copying files to an inexistant folder.
This macro causes "CopyFiles" not to set the error flag when copying files to an non-existant folder by first attempting to create the destination folder.


== How To Use ==
== How To Use ==
<highlight-nsis>
<highlight-nsis>
${FileCopy} "filespec_on_destsys" "destination_path"
${FileCopy} `filespec_on_destsys` `destination_path`
</highlight-nsis>
</highlight-nsis>


== The Script ==
== The Script ==
<highlight-nsis>
<highlight-nsis>
!define FileCopy `!insertmacro FileCopy`
!macro FileCopy FilePath TargetDir
!macro FileCopy FilePath TargetDir
   CreateDirectory ${TargetDir}
   CreateDirectory `${TargetDir}`
   CopyFiles ${FilePath} ${TargetDir}
   CopyFiles `${FilePath}` `${TargetDir}`
!macroend
!macroend
</highlight-nsis>
</highlight-nsis>


Page author: Joelito
[[Category:Disk, Path & File Functions]]

Latest revision as of 17:25, 29 March 2010

Author: Joel (talk, contrib)


Description

This macro causes "CopyFiles" not to set the error flag when copying files to an non-existant folder by first attempting to create the destination folder.

How To Use

${FileCopy} `filespec_on_destsys` `destination_path`

The Script

!define FileCopy `!insertmacro FileCopy`
!macro FileCopy FilePath TargetDir
  CreateDirectory `${TargetDir}`
  CopyFiles `${FilePath}` `${TargetDir}`
!macroend