- for (auto& symlinkAssembly : bf::recursive_directory_iterator(tacDir)) {
- std::string symPath = symlinkAssembly.path().string();
- std::string fileName = symlinkAssembly.path().filename().string();
- if (bf::is_symlink(symPath)) {
- std::string originPath = bf::read_symlink(symPath).string();
- if (!isNativeImage(symPath)) {
- if (!copyFile(originPath, concatPath(binDir, fileName))) {
- fprintf(stderr, "Failed to copy of %s\n", concatPath(binDir, fileName).c_str());
- return TAC_ERROR_UNKNOWN;
- }
- updateAssemblyInfo(binDir.c_str(), concatPath(binDir, fileName).c_str());
- } else {
- if (!copyFile(originPath, concatPath(binNIDir, fileName))) {
- fprintf(stderr, "Failed to copy of %s\n", concatPath(binNIDir, fileName).c_str());
- return TAC_ERROR_UNKNOWN;
+ try {
+ for (auto& symlinkAssembly : bf::recursive_directory_iterator(tacDir)) {
+ std::string symPath = symlinkAssembly.path().string();
+ std::string fileName = symlinkAssembly.path().filename().string();
+ if (bf::is_symlink(symPath)) {
+ std::string originPath = bf::read_symlink(symPath).string();
+ if (!isNativeImage(symPath)) {
+ std::string dllPath = concatPath(binDir, fileName);
+ if (!copyFile(originPath, dllPath)) {
+ fprintf(stderr, "Failed to copy of %s\n", dllPath.c_str());
+ return TAC_ERROR_UNKNOWN;
+ }
+ updateAssemblyInfo(binDir.c_str(), concatPath(binDir, fileName).c_str());
+ } else {
+ std::string niPath = concatPath(binNIDir, fileName);
+ if (!copyFile(originPath, niPath)) {
+ fprintf(stderr, "Failed to copy of %s\n", niPath.c_str());
+ return TAC_ERROR_UNKNOWN;
+ }
+ updateAssemblyInfo(binDir.c_str(), niPath.c_str());