其实用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;