1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2024-10-28 16:59:36 +01:00

updatemanager: use msiexec to launch update installer

Change-Id: I605cc425b600b08dac809f0d38d366279140895d
This commit is contained in:
Andreas Traczyk 2023-06-02 18:34:28 -04:00
parent 7611cb6147
commit 51cfef2fdc
5 changed files with 20 additions and 27 deletions

View file

@ -138,7 +138,6 @@ Q_SIGNALS:
void selectedConvUidChanged();
void restoreAppRequested();
void notificationClicked();
void quitEngineRequested();
void conversationUpdated(const QString& convId, const QString& accountId);
void draftSaved(const QString& convId);
void base64SwarmAvatarChanged();

View file

@ -177,13 +177,6 @@ MainApplication::init()
screenInfo_.setCurrentFocusWindow(this->focusWindow());
});
QObject::connect(
lrcInstance_.get(),
&LRCInstance::quitEngineRequested,
this,
[this] { Q_EMIT engine_->quit(); },
Qt::DirectConnection);
auto downloadPath = settingsManager_->getValue(Settings::Key::DownloadPath);
auto screenshotPath = settingsManager_->getValue(Settings::Key::ScreenshotPath);
auto allowTransferFromTrusted = settingsManager_->getValue(Settings::Key::AutoAcceptFiles)

View file

@ -36,12 +36,12 @@ SimpleMessageDialog {
Connections {
target: UpdateManager
function onDownloadProgressChanged(bytesRead, totalBytes) {
downloadDialog.setDownloadProgress(bytesRead, totalBytes);
function onUpdateErrorOccurred(error) {
downloadDialog.close();
}
function onUpdateDownloadErrorOccurred(error) {
downloadDialog.close();
function onDownloadProgressChanged(bytesRead, totalBytes) {
downloadDialog.setDownloadProgress(bytesRead, totalBytes);
}
function onUpdateDownloadFinished() {

View file

@ -95,12 +95,12 @@ struct UpdateManager::Impl : public QObject
&NetworkManager::errorOccured,
&parent_,
&UpdateManager::updateErrorOccurred);
connect(&parent_, &UpdateManager::statusChanged, this, [this](GetStatus status) {
connect(&parent_, &UpdateManager::statusChanged, this, [this](Status status) {
switch (status) {
case GetStatus::STARTED:
case Status::STARTED:
Q_EMIT parent_.updateDownloadStarted();
break;
case GetStatus::FINISHED:
case Status::FINISHED:
Q_EMIT parent_.updateDownloadFinished();
break;
default:
@ -116,14 +116,15 @@ struct UpdateManager::Impl : public QObject
[this, downloadUrl](bool success, const QString& errorMessage) {
Q_UNUSED(success)
Q_UNUSED(errorMessage)
lrcInstance_->finish();
Q_EMIT lrcInstance_->quitEngineRequested();
auto args = QString(" /passive /norestart WIXNONUILAUNCH=1");
QProcess process;
process.start("powershell ",
QStringList() << tempPath_ + "\\" + downloadUrl.fileName() << "/L*V"
<< tempPath_ + "\\jami_x64_install.log" + args);
process.waitForFinished();
auto basePath = tempPath_ + QDir::separator();
auto msiPath = QDir::toNativeSeparators(basePath + downloadUrl.fileName());
auto logPath = QDir::toNativeSeparators(basePath + "jami_x64_install.log");
process.startDetached("msiexec",
QStringList() << "/i" << msiPath << "/passive"
<< "/norestart"
<< "WIXNONUILAUNCH=1"
<< "/L*V" << logPath);
},
tempPath_);
};
@ -313,10 +314,10 @@ UpdateManager::downloadFile(const QUrl& url,
resetDownload();
}
onDoneCallback(success, errorMessage);
Q_EMIT statusChanged(GetStatus::FINISHED);
Q_EMIT statusChanged(Status::FINISHED);
});
Q_EMIT statusChanged(GetStatus::STARTED);
Q_EMIT statusChanged(Status::STARTED);
}
void

View file

@ -36,8 +36,8 @@ public:
QObject* parent = nullptr);
~UpdateManager();
enum GetStatus { STARTED, FINISHED };
Q_ENUM(GetStatus)
enum Status { STARTED, FINISHED };
Q_ENUM(Status)
Q_INVOKABLE void checkForUpdates(bool quiet = false);
Q_INVOKABLE void applyUpdates(bool beta = false);
@ -53,7 +53,7 @@ public:
const QString& filePath);
Q_SIGNALS:
void statusChanged(GetStatus status);
void statusChanged(UpdateManager::Status status);
void downloadProgressChanged(qint64 bytesRead, qint64 totalBytes);
void updateCheckReplyReceived(bool ok, bool found = false);