TesterX
1st March 2005 13:03 UTC
How to overwrite multiple file?
I need to copy many files into installation directory. I use following code to do that:
SetOverwrite on
SetOurDir $INSTDIR
File /r "MyDirTemp"
Rename /REBOOTOK "${INSTDIR}\MyDirTemp\*.*" "${INSTDIR}\MyDir\*.*"
The problem is that open or existing files are not overwritten on system reboot when i use wildcards (*.*)in Rename. If don't use wildcards, then Rename works fine, but have to copy about 1,000 files so it is impossible to use direct filenames.
My question is: How to copy huge amount of files, if any files on target system could exist or be open? How to overwrite these file on system reboot? Do i do anything wrong in my code example?
Thanks
Afrow UK
1st March 2005 13:48 UTC
The only thing I could think of is to clear the location first perhaps...
-Stu
TesterX
1st March 2005 14:19 UTC
I cannot clear the location, because any files could be open. Yes, i could remove old files, restart and install new files, but this is not what i want.
Afrow UK
1st March 2005 14:41 UTC
Well, since you're renaming your folder on reboot, you can RMDir /REBOOTOK on the folder first too?
-Stu
TesterX
1st March 2005 15:22 UTC
So if i would use following code:
;---------------
SetOverwrite on
SetOurDir $INSTDIR
File /r "MyDirTemp"
RMDir /REBOOTOK "MyDir"
Rename /REBOOTOK "${INSTDIR}\MyDirTemp\*.*" "${INSTDIR}\MyDir\*.*"
;----------------
Then on reboot will be "MyDir" removed first and then "MyDirTemp" renamed to "MyDir"?
Do these "onreboot" action work this way? Couldn't it happen that "MyDir" would be removed after it was renamed?
Thanks for help.
Afrow UK
1st March 2005 17:35 UTC
I'm sure the dev's would have thought of that, but you might want to check anyway (perhaps you could try an example script and see what happens).
-Stu
TesterX
2nd March 2005 12:59 UTC
It works! Thanks for your help.