This commit is contained in:
Nikhil Narayana 2022-05-30 14:04:51 -07:00
commit 14c0f9cf4d
2 changed files with 9 additions and 25 deletions

View file

@ -178,43 +178,27 @@ void SlippiUser::OpenLogInPage()
RunSystemCommand(command); RunSystemCommand(command);
} }
void SlippiUser::UpdateApp() bool SlippiUser::UpdateApp()
{ {
#ifdef _WIN32 #ifdef defined(__APPLE__) || defined(_WIN32)
auto isoPath = SConfig::GetInstance().m_strIsoPath; CriticalAlertT("Dolphin auto updates are not available on standalone builds. Migrate to "
"the Slippi Launcher at your earliest convenience");
std::string path = File::GetExeDirectory() + "/dolphin-slippi-tools.exe"; return false;
std::string echo_msg =
"echo Starting update process. If nothing happen after a few "
"minutes, you may need to update manually from https://slippi.gg/netplay ...";
// std::string command =
// "start /b cmd /c " + echo_msg + " && \"" + path + "\" app-update -launch -iso \"" + isoPath
// +
// "\"";
std::string command = "start /b cmd /c " + echo_msg + " && \"" + path +
"\" app-update -launch -iso \"" + isoPath + "\" -version \"" +
Common::scm_slippi_semver_str + "\"";
WARN_LOG(SLIPPI, "Executing app update command: %s", command.c_str());
RunSystemCommand(command);
#elif defined(__APPLE__)
CriticalAlertT("Automatic updates are not available for macOS; please get the latest update from "
"slippi.gg/netplay.");
#else #else
const char* appimage_path = getenv("APPIMAGE"); const char* appimage_path = getenv("APPIMAGE");
const char* appmount_path = getenv("APPDIR"); const char* appmount_path = getenv("APPDIR");
if (!appimage_path) if (!appimage_path)
{ {
CriticalAlertT("Automatic updates are not available for non-AppImage Linux builds."); CriticalAlertT("Automatic updates are not available for non-AppImage Linux builds.");
return; return false;
} }
std::string path(appimage_path); std::string path(appimage_path);
std::string mount_path(appmount_path); std::string mount_path(appmount_path);
std::string command = mount_path + "/usr/bin/appimageupdatetool " + path; std::string command = mount_path + "/usr/bin/appimageupdatetool " + path;
WARN_LOG(SLIPPI, "Executing app update command: %s", command.c_str()); WARN_LOG(SLIPPI, "Executing app update command: %s", command.c_str());
RunSystemCommand(command); RunSystemCommand(command);
CriticalAlertT( CriticalAlertT("Dolphin failed to update, please head over to the Slippi Discord for support.");
"Restart Dolphin to finish the update. If there was an issue, please head over to the Slippi " return true;
"Discord for support.");
#endif #endif
} }

View file

@ -28,7 +28,7 @@ public:
bool AttemptLogin(); bool AttemptLogin();
void OpenLogInPage(); void OpenLogInPage();
void UpdateApp(); bool UpdateApp();
void ListenForLogIn(); void ListenForLogIn();
void LogOut(); void LogOut();
void OverwriteLatestVersion(std::string version); void OverwriteLatestVersion(std::string version);