use strstr to find sphaira within update zip, force restart upon update success.

This commit is contained in:
ITotalJustice
2025-01-12 23:22:20 +00:00
parent c762dafc67
commit 01e06a79a5

View File

@@ -89,7 +89,7 @@ auto InstallUpdate(ProgressBox* pbox, const std::string url, const std::string v
file_path = fs::AppendPath("/", file_path);
}
if (!strcasecmp(strrchr(file_path.s, '/'), "/sphaira.nro")) {
if (std::strstr(file_path, "sphaira.nro")) {
file_path = App::GetExePath();
}
@@ -279,12 +279,9 @@ MainMenu::MainMenu() {
m_update_state = UpdateState::None;
App::Notify("Updated to "_i18n + m_update_version);
App::Push(std::make_shared<OptionBox>(
"Restart Sphaira?"_i18n,
"Back"_i18n, "Restart"_i18n, 1, [this](auto op_index){
if (op_index && *op_index) {
"Press OK to restart Sphaira"_i18n, "OK"_i18n, [](auto){
App::ExitRestart();
}
}
));
} else {
App::Push(std::make_shared<ui::ErrorBox>(MAKERESULT(351, 1), "Failed to download update"_i18n));