Install CIA files. */
| 247 | |
| 248 | /* Install CIA files. */ |
| 249 | void ScriptUtils::installFile(const std::string &file, bool updatingSelf, const std::string &message, bool isARG) { |
| 250 | std::string in; |
| 251 | in = std::regex_replace(file, std::regex("%ARCHIVE_DEFAULT%"), config->archPath()); |
| 252 | in = std::regex_replace(in, std::regex("%3DSX%/(.*)\\.(.*)"), config->_3dsxPath() + (config->_3dsxInFolder() ? "/$1/$1.$2" : "/$1.$2")); |
| 253 | in = std::regex_replace(in, std::regex("%3DSX%"), config->_3dsxPath()); |
| 254 | in = std::regex_replace(in, std::regex("%NDS%"), config->ndsPath()); |
| 255 | in = std::regex_replace(in, std::regex("%FIRM%"), config->firmPath()); |
| 256 | |
| 257 | if (isARG) { |
| 258 | snprintf(progressBarMsg, sizeof(progressBarMsg), message.c_str()); |
| 259 | showProgressBar = true; |
| 260 | progressbarType = ProgressBar::Installing; |
| 261 | |
| 262 | s32 prio = 0; |
| 263 | svcGetThreadPriority(&prio, CUR_THREAD_HANDLE); |
| 264 | thread = threadCreate((ThreadFunc)Animation::displayProgressBar, NULL, 64 * 1024, prio - 1, -2, false); |
| 265 | } |
| 266 | |
| 267 | Title::Install(in.c_str(), updatingSelf); |
| 268 | |
| 269 | if (isARG) { |
| 270 | showProgressBar = false; |
| 271 | threadJoin(thread, U64_MAX); |
| 272 | threadFree(thread); |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | /* Extract files. */ |
| 277 | Result ScriptUtils::extractFile(const std::string &file, const std::string &input, const std::string &output, const std::string &message, bool isARG) { |
nothing calls this directly
no test coverage detected