mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-22 11:39:25 +00:00
Windows: fix updater issue for win-installer
This commit is contained in:
parent
8b471bfee2
commit
d511806487
4 changed files with 17 additions and 6 deletions
2
monero
2
monero
|
@ -1 +1 @@
|
|||
Subproject commit 566e6e1904f20d7537c8f4c7f50caf1a5ee86bf8
|
||||
Subproject commit b45c66e9c62d7e8f24abbcb447f408e618bfd450
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue