Merge pull request #2588 from Ryex/fix/updater-support-linux-nonportable
Fix linux non portable update
This commit is contained in:
commit
80243ab554
@ -244,8 +244,9 @@ PrismUpdaterApp::PrismUpdaterApp(int& argc, char** argv) : QApplication(argc, ar
|
|||||||
|
|
||||||
auto updater_executable = QCoreApplication::applicationFilePath();
|
auto updater_executable = QCoreApplication::applicationFilePath();
|
||||||
|
|
||||||
if (BuildConfig.BUILD_ARTIFACT.toLower() == "macos")
|
#ifdef Q_OS_MACOS
|
||||||
showFatalErrorMessage(tr("MacOS Not Supported"), tr("The updater does not support installations on MacOS"));
|
showFatalErrorMessage(tr("MacOS Not Supported"), tr("The updater does not support installations on MacOS"));
|
||||||
|
#endif
|
||||||
|
|
||||||
if (updater_executable.startsWith("/tmp/.mount_")) {
|
if (updater_executable.startsWith("/tmp/.mount_")) {
|
||||||
m_isAppimage = true;
|
m_isAppimage = true;
|
||||||
@ -587,12 +588,6 @@ void PrismUpdaterApp::run()
|
|||||||
return exit(result ? 0 : 1);
|
return exit(result ? 0 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (BuildConfig.BUILD_ARTIFACT.toLower() == "linux" && !m_isPortable) {
|
|
||||||
showFatalErrorMessage(tr("Updating Not Supported"),
|
|
||||||
tr("Updating non-portable linux installations is not supported. Please use your system package manager"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (need_update || m_forceUpdate || !m_userSelectedVersion.isEmpty()) {
|
if (need_update || m_forceUpdate || !m_userSelectedVersion.isEmpty()) {
|
||||||
GitHubRelease update_release = latest;
|
GitHubRelease update_release = latest;
|
||||||
if (!m_userSelectedVersion.isEmpty()) {
|
if (!m_userSelectedVersion.isEmpty()) {
|
||||||
@ -794,6 +789,10 @@ QList<GitHubReleaseAsset> PrismUpdaterApp::validReleaseArtifacts(const GitHubRel
|
|||||||
if (BuildConfig.BUILD_ARTIFACT.isEmpty())
|
if (BuildConfig.BUILD_ARTIFACT.isEmpty())
|
||||||
qWarning() << "Build platform is not set!";
|
qWarning() << "Build platform is not set!";
|
||||||
for (auto asset : release.assets) {
|
for (auto asset : release.assets) {
|
||||||
|
if (asset.name.endsWith(".zsync")) {
|
||||||
|
qDebug() << "Rejecting zsync file" << asset.name;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!m_isAppimage && asset.name.toLower().endsWith("appimage")) {
|
if (!m_isAppimage && asset.name.toLower().endsWith("appimage")) {
|
||||||
qDebug() << "Rejecting" << asset.name << "because it is an AppImage";
|
qDebug() << "Rejecting" << asset.name << "because it is an AppImage";
|
||||||
continue;
|
continue;
|
||||||
@ -1027,7 +1026,7 @@ void PrismUpdaterApp::performInstall(QFileInfo file)
|
|||||||
FS::write(changelog_path, m_install_release.body.toUtf8());
|
FS::write(changelog_path, m_install_release.body.toUtf8());
|
||||||
|
|
||||||
logUpdate(tr("Updating from %1 to %2").arg(m_prismVersion).arg(m_install_release.tag_name));
|
logUpdate(tr("Updating from %1 to %2").arg(m_prismVersion).arg(m_install_release.tag_name));
|
||||||
if (m_isPortable || file.suffix().toLower() == "zip") {
|
if (m_isPortable || file.fileName().endsWith(".zip") || file.fileName().endsWith(".tar.gz")) {
|
||||||
write_lock_file(update_lock_path, QDateTime::currentDateTime(), m_prismVersion, m_install_release.tag_name, m_rootPath, m_dataPath);
|
write_lock_file(update_lock_path, QDateTime::currentDateTime(), m_prismVersion, m_install_release.tag_name, m_rootPath, m_dataPath);
|
||||||
logUpdate(tr("Updating portable install at %1").arg(m_rootPath));
|
logUpdate(tr("Updating portable install at %1").arg(m_rootPath));
|
||||||
unpackAndInstall(file);
|
unpackAndInstall(file);
|
||||||
@ -1101,7 +1100,7 @@ void PrismUpdaterApp::backupAppDir()
|
|||||||
|
|
||||||
if (file_list.isEmpty()) {
|
if (file_list.isEmpty()) {
|
||||||
// best guess
|
// best guess
|
||||||
if (BuildConfig.BUILD_ARTIFACT.toLower() == "linux") {
|
if (BuildConfig.BUILD_ARTIFACT.toLower().contains("linux")) {
|
||||||
file_list.append({ "PrismLauncher", "bin", "share", "lib" });
|
file_list.append({ "PrismLauncher", "bin", "share", "lib" });
|
||||||
} else { // windows by process of elimination
|
} else { // windows by process of elimination
|
||||||
file_list.append({
|
file_list.append({
|
||||||
|
Loading…
Reference in New Issue
Block a user