Archive: file copy failed


file copy failed
RMDir /r $INSTDIR
;Sleep 1000
CreateDirectory $INSTDIR
CopyFiles $5\*.* $INSTDIR

if there is an explorer window open for $INSTDIR, the file copy will fail without the pause, because the script continues, when windows is still closing out the window, and the directory creation, and file copy are not allowed.


How would you suggest to fix this? How can one search for an open window of the directory he deletes?


Does CopyFiles know that it failed?


it says that the file copy failed in the status part.
this change seems to fix it

FindWindow $4 "" $INSTDIR
SendMessage $4 ${WM_SYSCOMMAND} 0xF060 0

Sleep 5000

RMDir /r $INSTDIR

copyfiles:
CreateDirectory $INSTDIR

CopyFiles $5\*.* $INSTDIR


It works for me without any changes. What OS are you using? What version of NSIS?


windows 2000 nsis 1.98. i have found that it acts differently depending on how fast the computer is.


Must be some Micrsoft bug... How about just deleting the contents of the directory or not opening it in explorer at all?


i was opening the directory so that the user could verify the deletion of the directory. what i have seems to be working okay.