Skip to content

Commit

Permalink
Created a scaffold for Linux installation
Browse files Browse the repository at this point in the history
  • Loading branch information
aiamnezia committed Nov 28, 2024
1 parent a71ca29 commit efdd47a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
11 changes: 6 additions & 5 deletions client/ui/controllers/updateController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void UpdateController::checkForUpdates()

for (auto asset : assets) {
QJsonObject assetObject = asset.toObject();
if (assetObject.value("name").toString().contains(".dmg")) {
if (assetObject.value("name").toString().contains(".tar.gz")) {
m_downloadUrl = assetObject.value("browser_download_url").toString();
}
}
Expand Down Expand Up @@ -112,10 +112,11 @@ void UpdateController::runInstaller()
QFutureWatcher<int> watcher;
QFuture<int> future = QtConcurrent::run([this]() {
QString t = installerPath;
QRemoteObjectPendingReply<int> ipcReply = IpcClient::Interface()->mountDmg(t, true);
ipcReply.waitForFinished();
QProcess::execute("/Volumes/AmneziaVPN/AmneziaVPN.app/Contents/MacOS/AmneziaVPN");
ipcReply = IpcClient::Interface()->mountDmg(t, false);
QRemoteObjectPendingReply<int> ipcReply = IpcClient::Interface()->installApp(t);
// QRemoteObjectPendingReply<int> ipcReply = IpcClient::Interface()->mountDmg(t, true);
// ipcReply.waitForFinished();
// QProcess::execute("/Volumes/AmneziaVPN/AmneziaVPN.app/Contents/MacOS/AmneziaVPN");
// ipcReply = IpcClient::Interface()->mountDmg(t, false);
ipcReply.waitForFinished();
return ipcReply.returnValue();
});
Expand Down
1 change: 1 addition & 0 deletions ipc/ipc_interface.rep
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@ class IpcInterface
SLOT( bool updateResolvers(const QString& ifname, const QList<QHostAddress>& resolvers) );

SLOT( int mountDmg(const QString &path, bool mount) );
SLOT (int installApp(const QString &path));
};

8 changes: 8 additions & 0 deletions ipc/ipcserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
1 change: 1 addition & 0 deletions ipc/ipcserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class IpcServer : public IpcInterfaceSource
virtual bool disableKillSwitch() override;
virtual bool updateResolvers(const QString& ifname, const QList<QHostAddress>& resolvers) override;
virtual int mountDmg(const QString &path, bool mount) override;
virtual int installApp(const QString &path) override;

private:
int m_localpid = 0;
Expand Down

0 comments on commit efdd47a

Please sign in to comment.