use strstr to find sphaira within update zip, force restart upon update success.
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user