From 4edd9b741c0d5199dee2e726d86a9ef446254018 Mon Sep 17 00:00:00 2001 From: aiamnezia Date: Thu, 28 Nov 2024 11:36:50 +0400 Subject: [PATCH] Created a scaffold for Linux installation --- ipc/ipc_interface.rep | 1 + ipc/ipcserver.cpp | 8 ++++++++ ipc/ipcserver.h | 1 + 3 files changed, 10 insertions(+) diff --git a/ipc/ipc_interface.rep b/ipc/ipc_interface.rep index 1647ea190..7dad63bd4 100644 --- a/ipc/ipc_interface.rep +++ b/ipc/ipc_interface.rep @@ -34,5 +34,6 @@ class IpcInterface SLOT( bool updateResolvers(const QString& ifname, const QList& resolvers) ); SLOT( int mountDmg(const QString &path, bool mount) ); + SLOT (int installApp(const QString &path)); }; diff --git a/ipc/ipcserver.cpp b/ipc/ipcserver.cpp index 2565fc996..c4fe804ea 100644 --- a/ipc/ipcserver.cpp +++ b/ipc/ipcserver.cpp @@ -377,3 +377,11 @@ int IpcServer::mountDmg(const QString &path, bool mount) #endif return 0; } + +int IpcServer::installApp(const QString &path) +{ +#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID) + return QProcess::execute(QString("sudo dpkg -i %1").arg(path)); +#endif + return 0; +} diff --git a/ipc/ipcserver.h b/ipc/ipcserver.h index 5d8b61a25..7e5b21d11 100644 --- a/ipc/ipcserver.h +++ b/ipc/ipcserver.h @@ -39,6 +39,7 @@ class IpcServer : public IpcInterfaceSource virtual bool disableKillSwitch() override; virtual bool updateResolvers(const QString& ifname, const QList& resolvers) override; virtual int mountDmg(const QString &path, bool mount) override; + virtual int installApp(const QString &path) override; private: int m_localpid = 0;