diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG
index e73d7a40b..dfc9482cb 100644
--- a/resources/text/CHANGELOG
+++ b/resources/text/CHANGELOG
@@ -8,7 +8,7 @@ Fixed:
Added:
-- Application is now able to self-update itself on OS/2 and Windows. Currently, this is EXPERIMENTAL support. Please, report any bugs.
+- Application is now able to self-update itself on OS/2 and Windows. Currently, this is EXPERIMENTAL support. Please, report any bugs. Authors take no responsibility for removed files or lost application settings.
- Added option to adjust icons/buttons displayed in toolbars. See Settings/User interface/Toolbars dialog for more information.
- Added option to search messages via regular expression.
- Added option to highlight particular messages - unread, important, none.
diff --git a/src/updater/formupdater.cpp b/src/updater/formupdater.cpp
index 8180eb95d..4bf224fb7 100644
--- a/src/updater/formupdater.cpp
+++ b/src/updater/formupdater.cpp
@@ -70,16 +70,7 @@ void FormUpdater::startUpgrade() {
}
doFinalCleanup();
-
- printText("Application was upgraded without serious errors.");
-
- if (!QProcess::startDetached(m_parsedArguments["rssguard_executable_path"])) {
- printText("RSS Guard was not started successfully. Start it manually.");
- m_state = ExitError;
- }
- else {
- m_state = ExitNormal;
- }
+ executeMainApplication();
printText("\nPress any key to exit updater...");
}
@@ -98,6 +89,18 @@ void FormUpdater::saveArguments() {
m_parsedArguments["output_temp_path"] = m_parsedArguments["temp_path"] + QDir::separator() + APP_LOW_NAME;
}
+void FormUpdater::executeMainApplication() {
+ printText("\nApplication was upgraded without serious errors.");
+
+ if (!QProcess::startDetached(m_parsedArguments["rssguard_executable_path"])) {
+ printText("RSS Guard was not started successfully. Start it manually.");
+ m_state = ExitError;
+ }
+ else {
+ m_state = ExitNormal;
+ }
+}
+
void FormUpdater::printArguments() {
printNewline();
printHeading("Arguments");
@@ -198,7 +201,7 @@ bool FormUpdater::doExtractionAndCopying() {
extractor_arguments << "x" << "-r" << "-y" <<
QString("-o%1").arg(m_parsedArguments["output_temp_path"]) <<
- m_parsedArguments["update_file_path"];
+ m_parsedArguments["update_file_path"];
printText(QString("Calling extractor %1 with these arguments:").arg(APP_7ZA_EXECUTABLE));
@@ -209,13 +212,7 @@ bool FormUpdater::doExtractionAndCopying() {
process_extractor.setEnvironment(QProcessEnvironment::systemEnvironment().toStringList());
process_extractor.setWorkingDirectory(m_parsedArguments["rssguard_path"]);
- QString prog_line = QString(APP_7ZA_EXECUTABLE) + " " +
- "x -r -y \"-o" + m_parsedArguments["output_temp_path"] +
- "\" \"" + m_parsedArguments["update_file_path"] + "\"";
- printText(prog_line);
-
- process_extractor.start(prog_line);
- //process_extractor.start(APP_7ZA_EXECUTABLE, extractor_arguments);
+ process_extractor.start(APP_7ZA_EXECUTABLE, extractor_arguments);
if (!process_extractor.waitForFinished()) {
process_extractor.close();
@@ -252,13 +249,22 @@ bool FormUpdater::doExtractionAndCopying() {
}
bool FormUpdater::doFinalCleanup() {
+ bool result_file;
+ bool result_path;
+
qApp->processEvents();
printNewline();
printHeading("Final cleanup");
- return removeDirectory(m_parsedArguments["output_temp_path"]) &&
- QFile::remove(m_parsedArguments["update_file_path"]);
+ result_path = removeDirectory(m_parsedArguments["output_temp_path"]);
+ result_file = QFile::remove(m_parsedArguments["update_file_path"]);
+
+ printText(QString("Removing temporary files\n -> %1 -> %2\n -> %3 -> %4").arg(
+ m_parsedArguments["output_temp_path"], result_path ? "success" : "failure",
+ m_parsedArguments["update_file_path"], result_file ? "success" : "failure"));
+
+ return result_file && result_path;
}
void FormUpdater::keyPressEvent(QKeyEvent* event) {
diff --git a/src/updater/formupdater.h b/src/updater/formupdater.h
index 44ff4a1b2..d2c3f612b 100644
--- a/src/updater/formupdater.h
+++ b/src/updater/formupdater.h
@@ -33,6 +33,7 @@ class FormUpdater : public QMainWindow {
bool doPreparationCleanup();
bool doExtractionAndCopying();
bool doFinalCleanup();
+ void executeMainApplication();
protected:
// Catch the "press any key event" to exit the updater.