Browse Source

Add automatic unzipping when updating on Mac.

tags/v1.1.5
Andrew Belt 5 years ago
parent
commit
7f6f933420
2 changed files with 11 additions and 3 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +10
    -3
      src/updater.cpp

+ 1
- 0
CHANGELOG.md View File

@@ -5,6 +5,7 @@ In this document, Mod is Ctrl on Windows/Linux and Cmd on Mac.
### 1.1.5 (in development)
- Swap order of tags and brands in Module Browser.
- Disable smoothing for MIDI CC buttons in MIDI-Map.
- Automatically unzip update on Mac.
- API
- Add libsamplerate library.



+ 10
- 3
src/updater.cpp View File

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

#if defined ARCH_WIN
// Download and launch the installer on Windows
#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());
network::requestDownload(downloadUrl, path, &progress);
#endif

#if defined ARCH_WIN
// Launch the installer
INFO("Launching update %s", path.c_str());
system::runProcessDetached(path);
#elif defined ARCH_MAC
// Unzip app using Apple's unzipper, since Rack's unzipper doesn't handle the metadata stuff correctly.
std::string cmd = "open \"" + path + "\"";
std::system(cmd.c_str());
#else
// Open the browser on Mac and Linux. The user will know what to do.
system::openBrowser(downloadUrl);
#endif



Loading…
Cancel
Save