Copy files if newer
Hi
I have to copy files if they are newer.
Some ideas, how to do that? Need help.
Thanks
Archive: Copy files if newer
Copy files if newer
Hi
I have to copy files if they are newer.
Some ideas, how to do that? Need help.
Thanks
Well as I don't know how to read these addtional file informations.. maybe write the last_modified date into the registry and read it out?
This might work if it's for an updater where you can be sure to set this entry at first.
You need to provide more information. Are you talking about extracting files from the installer (File)? Or are you talking about CopyFiles?
Stu
I'm talking about CopyFiles, but CopyFiles won't work, because there is no option like /ifnewer or something like that.
You'll need to do the checks yourself. You can recurse through files and folders using Locate (see docs). Use GetFileTime to compare files.
Stu
Hmm...
I think it's not the smartest way to do, but I'll use the windows-tool robocopy instead of check all files by myself.
The basic code is available:
http://nsis.sourceforge.net/MoveFileFolder
If you want to copy instead of move a file, just change the 'rename' calls to 'CopyFiles' and remove the 'delete "${sourceFile}"' calls.