Windows: fix updater issue for win-installer

This commit is contained in:
tobtoht 2022-08-02 13:50:44 +02:00
parent 8b471bfee2
commit d511806487
No known key found for this signature in database
GPG key ID: E45B10DD027D2472
4 changed files with 17 additions and 6 deletions

2
monero

@ -1 +1 @@
Subproject commit 566e6e1904f20d7537c8f4c7f50caf1a5ee86bf8
Subproject commit b45c66e9c62d7e8f24abbcb447f408e618bfd450

View file

@ -1345,9 +1345,10 @@ void MainWindow::onCheckUpdatesComplete(const QString &version, const QString &b
void MainWindow::onShowUpdateCheck(const QString &version, const QString &binaryFilename,
const QString &hash, const QString &signer) {
QString downloadUrl = QString("https://featherwallet.org/files/releases/%1/%2").arg(this->getPlatformTag(), binaryFilename);
QString platformTag = this->getPlatformTag();
QString downloadUrl = QString("https://featherwallet.org/files/releases/%1/%2").arg(platformTag, binaryFilename);
UpdateDialog updateDialog{this, version, downloadUrl, hash, signer};
UpdateDialog updateDialog{this, version, downloadUrl, hash, signer, platformTag};
connect(&updateDialog, &UpdateDialog::restartWallet, m_windowManager, &WindowManager::restartApplication);
updateDialog.exec();
}

View file

@ -14,13 +14,14 @@
#include "zip.h"
UpdateDialog::UpdateDialog(QWidget *parent, QString version, QString downloadUrl, QString hash, QString signer)
UpdateDialog::UpdateDialog(QWidget *parent, QString version, QString downloadUrl, QString hash, QString signer, QString platformTag)
: QDialog(parent)
, ui(new Ui::UpdateDialog)
, m_version(std::move(version))
, m_downloadUrl(std::move(downloadUrl))
, m_hash(std::move(hash))
, m_signer(std::move(signer))
, m_platformTag(std::move(platformTag))
{
ui->setupUi(this);
@ -179,6 +180,10 @@ void UpdateDialog::onInstallUpdate() {
QDir applicationDir(Utils::applicationPath());
QString filePath = applicationDir.filePath(name);
if (m_platformTag == "win-installer") {
filePath = QString("%1/%2").arg(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation), name);
}
m_updatePath = filePath;
QFile file(filePath);
@ -200,7 +205,11 @@ void UpdateDialog::onInstallUpdate() {
return;
}
if (m_platformTag == "win-installer") {
this->setStatus("Installer written. Click 'restart' to close Feather and start the installer.");
} else {
this->setStatus("Installation successful. Do you want to restart Feather now?");
}
ui->btn_restart->show();
}

View file

@ -16,7 +16,7 @@ class UpdateDialog : public QDialog
Q_OBJECT
public:
explicit UpdateDialog(QWidget *parent, QString version, QString downloadUrl, QString hash, QString signer);
explicit UpdateDialog(QWidget *parent, QString version, QString downloadUrl, QString hash, QString signer, QString platformTag);
~UpdateDialog() override;
private slots:
@ -41,6 +41,7 @@ private:
QString m_downloadUrl;
QString m_hash;
QString m_signer;
QString m_platformTag;
QString m_updatePath;