Commit 07f2d9bf authored by Dennis Rassmann's avatar Dennis Rassmann

update_notif: add renaming of application binary

Signed-off-by: Dennis Rassmann's avatarshowp1984 <showp1984@gmail.com>
parent 4b1ceacb
......@@ -281,4 +281,35 @@ void update_notif::downloadFinished()
reply = NULL;
delete file;
file = NULL;
rename_installer();
}
void update_notif::rename_installer()
{
QDir dir(qApp->applicationDirPath());
QString basepath;
#ifdef Q_WS_X11
basepath = qApp->applicationDirPath() + "/" + "Bricked-Installer";
#endif
#ifdef Q_WS_MAC
basepath = qApp->applicationDirPath() + "/" + "Bricked-Installer";
#endif
#ifdef Q_WS_WIN
basepath = qApp->applicationDirPath() + "\\" + "Bricked-Installer.exe";
#endif
QString fPath = basepath;
QString fPath_ren = fPath;
#ifdef Q_WS_WIN
qDebug() << fPath_ren;
fPath_ren.chop(3);
qDebug() << fPath_ren;
fPath_ren += "_old.exe";
qDebug() << fPath_ren;
#else
qDebug() << fPath_ren;
fPath_ren += "_old";
qDebug() << fPath_ren;
#endif
dir.rename(fPath, fPath_ren);
}
......@@ -59,6 +59,7 @@ private:
QFile *file;
QNetworkReply *reply;
bool downloadRequestAborted;
void rename_installer();
private slots:
void on_btn_now_clicked();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment