Skip to content
⌘ NSIS Forum Archive

file copy failed

8 posts

qwertyandy#

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.
kichik#
How would you suggest to fix this? How can one search for an open window of the directory he deletes?
qwertyandy#
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
qwertyandy#
windows 2000 nsis 1.98. i have found that it acts differently depending on how fast the computer is.
kichik#
Must be some Micrsoft bug... How about just deleting the contents of the directory or not opening it in explorer at all?
qwertyandy#
i was opening the directory so that the user could verify the deletion of the directory. what i have seems to be working okay.