Browse Source

Add sort-of-automatic updater on Linux.

tags/v1.1.5
Andrew Belt 5 years ago
parent
commit
e59e8aca40
1 changed files with 3 additions and 5 deletions
  1. +3
    -5
      src/updater.cpp

+ 3
- 5
src/updater.cpp View File

@@ -61,13 +61,11 @@ void update() {
if (downloadUrl == "")
return;

#if defined ARCH_WIN || defined ARCH_MAC
// Download update
std::string filename = string::filename(network::urlPath(downloadUrl));
std::string path = asset::user(filename);
INFO("Download update %s to %s", downloadUrl.c_str(), path.c_str());
INFO("Downloading update %s to %s", downloadUrl.c_str(), path.c_str());
network::requestDownload(downloadUrl, path, &progress);
#endif

#if defined ARCH_WIN
// Launch the installer
@@ -88,8 +86,8 @@ void update() {
// Open Archive Utility
cmd = "open '" + path + "'";
std::system(cmd.c_str());
#else
system::openBrowser(downloadUrl);
#elif defined ARCH_LIN
system::openFolder(asset::user(""));
#endif

APP->window->close();


Loading…
Cancel
Save