From fd519cbb3a3ff98555bed495829873df2f5906bf Mon Sep 17 00:00:00 2001
From: Alexis Lopez Zubieta <contact@azubieta.net>
Date: Tue, 10 Sep 2019 11:46:21 -0500
Subject: [PATCH 1/4] Trigger check updates from the wsServer

---
 app/src/handlers/updatehandler.cpp       |  31 ++++-
 app/src/handlers/updatehandler.h         |  13 +++
 app/src/main.cpp                         |  15 ++-
 app/src/updaters/appimageupdatedialog.ui |   2 +-
 app/src/updaters/appupdatedialog.cpp     |  11 ++
 app/src/updaters/appupdatedialog.h       |   2 +
 app/src/updaters/appupdater.cpp          |   7 +-
 app/src/updaters/appupdater.cpp.autosave | 143 -----------------------
 app/src/updaters/appupdater.h            |   2 +-
 app/src/websockets/websocketserver.cpp   |  21 ++--
 app/src/websockets/websocketserver.h     |   1 +
 11 files changed, 88 insertions(+), 160 deletions(-)
 delete mode 100644 app/src/updaters/appupdater.cpp.autosave

diff --git a/app/src/handlers/updatehandler.cpp b/app/src/handlers/updatehandler.cpp
index 9c81e79..5e943d0 100644
--- a/app/src/handlers/updatehandler.cpp
+++ b/app/src/handlers/updatehandler.cpp
@@ -13,10 +13,17 @@
 #include "updaters/appimageupdater.h"
 #endif
 
+#include "updaters/appupdater.h"
+
 UpdateHandler::UpdateHandler(ConfigHandler *configHandler, QObject *parent)
-    : QObject(parent), configHandler_(configHandler)
+    : QObject(parent), configHandler_(configHandler), appUpdater_(nullptr)
 {}
 
+void UpdateHandler::setAppFile(const QString &appFile)
+{
+    appFile_ = appFile;
+}
+
 void UpdateHandler::checkAll()
 {
     // Resets data
@@ -91,6 +98,28 @@ void UpdateHandler::update(const QString &itemKey)
 #endif
 }
 
+void UpdateHandler::checkAppUpdates()
+{
+    if (appUpdater_ == nullptr)
+        appUpdater_ = new AppUpdater(appFile_, this);
+
+    appUpdater_->setSilentLookup(false);
+
+    if (!appUpdater_->isRunning())
+        appUpdater_->doUpdateLookUp();
+}
+
+void UpdateHandler::silentCheckAppUpdates()
+{
+    if (appUpdater_ == nullptr)
+        appUpdater_ = new AppUpdater(appFile_, this);
+
+    appUpdater_->setSilentLookup(true);
+
+    if (!appUpdater_->isRunning())
+        appUpdater_->doUpdateLookUp();
+}
+
 #ifdef APP_DESKTOP
 void UpdateHandler::appImageUpdaterFinished(AppImageUpdater *updater)
 {
diff --git a/app/src/handlers/updatehandler.h b/app/src/handlers/updatehandler.h
index fa59680..7a4cb86 100644
--- a/app/src/handlers/updatehandler.h
+++ b/app/src/handlers/updatehandler.h
@@ -9,6 +9,8 @@ class ConfigHandler;
 class AppImageUpdater;
 #endif
 
+class AppUpdater;
+
 class UpdateHandler : public QObject
 {
     Q_OBJECT
@@ -16,6 +18,12 @@ class UpdateHandler : public QObject
 public:
     explicit UpdateHandler(ConfigHandler *configHandler, QObject *parent = nullptr);
 
+    /**
+     * @brief set application file to be used when performing self updates
+     * @param appFile
+     */
+    void setAppFile(const QString &appFile);
+
 signals:
     void checkAllStarted(bool status);
     void checkAllFinished(bool status);
@@ -27,6 +35,9 @@ public slots:
     void checkAll();
     void update(const QString &itemKey);
 
+    void checkAppUpdates();
+    void silentCheckAppUpdates();
+
 private slots:
 #ifdef APP_DESKTOP
     void appImageUpdaterFinished(AppImageUpdater *updater);
@@ -37,6 +48,8 @@ private:
     void updateAppImage(const QString &itemKey);
 #endif
 
+    QString appFile_;
     ConfigHandler *configHandler_;
     QJsonObject metadataSet_;
+    AppUpdater * appUpdater_;
 };
diff --git a/app/src/main.cpp b/app/src/main.cpp
index 34b5851..d196604 100644
--- a/app/src/main.cpp
+++ b/app/src/main.cpp
@@ -9,6 +9,7 @@
 #include <QDebug>
 
 #include "handlers/confighandler.h"
+#include "handlers/updatehandler.h"
 #include "websockets/websocketserver.h"
 #include "updaters/appupdater.h"
 
@@ -23,6 +24,8 @@ int main(int argc, char *argv[])
     auto *configHandler = new ConfigHandler(&app);
     auto appConfigApplication = configHandler->getAppConfigApplication();
 
+    auto updateHandler = new UpdateHandler(configHandler, &app);
+
     app.setApplicationName(appConfigApplication["name"].toString());
     app.setApplicationVersion(appConfigApplication["version"].toString());
     app.setOrganizationName(appConfigApplication["organization"].toString());
@@ -52,17 +55,14 @@ int main(int argc, char *argv[])
 
     clParser.process(app);
 
-    // Setup AppUpdater
     auto appFile = clParser.value(clOptionAppPath);
-    AppUpdater appUpdater(appFile);
-    appUpdater.setSilentLookup(true);
-    appUpdater.doUpdateLookUp();
-
     auto port = clParser.value(clOptionPort).toUShort();
 
     // Setup websocket server
     auto *wsServer = new WebSocketServer(configHandler, appConfigApplication["id"].toString(), port, &app);
-    QObject::connect(wsServer, &WebSocketServer::stopped, &app, &QGuiApplication::quit);    
+    wsServer->setUpdateHandler(updateHandler);
+
+    QObject::connect(wsServer, &WebSocketServer::stopped, &app, &QGuiApplication::quit);
 
     if (wsServer->start()) {
         qInfo() << "Websocket server started at:" << wsServer->serverUrl().toString();
@@ -72,5 +72,8 @@ int main(int argc, char *argv[])
         return 1;
     }
 
+    updateHandler->setAppFile(appFile);
+    updateHandler->checkAppUpdates();
+
     return app.exec();
 }
diff --git a/app/src/updaters/appimageupdatedialog.ui b/app/src/updaters/appimageupdatedialog.ui
index 2ca8fdf..fe490ac 100644
--- a/app/src/updaters/appimageupdatedialog.ui
+++ b/app/src/updaters/appimageupdatedialog.ui
@@ -69,7 +69,7 @@ Do you want to download it?</string>
      <widget class="QWidget" name="progressPage">
       <layout class="QVBoxLayout" name="verticalLayout_2">
        <item>
-        <widget class="QLabel" name="title">
+        <widget class="QLabel" name="progressLabel">
          <property name="text">
           <string>Downloading update contents</string>
          </property>
diff --git a/app/src/updaters/appupdatedialog.cpp b/app/src/updaters/appupdatedialog.cpp
index ae70f3d..f9b5f52 100644
--- a/app/src/updaters/appupdatedialog.cpp
+++ b/app/src/updaters/appupdatedialog.cpp
@@ -16,6 +16,16 @@ AppUpdateDialog::~AppUpdateDialog()
     delete ui;
 }
 
+void AppUpdateDialog::showLookingForUpdates()
+{
+    setWindowTitle(tr("Looking for Pling Store Updates"));
+    ui->progressLabel->setText(tr("Looking for Pling Store Updates"));
+    ui->progressBar->setRange(0, 0);
+
+    ui->stackedWidget->setCurrentWidget(ui->progressPage);
+    show();
+}
+
 void AppUpdateDialog::showUpdateConfirmationMessage()
 {
     setWindowTitle(tr("Pling Store Update Available"));
@@ -60,6 +70,7 @@ void AppUpdateDialog::showProgress(int progress)
     setWindowTitle(tr("Pling Store Update"));
 
     ui->progressBar->setValue(progress);
+    ui->progressBar->setRange(0, 100);
     ui->progressPage->show();
 
     ui->stackedWidget->setCurrentWidget(ui->progressPage);
diff --git a/app/src/updaters/appupdatedialog.h b/app/src/updaters/appupdatedialog.h
index 6a39204..199a925 100644
--- a/app/src/updaters/appupdatedialog.h
+++ b/app/src/updaters/appupdatedialog.h
@@ -27,6 +27,8 @@ signals:
     void updateRequested();
 
 public slots:
+    void showLookingForUpdates();
+
     void showUpdateConfirmationMessage();
 
     void showErrorMessage(const QString &msg);
diff --git a/app/src/updaters/appupdater.cpp b/app/src/updaters/appupdater.cpp
index 328fa1e..35bf811 100644
--- a/app/src/updaters/appupdater.cpp
+++ b/app/src/updaters/appupdater.cpp
@@ -18,6 +18,11 @@ void AppUpdater::setSilentLookup(bool value)
     silentLookup = value;
 }
 
+bool AppUpdater::isRunning()
+{
+    return progressCheckTimer.isActive();
+}
+
 void AppUpdater::doUpdateLookUp()
 {
     if (appImagePath.isEmpty()) {
@@ -26,7 +31,7 @@ void AppUpdater::doUpdateLookUp()
     }
 
     if (!silentLookup)
-        updateDialog.show();
+        updateDialog.showLookingForUpdates();
 
     QtConcurrent::run([=]() {
         appimage::update::Updater updater(appImagePath.toStdString());
diff --git a/app/src/updaters/appupdater.cpp.autosave b/app/src/updaters/appupdater.cpp.autosave
deleted file mode 100644
index 328fa1e..0000000
--- a/app/src/updaters/appupdater.cpp.autosave
+++ /dev/null
@@ -1,143 +0,0 @@
-#include <QDebug>
-#include <QtConcurrent/QtConcurrent>
-
-#include "appimage/update.h"
-#include "appupdater.h"
-
-AppUpdater::AppUpdater(const QString &appImagePath, QObject *parent) : QObject(parent), appImagePath(appImagePath), updateHelper(nullptr)
-{
-    connect(this, &AppUpdater::updateAvailable, &updateDialog, &AppUpdateDialog::showUpdateConfirmationMessage);
-    connect(&updateDialog, &AppUpdateDialog::updateRequested, this, &AppUpdater::doUpdate);
-    connect(&updateDialog, &AppUpdateDialog::restartRequested, this, &AppUpdater::doRestart);
-
-    connect(&updateDialog, &AppUpdateDialog::rejected, this, &AppUpdater::stop);
-}
-
-void AppUpdater::setSilentLookup(bool value)
-{
-    silentLookup = value;
-}
-
-void AppUpdater::doUpdateLookUp()
-{
-    if (appImagePath.isEmpty()) {
-        qWarning() << "Self-updates disabled: No app file provided.";
-        return;
-    }
-
-    if (!silentLookup)
-        updateDialog.show();
-
-    QtConcurrent::run([=]() {
-        appimage::update::Updater updater(appImagePath.toStdString());
-
-        bool updateAvailable; // this is an output parameter!!!
-        updater.checkForChanges(updateAvailable);
-
-        if (updateAvailable) {
-            qDebug() << "Update available";
-            emit this->updateAvailable();
-        }
-
-    });
-}
-
-void AppUpdater::doUpdate()
-{
-    if (appImagePath.isEmpty()) {
-        qWarning() << "Self-updates disabled: No app file provided.";
-        return;
-    }
-
-
-    if (updateHelper !=nullptr)
-        delete updateHelper;
-
-    updateHelper = new appimage::update::Updater(appImagePath.toStdString());
-
-    updateHelper->start();
-
-    progressCheckTimer.setInterval(200);
-    progressCheckTimer.start();
-
-    connect(&progressCheckTimer, &QTimer::timeout, this, &AppUpdater::checkUpdateProgress);
-}
-
-void AppUpdater::doRestart()
-{
-    QProcess::startDetached("killall", {"pling-store"});
-
-    if (updateHelper != nullptr) {
-        std::string pathToNewFile;
-        updateHelper->pathToNewFile(pathToNewFile);
-
-        if (!pathToNewFile.empty()) {
-            QString path = QString::fromStdString(pathToNewFile);
-            QFile::setPermissions(path, QFileDevice::ReadUser | QFileDevice::ExeUser);
-
-
-            QProcess proc;
-            proc.setEnvironment(getCleanSystemEnvironment());
-
-            qDebug() << proc.environment();
-            if (proc.startDetached(path)) {
-                updateDialog.accept();
-            } else
-                updateDialog.showErrorMessage("Unable to start: " + path);
-        }
-    }
-}
-
-void AppUpdater::stop()
-{
-}
-
-void AppUpdater::checkUpdateProgress()
-{
-    using namespace appimage::update;
-    auto state = updateHelper->state();
-    switch (state) {
-    case Updater::INITIALIZED:
-        break;
-    case Updater::RUNNING:
-        double progress;
-        updateHelper->progress(progress);
-        updateDialog.showProgress(progress*100);
-        break;
-    case Updater::STOPPING:
-        break;
-    case Updater::SUCCESS:
-        updateDialog.showCompletionMessage();
-        progressCheckTimer.stop();
-        break;
-    case Updater::ERROR:
-        updateDialog.showErrorMessage(tr("Update failed"));
-        progressCheckTimer.stop();
-        break;
-    }
-}
-
-QStringList AppUpdater::getCleanSystemEnvironment()
-{
-    QString appDirPath = qgetenv("APPDIR");
-
-    QProcessEnvironment systenEnvironemnt = QProcessEnvironment::systemEnvironment();
-    QProcessEnvironment  processEnvironment;
-
-    for (QString key: systenEnvironemnt.keys()) {
-        QString value = systenEnvironemnt.value(key);
-
-        QStringList oldValue = value.split(":");
-        QStringList newVaule;
-        for (const QString &valueSection: oldValue)
-            if (!valueSection.contains(appDirPath))
-                newVaule << valueSection;
-
-        if (!newVaule.empty())
-            processEnvironment.insert(key, newVaule.join(":"));
-    }
-
-    return processEnvironment.toStringList();
-//    return {"DISPLAY=:0"};
-}
-
diff --git a/app/src/updaters/appupdater.h b/app/src/updaters/appupdater.h
index b031191..311310b 100644
--- a/app/src/updaters/appupdater.h
+++ b/app/src/updaters/appupdater.h
@@ -17,9 +17,9 @@ class AppUpdater : public QObject
 public:
     explicit AppUpdater(const QString &appImagePath, QObject *parent = nullptr);
 
-
     void setSilentLookup(bool value);
 
+    bool isRunning();
 signals:
     void updateAvailable();
     void restartApp(QString appPath);
diff --git a/app/src/websockets/websocketserver.cpp b/app/src/websockets/websocketserver.cpp
index 619fe2d..db21de2 100644
--- a/app/src/websockets/websocketserver.cpp
+++ b/app/src/websockets/websocketserver.cpp
@@ -25,7 +25,6 @@ WebSocketServer::WebSocketServer(ConfigHandler *configHandler, const QString &se
     systemHandler_ = new SystemHandler(this);
     ocsApiHandler_ = new OcsApiHandler(configHandler_, this);
     itemHandler_ = new ItemHandler(configHandler_, this);
-    updateHandler_ = new UpdateHandler(configHandler_, this);
     desktopThemeHandler_ = new DesktopThemeHandler(this);
 
     connect(itemHandler_, &ItemHandler::metadataSetChanged, this, &WebSocketServer::itemHandlerMetadataSetChanged);
@@ -38,12 +37,6 @@ WebSocketServer::WebSocketServer(ConfigHandler *configHandler, const QString &se
     connect(itemHandler_, &ItemHandler::installFinished, this, &WebSocketServer::itemHandlerInstallFinished);
     connect(itemHandler_, &ItemHandler::uninstallStarted, this, &WebSocketServer::itemHandlerUninstallStarted);
     connect(itemHandler_, &ItemHandler::uninstallFinished, this, &WebSocketServer::itemHandlerUninstallFinished);
-
-    connect(updateHandler_, &UpdateHandler::checkAllStarted, this, &WebSocketServer::updateHandlerCheckAllStarted);
-    connect(updateHandler_, &UpdateHandler::checkAllFinished, this, &WebSocketServer::updateHandlerCheckAllFinished);
-    connect(updateHandler_, &UpdateHandler::updateStarted, this, &WebSocketServer::updateHandlerUpdateStarted);
-    connect(updateHandler_, &UpdateHandler::updateFinished, this, &WebSocketServer::updateHandlerUpdateFinished);
-    connect(updateHandler_, &UpdateHandler::updateProgress, this, &WebSocketServer::updateHandlerUpdateProgress);
 }
 
 WebSocketServer::~WebSocketServer()
@@ -52,6 +45,17 @@ WebSocketServer::~WebSocketServer()
     wsServer_->deleteLater();
 }
 
+void WebSocketServer::setUpdateHandler(UpdateHandler *updateHandler)
+{
+    updateHandler_ = updateHandler;
+
+    connect(updateHandler_, &UpdateHandler::checkAllStarted, this, &WebSocketServer::updateHandlerCheckAllStarted);
+    connect(updateHandler_, &UpdateHandler::checkAllFinished, this, &WebSocketServer::updateHandlerCheckAllFinished);
+    connect(updateHandler_, &UpdateHandler::updateStarted, this, &WebSocketServer::updateHandlerUpdateStarted);
+    connect(updateHandler_, &UpdateHandler::updateFinished, this, &WebSocketServer::updateHandlerUpdateFinished);
+    connect(updateHandler_, &UpdateHandler::updateProgress, this, &WebSocketServer::updateHandlerUpdateProgress);
+}
+
 bool WebSocketServer::start()
 {
     if (wsServer_->listen(QHostAddress::Any, serverPort_)) {
@@ -382,7 +386,10 @@ void WebSocketServer::receiveMessage(const QString &id, const QString &func, con
     }
     else if (func == "UpdateHandler::update") {
         updateHandler_->update(data.at(0).toString());
+    } else if (func == "UpdateHandler::checkAppUpdate") {
+        updateHandler_->checkAppUpdates();
     }
+
     // DesktopThemeHandler
     else if (func == "DesktopThemeHandler::desktopEnvironment") {
         resultData.append(desktopThemeHandler_->desktopEnvironment());
diff --git a/app/src/websockets/websocketserver.h b/app/src/websockets/websocketserver.h
index 3b1e380..94239d9 100644
--- a/app/src/websockets/websocketserver.h
+++ b/app/src/websockets/websocketserver.h
@@ -23,6 +23,7 @@ public:
     explicit WebSocketServer(ConfigHandler *configHandler, const QString &serverName = QString("WebSocketServer"), quint16 serverPort = 0, QObject *parent = nullptr);
     ~WebSocketServer();
 
+    void setUpdateHandler(UpdateHandler *updateHandler);
 signals:
     void started();
     void stopped();
-- 
GitLab


From 487796492626d4aaaf15ba14cc67fa312a10570a Mon Sep 17 00:00:00 2001
From: Alexis Lopez Zubieta <contact@azubieta.net>
Date: Tue, 10 Sep 2019 12:56:27 -0500
Subject: [PATCH 2/4] Improve build

---
 pkg/appimage/appimagebuild | 14 +++++++++-----
 scripts/package            | 12 ++----------
 2 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/pkg/appimage/appimagebuild b/pkg/appimage/appimagebuild
index 7a47d90..333fe0f 100755
--- a/pkg/appimage/appimagebuild
+++ b/pkg/appimage/appimagebuild
@@ -12,10 +12,14 @@ qmake PREFIX=/usr
 make
 make INSTALL_ROOT=${APPDIR} install
 
-curl -fsSL -o linuxdeployqt https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
-chmod 755 linuxdeployqt
-./linuxdeployqt --appimage-extract
-./squashfs-root/AppRun ${APPDIR}/usr/share/applications/${PKGNAME}.desktop -bundle-non-qt-libs -no-translations
+wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
+wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
+chmod 755 *.AppImage
+
+./linuxdeploy-plugin-qt-x86_64.AppImage --appimage-extract
+./linuxdeploy-x86_64.AppImage --appimage-extract
+./squashfs-root/AppRun --list-plugins
+./squashfs-root/AppRun --appdir ${APPDIR}
 
 install -D -m 755 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 ${APPDIR}/usr/lib/libfontconfig.so.1
 install -D -m 755 /usr/lib/x86_64-linux-gnu/libfreetype.so.6 ${APPDIR}/usr/lib/libfreetype.so.6
@@ -27,6 +31,6 @@ install -D -m 755 /usr/bin/unzip ${APPDIR}/usr/bin/unzip
 install -D -m 755 /usr/lib/p7zip/7zr ${APPDIR}/usr/bin/7zr
 install -D -m 755 /usr/bin/unar ${APPDIR}/usr/bin/unar
 
-./squashfs-root/AppRun ${APPDIR}/usr/share/applications/${PKGNAME}.desktop -appimage
+./squashfs-root/AppRun --appdir ${APPDIR} --plugin qt -output appimage
 
 mv *-x86_64.AppImage ../${PKGNAME}-${PKGVER}-${PKGREL}-x86_64.AppImage
diff --git a/scripts/package b/scripts/package
index 0d6e4c9..3f82b1f 100755
--- a/scripts/package
+++ b/scripts/package
@@ -20,20 +20,12 @@ appimage() { # docker-image: ubuntu:14.04
 
 install_build_deps_appimage() {
     apt-get update -qq
-    apt-get -y --force-yes install curl git vim-common
-    #apt  install build-essential qt5-default libqt5websockets5-dev
-    #apt -y install cmake automake libtool pkg-config wget desktop-file-utils libglib2.0-dev libcairo2-dev libssl-dev libcurl3 libcurl4-openssl-dev libxpm-dev
-    apt-get -y --force-yes install libfontconfig1 libfreetype6 libssl1.0.0 zlib1g unzip p7zip unar
-
-    apt-get -y --force-yes install software-properties-common
+    apt-get -y --force-yes install curl wget git vim-common software-properties-common
     add-apt-repository -y ppa:beineri/opt-qt-5.12.3-xenial
-    echo 'deb http://download.opensuse.org/repositories/home:/TheAssassin:/AppImageLibraries/xUbuntu_16.04/ /' > /etc/apt/sources.list.d/curl-httponly.list
-    curl -fsSL https://download.opensuse.org/repositories/home:TheAssassin:AppImageLibraries/xUbuntu_16.04/Release.key | apt-key add -
     apt-get update -qq
 
-    apt-get -y --force-yes install build-essential mesa-common-dev libglu1-mesa-dev qt512base qt512websockets
+    apt-get -y --force-yes install build-essential qt512base qt512wayland qt512websockets desktop-file-utils libgl1 libdrm-dev mesa-common-dev libssl-dev libtool automake pkg-config libglib2.0-dev libcairo2-dev libglu1-mesa-dev
     curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.13.3/cmake-3.13.3-Linux-x86_64.tar.gz | tar -xz --strip-components=1 -C /
-    apt-get -y --force-yes install automake libtool pkg-config wget desktop-file-utils libglib2.0-dev libcairo2-dev libssl-dev libcurl3 libcurl4-openssl-dev libxpm-dev
 }
 
 build_appimage() {
-- 
GitLab


From 08901051e93c644d638fc18ddf64ed382c2d1cf1 Mon Sep 17 00:00:00 2001
From: Alexis Lopez Zubieta <contact@azubieta.net>
Date: Wed, 11 Sep 2019 00:26:34 -0500
Subject: [PATCH 3/4] Undo build changes

---
 pkg/appimage/appimagebuild | 14 +++++---------
 scripts/package            | 12 ++++++++++--
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/pkg/appimage/appimagebuild b/pkg/appimage/appimagebuild
index 333fe0f..7a47d90 100755
--- a/pkg/appimage/appimagebuild
+++ b/pkg/appimage/appimagebuild
@@ -12,14 +12,10 @@ qmake PREFIX=/usr
 make
 make INSTALL_ROOT=${APPDIR} install
 
-wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
-wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
-chmod 755 *.AppImage
-
-./linuxdeploy-plugin-qt-x86_64.AppImage --appimage-extract
-./linuxdeploy-x86_64.AppImage --appimage-extract
-./squashfs-root/AppRun --list-plugins
-./squashfs-root/AppRun --appdir ${APPDIR}
+curl -fsSL -o linuxdeployqt https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
+chmod 755 linuxdeployqt
+./linuxdeployqt --appimage-extract
+./squashfs-root/AppRun ${APPDIR}/usr/share/applications/${PKGNAME}.desktop -bundle-non-qt-libs -no-translations
 
 install -D -m 755 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 ${APPDIR}/usr/lib/libfontconfig.so.1
 install -D -m 755 /usr/lib/x86_64-linux-gnu/libfreetype.so.6 ${APPDIR}/usr/lib/libfreetype.so.6
@@ -31,6 +27,6 @@ install -D -m 755 /usr/bin/unzip ${APPDIR}/usr/bin/unzip
 install -D -m 755 /usr/lib/p7zip/7zr ${APPDIR}/usr/bin/7zr
 install -D -m 755 /usr/bin/unar ${APPDIR}/usr/bin/unar
 
-./squashfs-root/AppRun --appdir ${APPDIR} --plugin qt -output appimage
+./squashfs-root/AppRun ${APPDIR}/usr/share/applications/${PKGNAME}.desktop -appimage
 
 mv *-x86_64.AppImage ../${PKGNAME}-${PKGVER}-${PKGREL}-x86_64.AppImage
diff --git a/scripts/package b/scripts/package
index 3f82b1f..0d6e4c9 100755
--- a/scripts/package
+++ b/scripts/package
@@ -20,12 +20,20 @@ appimage() { # docker-image: ubuntu:14.04
 
 install_build_deps_appimage() {
     apt-get update -qq
-    apt-get -y --force-yes install curl wget git vim-common software-properties-common
+    apt-get -y --force-yes install curl git vim-common
+    #apt  install build-essential qt5-default libqt5websockets5-dev
+    #apt -y install cmake automake libtool pkg-config wget desktop-file-utils libglib2.0-dev libcairo2-dev libssl-dev libcurl3 libcurl4-openssl-dev libxpm-dev
+    apt-get -y --force-yes install libfontconfig1 libfreetype6 libssl1.0.0 zlib1g unzip p7zip unar
+
+    apt-get -y --force-yes install software-properties-common
     add-apt-repository -y ppa:beineri/opt-qt-5.12.3-xenial
+    echo 'deb http://download.opensuse.org/repositories/home:/TheAssassin:/AppImageLibraries/xUbuntu_16.04/ /' > /etc/apt/sources.list.d/curl-httponly.list
+    curl -fsSL https://download.opensuse.org/repositories/home:TheAssassin:AppImageLibraries/xUbuntu_16.04/Release.key | apt-key add -
     apt-get update -qq
 
-    apt-get -y --force-yes install build-essential qt512base qt512wayland qt512websockets desktop-file-utils libgl1 libdrm-dev mesa-common-dev libssl-dev libtool automake pkg-config libglib2.0-dev libcairo2-dev libglu1-mesa-dev
+    apt-get -y --force-yes install build-essential mesa-common-dev libglu1-mesa-dev qt512base qt512websockets
     curl -fsSL https://github.com/Kitware/CMake/releases/download/v3.13.3/cmake-3.13.3-Linux-x86_64.tar.gz | tar -xz --strip-components=1 -C /
+    apt-get -y --force-yes install automake libtool pkg-config wget desktop-file-utils libglib2.0-dev libcairo2-dev libssl-dev libcurl3 libcurl4-openssl-dev libxpm-dev
 }
 
 build_appimage() {
-- 
GitLab


From 42a75bd73c1df53a2a41d3a6406da1b37b271bb9 Mon Sep 17 00:00:00 2001
From: Alexis Lopez Zubieta <contact@azubieta.net>
Date: Wed, 11 Sep 2019 00:40:08 -0500
Subject: [PATCH 4/4] Do update lookup silently

---
 app/src/main.cpp                | 2 +-
 app/src/updaters/appupdater.cpp | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/src/main.cpp b/app/src/main.cpp
index d196604..326ada6 100644
--- a/app/src/main.cpp
+++ b/app/src/main.cpp
@@ -73,7 +73,7 @@ int main(int argc, char *argv[])
     }
 
     updateHandler->setAppFile(appFile);
-    updateHandler->checkAppUpdates();
+    updateHandler->silentCheckAppUpdates();
 
     return app.exec();
 }
diff --git a/app/src/updaters/appupdater.cpp b/app/src/updaters/appupdater.cpp
index 35bf811..de83ad2 100644
--- a/app/src/updaters/appupdater.cpp
+++ b/app/src/updaters/appupdater.cpp
@@ -42,8 +42,8 @@ void AppUpdater::doUpdateLookUp()
         if (updateAvailable) {
             qDebug() << "Update available";
             emit this->updateAvailable();
-        }
-
+        } else
+            updateDialog.hide();
     });
 }
 
-- 
GitLab