MCPcopy Create free account
hub / github.com/Universal-Team/Universal-Updater / installFile

Method installFile

source/utils/scriptUtils.cpp:249–274  ·  view source on GitHub ↗

Install CIA files. */

Source from the content-addressed store, hash-verified

247
248/* Install CIA files. */
249void 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. */
277Result ScriptUtils::extractFile(const std::string &file, const std::string &input, const std::string &output, const std::string &message, bool isARG) {

Callers

nothing calls this directly

Calls 5

archPathMethod · 0.80
_3dsxPathMethod · 0.80
_3dsxInFolderMethod · 0.80
ndsPathMethod · 0.80
firmPathMethod · 0.80

Tested by

no test coverage detected