Skip to content

Commit

Permalink
[PR] Remove updater (#363)
Browse files Browse the repository at this point in the history
* feat: launch slippi.gg/downloads on update

* fix: use open command on mac
  • Loading branch information
JLaferri authored Sep 1, 2022
1 parent fe2b9d1 commit baca98a
Showing 1 changed file with 8 additions and 38 deletions.
46 changes: 8 additions & 38 deletions Source/Core/Core/Slippi/SlippiUser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,48 +181,18 @@ void SlippiUser::OpenLogInPage()

bool SlippiUser::UpdateApp()
{
#ifdef _WIN32
auto isoPath = SConfig::GetInstance().m_strFilename;

std::string path = File::GetExeDirectory() + "/dolphin-slippi-tools.exe";
std::string echoMsg = "echo Starting update process. If nothing happens after a few "
"minutes, you may need to update manually from https://slippi.gg/netplay ...";
std::string url = "https://slippi.gg/downloads?update=true";

// Check if updater exists, anti-virus sometimes deletes it
if (!File::Exists(path))
{
ERROR_LOG(SLIPPI_ONLINE, "Update requested but updater does not exist.");
OSD::AddMessage("Updater cannot be found. Please download the latest Slippi version from slippi.gg.", 30000,
0xFFFF0000);
return false;
}

std::string command = "start /b cmd /c " + echoMsg + " && \"" + path + "\" app-update -launch -iso \"" + isoPath +
"\" -version \"" + scm_slippi_semver_str + "\"";
WARN_LOG(SLIPPI, "Executing app update command: %s", command);
RunSystemCommand(command);
return true;
#ifdef _WIN32
std::string command = "explorer \"" + url + "\"";
#elif defined(__APPLE__)
CriticalAlertT("Automatic updates are not available for standalone Netplay builds on macOS. Please get the latest "
"update from slippi.gg/netplay. "
"(The Slippi Launcher has automatic updates on macOS, and you should consider switching to that)");
return false;
std::string command = "open \"" + url + "\"";
#else
const char *appimage_path = getenv("APPIMAGE");
const char *appmount_path = getenv("APPDIR");
if (!appimage_path)
{
CriticalAlertT("Automatic updates are not available for non-AppImage Linux builds.");
return false;
}
std::string path(appimage_path);
std::string mount_path(appmount_path);
std::string command = mount_path + "/usr/bin/appimageupdatetool " + path;
WARN_LOG(SLIPPI, "Executing app update command: %s", command.c_str());
RunSystemCommand(command);
CriticalAlertT("Dolphin failed to update, please head over to the Slippi Discord for support.");
return false;
std::string command = "xdg-open \"" + url + "\""; // Linux
#endif

RunSystemCommand(command);
return true;
}

void SlippiUser::ListenForLogIn()
Expand Down

0 comments on commit baca98a

Please sign in to comment.