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); 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(); file_path = App::GetExePath();
} }
@@ -279,11 +279,8 @@ MainMenu::MainMenu() {
m_update_state = UpdateState::None; m_update_state = UpdateState::None;
App::Notify("Updated to "_i18n + m_update_version); App::Notify("Updated to "_i18n + m_update_version);
App::Push(std::make_shared<OptionBox>( App::Push(std::make_shared<OptionBox>(
"Restart Sphaira?"_i18n, "Press OK to restart Sphaira"_i18n, "OK"_i18n, [](auto){
"Back"_i18n, "Restart"_i18n, 1, [this](auto op_index){ App::ExitRestart();
if (op_index && *op_index) {
App::ExitRestart();
}
} }
)); ));
} else { } else {