Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

XCopyFile vs. CopyFile


2 replies to this topic

JoeThompson

JoeThompson
  • Members
  • 80 posts

Posted 03 January 2002 - 01:23

During uninstallation I ask the user if they want to save the files in a certain directory (that is being uninstalled) to somewhere and give them the choice of where.  I was trying
nResult = XCopyFile(strSrcDir ^ "*.*", strDestDir ^ "*.*", COMP_NORMAL) but nResult was always -2147024773.  Finally, out of frustration I changed it to
nResult = CopyFile(strSrcDir ^ "*.*", strDestDir ^ "*.*") and it worked...

What am I doing wrong with XCopyFile.  I may still need it because there might be subdirectories in the future that need to be copied.  There is nothing special about the files (read-only, locked, etc.)

Thank you,
Joe


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 03 January 2002 - 19:28

The second parameter in XCopyFile should only be a directory, not a file name (not even *.*).
XCopyFile(strSrcDir ^ "*.*", strDestDir, COMP_NORMAL)
should have worked.
CopyFile allows a file name in the second parameter because it is able to rename files during the copy process.

JoeThompson

JoeThompson
  • Members
  • 80 posts

Posted 03 January 2002 - 19:33

Thanks for the reply..  I just double checked the Example Script from the help file and they had the second parameter with the *.* appended.  I don't know if this has since been fixed or not - I am still using v2.01.

Thanks again,
Joe