Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 20th July 2004, 16:42   #1
paul_fx
Junior Member
 
Join Date: Jul 2004
Location: Somewhere
Posts: 8
CopyFiles

Hi there,

can anyone help me with a tricky problem. I'm using CopyFiles to copy approx 4.2GB of data from a DVD. The actual process completes properly (I can check each file that has been copied and it is a perfect copy of the original DVd copy), but the error flag is always set (so im always notified of the error...

This is my code:

Section "CopyData1"
copy:
CreateDirectory "$INSTDIR\Data\VTL"
CopyFiles "$EXEDIR\VTL_DVD1\*.*" "$INSTDIR\Data\VTL"
IfErrors error doneIt

; Check if there has been an error - if yes prompt
error:
MessageBox MB_OK|MB_ICONSTOP "Error!"
MessageBox MB_YESNO|MB_ICONQUESTION "Do you wish to retry the transfer process?" IDYES copy
Abort

doneIt:

SectionEnd

Anyone got any ideas??
paul_fx is offline   Reply With Quote
Old 20th July 2004, 17:09   #2
zimsms
Senior Member
 
zimsms's Avatar
 
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
Here's a straw....Perhaps the directory already existed so the createdirectory functions error flag was set?
zimsms is offline   Reply With Quote
Old 20th July 2004, 17:50   #3
paul_fx
Junior Member
 
Join Date: Jul 2004
Location: Somewhere
Posts: 8
Quote:
Perhaps the directory already existed so the createdirectory functions error flag was set?
I tried removing the createdirectory function, plus ensured everything was clean and nothing pre existed. Still no joy... But heres the really odd thing. If i click yes in my onerror handler to redo the copy -> It works
paul_fx is offline   Reply With Quote
Old 20th July 2004, 17:57   #4
zimsms
Senior Member
 
zimsms's Avatar
 
Join Date: Jan 2004
Location: London, Ontario, Canada
Posts: 272
Hmm, perhaps the dialog that appears when you don't use /SILENT is causing the error flag to be set since you didn't supply the size in kb.


Try placing an iferror every other line, so we can determine where it is being set. (You'll need a custom error for each one)

P.S. don't forget to place one right after the section command, so we know a previous section or function didn't set it.
zimsms is offline   Reply With Quote
Old 20th July 2004, 18:40   #5
scully13
Senior Member
 
Join Date: Apr 2004
Posts: 130
The error may not be coming from your CopyFiles at all. I don't see it in your trimmed down script so you might try adding "ClearErrors" before your CopyFiles just to make sure the error flag wasn't set for something earlier.
scully13 is offline   Reply With Quote
Old 20th July 2004, 19:56   #6
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,185
Send a message via ICQ to Yathosho
apart from your problem:

as you said you're copying 4.2GB of files, you might wanna use a macro to copy the files, which checks if copying for each file was successful. otherwise if you have one mistake, you will have to copy the entire 4.2GB again.
Yathosho is offline   Reply With Quote
Old 21st July 2004, 09:20   #7
Takhir
Major Dude
 
Join Date: Feb 2004
Location: Moscow, Russia
Posts: 1,220
BTW how SHFileOperation handles "*.*" notation? Can it lost files without extensions ?
Takhir is offline   Reply With Quote
Old 21st July 2004, 10:15   #8
paul_fx
Junior Member
 
Join Date: Jul 2004
Location: Somewhere
Posts: 8
Hi guys,

thanks for all the help so far. ClearErrors seems to be doing the job
paul_fx is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump