http://www.yesky.com/385/153885.shtml
其实用XCopyFile进行文件夹拷贝只需要一句话:
nResult = XCopyFile("C:...//SrcDir//*.*","C:...//TargetDir//*.*",COMP_NORMAL);
///////////////////////////////////////////////////////////////////////////////
// EVENT: Installed event is sent just after files for the component:
// PLC are transferred.
///////////////////////////////////////////////////////////////////////////////
export prototype PLC_Installed();
function PLC_Installed()
begin
// 注意必须在 PLC_Installed 而不是在 PLC_Installing ,因为此时 PLC 文件夹可能还没有建立
CreateDir (TARGETDIR^"PLC\\App_Data");
CreateDir (TARGETDIR^"PLC\\PLC_log");
CreateDir (TARGETDIR^"PLC\\PLC_resources");
XCopyFile ("F:\\LEADSHOW PACKAGE SRC FILE\\plc\\App_Data\\*.*", TARGETDIR^"PLC\\App_Data", INCLUDE_SUBDIR);
//XCopyFile ("F:\\LEADSHOW PACKAGE SRC FILE\\plc\\App_Data\\*.*", TARGETDIR^"PLC\\App_Data\\", INCLUDE_SUBDIR);
//XCopyFile (TARGETDIR^"PLC\\App_Data", "F:\\LEADSHOW PACKAGE SRC FILE\\plc\\App_Data\\*.*", INCLUDE_SUBDIR);
XCopyFile ("F:\\LEADSHOW PACKAGE SRC FILE\\plc\\PLC_resources\\*.*", TARGETDIR^"PLC\\PLC_resources", INCLUDE_SUBDIR);
end;
///////////////////////////////////////////////////////////////////////////////
// EVENT: Uninstalled event is sent just after files for the component:
// PLC are removed during uninstallation.
///////////////////////////////////////////////////////////////////////////////
export prototype PLC_UnInstalled();
function PLC_UnInstalled()
begin
DeleteDir(TARGETDIR^"PLC", ALLCONTENTS);
end;
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/carl2380/archive/2010/08/20/5826114.aspx