#define NI_FLAGS_RM_ORIGIN_AFTER_NI 0x0800
#define NI_FLAGS_SET_PRIORITY 0x1000
#define NI_FLAGS_PARALLELISM 0x2000
+#define NI_FLAGS_RPK 0x4000
typedef std::function<void (std::string)> afterCreate;
std::vector<std::string> mibcPath;
int priority;
std::string threadNum;
- bool isRPK = false;
} NIOption;
/**
}
for (auto& dll : dllList) {
- rename(dll.c_str(), changeExtension(dll, ".dll", ".dll.backup").c_str());
+ if (rename(dll.c_str(), changeExtension(dll, ".dll", ".dll.backup").c_str())) {
+ _SERR("Failed to rename from %s to backup file", dll.c_str());
+ }
}
for (auto& ni : niList) {
std::string dll = changeExtension(ni, ".ni.dll", ".dll");
renameAppNITmpPath(opt);
}
- if (opt->isRPK) {
+ if (opt->flags & NI_FLAGS_RPK) {
swapExtensionRpkFiles(paths, opt);
}
_SERR("Failed to get root path from [%s]", pkgId.c_str());
return NI_ERROR_INVALID_PACKAGE;
}
- opt->isRPK = isRPK(pkgId);
return createNIUnderPkgRootWithPath(rootPath, opt);
}
splitPath(extraDllPaths, opt->extraRefPath);
}
+ std::string pkgId = getPkgId(rootPath);
+ if (!pkgId.empty()) {
+ if (isRPK(pkgId)) {
+ opt->flags |= NI_FLAGS_RPK;
+ }
+ }
+
std::string targetDirs;
- if (opt->isRPK) {
+ if (opt->flags & NI_FLAGS_RPK) {
opt->flags &= ~NI_FLAGS_APPNI; // added to exclude logic of APP_NI
opt->flags |= NI_FLAGS_NO_PIPELINE; // added the flag to set the output path