diff --git a/LICENSE b/LICENSE index 261eeb9e..137fee02 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020-2022 IoeCmcomc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/main.cpp b/src/main.cpp index 0b867195..cade1a31 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,7 +14,7 @@ int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName("IoeCmcomc"); QCoreApplication::setApplicationName("MCDatapacker"); - QCoreApplication::setApplicationVersion("0.4.0"); + QCoreApplication::setApplicationVersion("0.5.0"); /*Q_INIT_RESOURCE(application); */ diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index d44c06d6..41db5634 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -33,6 +33,7 @@ #include #include #include +#include QMap MainWindow::MCRInfoMaps; @@ -100,8 +101,8 @@ MainWindow::MainWindow(QWidget *parent) connect(updater, &QSimpleUpdater::downloadFinished, this, &MainWindow::installUpdate); - const auto &&oldProgramFile = qApp->applicationDirPath() + - QLatin1String("/MCDatapacker_old"); + const auto &oldProgramFile = qApp->applicationDirPath() + + QLatin1String("/MCDatapacker_old"); if (QFile::exists(oldProgramFile)) QFile::remove(oldProgramFile); } @@ -778,7 +779,7 @@ void MainWindow::installUpdate(const QString &url, const QString &filepath) { const auto appDirPath = qApp->applicationDirPath(); qDebug() << filepath << appDirPath << qApp->arguments()[0]; QFile::rename(qApp->arguments()[0], - appDirPath + QLatin1String("/MCDatapacker_old")); + appDirPath + "/MCDatapacker_old"); zip_file zipFile{ filepath.toStdString() }; /* zipFile.printdir(); */ @@ -800,17 +801,20 @@ void MainWindow::installUpdate(const QString &url, const QString &filepath) { if (filename.rightRef(1) == '/') { dir.mkpath(filename); } else { - QFile file(appDirPath + QLatin1Char('/') + filename); + QSaveFile file(appDirPath + QLatin1Char('/') + filename); if (!file.open(QIODevice::WriteOnly)) return; const auto &&fileData = zipFile.read(info); file.write(fileData.c_str(), fileData.size()); - file.close(); + file.commit(); } i++; } + /* QLatin1String("/QSU_Update.bin") crashes the program in release build */ + QFile::remove(appDirPath + QStringLiteral("/QSU_Update.bin")); + progress.setValue(progress.maximum()); QFile::rename(appDirPath + QLatin1String("/MCDatapacker.exe"), diff --git a/src/src.pro b/src/src.pro index 8408c60c..66f0f087 100644 --- a/src/src.pro +++ b/src/src.pro @@ -250,12 +250,12 @@ qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target -VERSION = 0.4.0 +VERSION = 0.5.0 QMAKE_TARGET_COMPANY = IoeCmcomc QMAKE_TARGET = MCDatapacker QMAKE_TARGET_PRODUCT = MCDatapacker QMAKE_TARGET_DESCRIPTION = MCDatapacker - Minecraft datapack editor -QMAKE_TARGET_COPYRIGHT = \\251 2020 - 2021 IoeCmcomc +QMAKE_TARGET_COPYRIGHT = \\251 2020 - 2022 IoeCmcomc win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../lib/json/release/ -ljson