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.

47 lines
1.3KB

  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. //==============================================================================
  15. class DownloadCompileEngineThread : public ThreadWithProgressWindow
  16. {
  17. public:
  18. static bool downloadAndInstall();
  19. protected:
  20. void run() override;
  21. void threadComplete (bool userPressedCancel) override;
  22. private:
  23. DownloadCompileEngineThread();
  24. Result download (MemoryBlock& dest);
  25. Result install (const MemoryBlock& data, File& targetFolder);
  26. static URL getDownloadUrl();
  27. static File getInstallFolder();
  28. static bool withError(const String& msg);
  29. Result result;
  30. bool cancelledByUser;
  31. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DownloadCompileEngineThread)
  32. };