Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions framework/cmake/MuseSetupConfiguration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ if (NOT MUSE_MODULE_MULTIWINDOWS)
set(MUSE_MODULE_MULTIWINDOWS_QML OFF) # Stub does not have QML
endif()

if (NOT MUSE_MODULE_UPDATE)
set(MUSE_MODULE_UPDATE_QML OFF) # Stub does not have QML
endif()

if (NOT MUSE_MODULE_VST)
set(MUSE_MODULE_VST_QML OFF) # Stub does not have QML
endif()
Expand Down
2 changes: 1 addition & 1 deletion framework/diagnostics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ if (MUSE_MODULE_DIAGNOSTICS_CRASHPAD_CLIENT)
message(FATAL_ERROR "Crashpad handler not found: ${MUSE_MODULE_DIAGNOSTICS_CRASHPAD_HANDLER_PATH}")
endif()
if (OS_IS_LIN OR OS_IS_WIN OR OS_IS_MAC)
install(PROGRAMS ${MUSE_MODULE_DIAGNOSTICS_CRASHPAD_HANDLER_PATH} DESTINATION ${INSTALL_BIN_DIR})
install(PROGRAMS ${MUSE_MODULE_DIAGNOSTICS_CRASHPAD_HANDLER_PATH} DESTINATION ${INSTALL_SUBDIR})
endif()
endif() # MUSE_MODULE_DIAGNOSTICS_CRASHPAD_CLIENT
# ----------------
Expand Down
8 changes: 7 additions & 1 deletion framework/network/internal/networkmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

#include "networkerrors.h"

#include "log.h"

using namespace muse;
using namespace muse::network;
using namespace muse::async;
Expand Down Expand Up @@ -190,7 +192,11 @@ RetVal<Progress> NetworkManager::execRequest(RequestType requestType, const QUrl
return;
}

data.incomingData->write(data.reply->readAll());
const QByteArray chunk = data.reply->readAll();
if (data.incomingData->write(chunk) != chunk.size()) {
LOGE() << "failed to store incoming data: " << data.incomingData->errorString();
data.reply->abort();
}
});
}

Expand Down
6 changes: 5 additions & 1 deletion framework/stubs/update/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ target_sources(muse_update PRIVATE
appupdatescenariostub.h
appupdateservicestub.cpp
appupdateservicestub.h
)
)

if (MUSE_MODULE_UPDATE_QML)
add_subdirectory(qml/Muse/Update)
endif()
18 changes: 10 additions & 8 deletions framework/stubs/update/appupdatescenariostub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,26 @@ void AppUpdateScenarioStub::checkForUpdate(bool)
{
}

bool AppUpdateScenarioStub::checkInProgress() const
bool AppUpdateScenarioStub::hasUpdate() const
{
return false;
}

bool AppUpdateScenarioStub::hasReadyUpdate() const
{
return false;
}

muse::async::Notification AppUpdateScenarioStub::checkInProgressChanged() const
muse::async::Notification AppUpdateScenarioStub::hasReadyUpdateChanged() const
{
return {};
}

bool AppUpdateScenarioStub::hasUpdate() const
std::string AppUpdateScenarioStub::readyUpdateVersion() const
{
return false;
return {};
}

muse::async::Promise<muse::Ret> AppUpdateScenarioStub::showUpdate()
void AppUpdateScenarioStub::installReadyUpdate()
{
return muse::async::Promise<muse::Ret>([](auto /*resolve*/, auto reject) {
return reject(int(muse::Ret::Code::UnknownError), "stub");
});
}
10 changes: 6 additions & 4 deletions framework/stubs/update/appupdatescenariostub.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ class AppUpdateScenarioStub : public IAppUpdateScenario
bool needCheckForUpdate() const override;
void checkForUpdate(bool manual) override;

bool checkInProgress() const override;
async::Notification checkInProgressChanged() const override;

bool hasUpdate() const override;
muse::async::Promise<Ret> showUpdate() override;

bool hasReadyUpdate() const override;
async::Notification hasReadyUpdateChanged() const override;
std::string readyUpdateVersion() const override;

void installReadyUpdate() override;
};
}
25 changes: 25 additions & 0 deletions framework/stubs/update/appupdateservicestub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,28 @@ RetVal<Progress> AppUpdateServiceStub::downloadRelease()
{
return RetVal<Progress>::make_ret(Ret::Code::NotSupported);
}

bool AppUpdateServiceStub::canAutoInstall() const
{
return false;
}

RetVal<muse::io::path_t> AppUpdateServiceStub::prepareUpdate(const muse::io::path_t&)
{
return RetVal<muse::io::path_t>(make_ret(Ret::Code::NotSupported));
}

Ret AppUpdateServiceStub::finalizeUpdate(const muse::io::path_t&)
{
return make_ret(Ret::Code::NotSupported);
}

bool AppUpdateServiceStub::isReleaseDownloaded() const
{
return false;
}

muse::io::path_t AppUpdateServiceStub::downloadedReleasePath() const
{
return {};
}
7 changes: 7 additions & 0 deletions framework/stubs/update/appupdateservicestub.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,12 @@ class AppUpdateServiceStub : public IAppUpdateService
async::Promise<muse::RetVal<ReleaseInfo> > checkForUpdate() override;
const RetVal<ReleaseInfo>& lastCheckResult() const override;
RetVal<Progress> downloadRelease() override;

bool canAutoInstall() const override;
RetVal<muse::io::path_t> prepareUpdate(const muse::io::path_t& packagePath) override;
Ret finalizeUpdate(const muse::io::path_t& preparedPath) override;

bool isReleaseDownloaded() const override;
muse::io::path_t downloadedReleasePath() const override;
};
}
30 changes: 30 additions & 0 deletions framework/stubs/update/qml/Muse/Update/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-License-Identifier: GPL-3.0-only
# MuseScore-Studio-CLA-applies
#
# MuseScore Studio
# Music Composition & Notation
#
# Copyright (C) 2026 MuseScore Limited and others
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

muse_create_qml_module(muse_update_qml ALIAS muse::update_qml FOR muse_update STUB)

qt_add_qml_module(muse_update_qml
URI Muse.Update
VERSION 1.0
QML_FILES
UpdateBanner.qml
)

fixup_qml_module_dependencies(muse_update_qml)
29 changes: 29 additions & 0 deletions framework/stubs/update/qml/Muse/Update/UpdateBanner.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* SPDX-License-Identifier: GPL-3.0-only
* MuseScore-CLA-applies
*
* MuseScore Studio
* Music Composition & Notation
*
* Copyright (C) 2026 MuseScore Limited and others
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick

Item {
readonly property bool hasReadyUpdate: false
readonly property string updateVersion: ""

visible: false
}
23 changes: 23 additions & 0 deletions framework/stubs/update/updateconfigurationstub.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,29 @@ muse::async::Notification UpdateConfigurationStub::needCheckForUpdateChanged() c
return n;
}

bool UpdateConfigurationStub::autoInstallEnabled() const
{
return false;
}

void UpdateConfigurationStub::setAutoInstallEnabled(bool)
{
}

std::string UpdateConfigurationStub::skippedReleaseVersion() const
{
return "";
}

muse::io::path_t UpdateConfigurationStub::lastDownloadedPackagePath() const
{
return "";
}

void UpdateConfigurationStub::setLastDownloadedPackagePath(const io::path_t&)
{
}

void UpdateConfigurationStub::setSkippedReleaseVersion(const std::string&)
{
}
Expand Down Expand Up @@ -91,6 +109,11 @@ std::string UpdateConfigurationStub::privacyPolicyUrl() const
return "";
}

muse::io::path_t UpdateConfigurationStub::downloadsPath() const
{
return "";
}

muse::io::path_t UpdateConfigurationStub::updateDataPath() const
{
return "";
Expand Down
7 changes: 7 additions & 0 deletions framework/stubs/update/updateconfigurationstub.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ class UpdateConfigurationStub : public IUpdateConfiguration
void setNeedCheckForUpdate(bool needCheck) override;
muse::async::Notification needCheckForUpdateChanged() const override;

bool autoInstallEnabled() const override;
void setAutoInstallEnabled(bool enabled) override;

std::string skippedReleaseVersion() const override;
void setSkippedReleaseVersion(const std::string& version) override;

io::path_t lastDownloadedPackagePath() const override;
void setLastDownloadedPackagePath(const io::path_t& path) override;

bool checkForUpdateTestMode() const override;

std::string checkForAppUpdateUrl() const override;
Expand All @@ -51,6 +57,7 @@ class UpdateConfigurationStub : public IUpdateConfiguration
std::string privacyPolicyUrl() const override;

io::path_t updateDataPath() const override;
io::path_t downloadsPath() const override;
io::path_t updateRequestHistoryJsonPath() const override;
};
}
Expand Down
32 changes: 32 additions & 0 deletions framework/update/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ target_sources(muse_update PRIVATE
iupdaterequestparamsprovider.h
iappupdatescenario.h
iappupdateservice.h
iupdateinstaller.h
updatecommands.h

internal/updateconfiguration.cpp
Expand All @@ -45,12 +46,43 @@ target_sources(muse_update PRIVATE
internal/appupdatescenario.h
internal/appupdateservice.cpp
internal/appupdateservice.h
internal/downloadfiledevice.cpp
internal/downloadfiledevice.h
)

if (OS_IS_MAC)
target_sources(muse_update PRIVATE
internal/platform/mac/macupdateinstaller.cpp
internal/platform/mac/macupdateinstaller.h
)
elseif (OS_IS_WIN)
target_sources(muse_update PRIVATE
internal/platform/win/winupdateinstaller.cpp
internal/platform/win/winupdateinstaller.h
internal/platform/win/winupdateshared.h
)

target_link_libraries(muse_update PRIVATE taskschd ole32 oleaut32)
elseif (OS_IS_LIN)
target_sources(muse_update PRIVATE
internal/platform/linux/linuxupdateinstaller.cpp
internal/platform/linux/linuxupdateinstaller.h
)
else()
target_sources(muse_update PRIVATE
internal/platform/stub/updateinstallerstub.cpp
internal/platform/stub/updateinstallerstub.h
)
endif()

if (MUSE_QT_SUPPORT)
target_link_libraries(muse_update PRIVATE Qt::Concurrent)
endif()

if (NOT CC_IS_EMCC)
add_subdirectory(helper)
endif()

if (MUSE_MODULE_UPDATE_TESTS)
add_subdirectory(tests)
endif()
Expand Down
Loading