The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. #pragma once
  14. #include "../Utility/Helpers/jucer_VersionInfo.h"
  15. class DownloadAndInstallThread;
  16. class LatestVersionCheckerAndUpdater : public DeletedAtShutdown,
  17. private Thread
  18. {
  19. public:
  20. LatestVersionCheckerAndUpdater();
  21. ~LatestVersionCheckerAndUpdater() override;
  22. void checkForNewVersion (bool showAlerts);
  23. //==============================================================================
  24. JUCE_DECLARE_SINGLETON_SINGLETHREADED_MINIMAL (LatestVersionCheckerAndUpdater)
  25. private:
  26. //==============================================================================
  27. void run() override;
  28. void askUserAboutNewVersion (const String&, const String&, const VersionInfo::Asset&);
  29. void askUserForLocationToDownload (const VersionInfo::Asset&);
  30. void downloadAndInstall (const VersionInfo::Asset&, const File&);
  31. //==============================================================================
  32. bool showAlertWindows = false;
  33. std::unique_ptr<DownloadAndInstallThread> installer;
  34. std::unique_ptr<Component> dialogWindow;
  35. };