Updater tweakss...
This commit is contained in:
parent
929ad4f33b
commit
b35d10f319
@ -8,7 +8,7 @@ Fixed:
|
|||||||
|
|
||||||
Added:
|
Added:
|
||||||
<ul>
|
<ul>
|
||||||
<li>Application is now able to self-update itself on OS/2 and Windows. Currently, this is EXPERIMENTAL support. Please, report any bugs.</li>
|
<li>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.</li>
|
||||||
<li>Added option to adjust icons/buttons displayed in toolbars. See Settings/User interface/Toolbars dialog for more information.</li>
|
<li>Added option to adjust icons/buttons displayed in toolbars. See Settings/User interface/Toolbars dialog for more information.</li>
|
||||||
<li>Added option to search messages via regular expression.</li>
|
<li>Added option to search messages via regular expression.</li>
|
||||||
<li>Added option to highlight particular messages - unread, important, none.</li>
|
<li>Added option to highlight particular messages - unread, important, none.</li>
|
||||||
|
@ -70,16 +70,7 @@ void FormUpdater::startUpgrade() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
doFinalCleanup();
|
doFinalCleanup();
|
||||||
|
executeMainApplication();
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
printText("\nPress any key to exit updater...");
|
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;
|
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() {
|
void FormUpdater::printArguments() {
|
||||||
printNewline();
|
printNewline();
|
||||||
printHeading("Arguments");
|
printHeading("Arguments");
|
||||||
@ -198,7 +201,7 @@ bool FormUpdater::doExtractionAndCopying() {
|
|||||||
|
|
||||||
extractor_arguments << "x" << "-r" << "-y" <<
|
extractor_arguments << "x" << "-r" << "-y" <<
|
||||||
QString("-o%1").arg(m_parsedArguments["output_temp_path"]) <<
|
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));
|
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.setEnvironment(QProcessEnvironment::systemEnvironment().toStringList());
|
||||||
process_extractor.setWorkingDirectory(m_parsedArguments["rssguard_path"]);
|
process_extractor.setWorkingDirectory(m_parsedArguments["rssguard_path"]);
|
||||||
|
|
||||||
QString prog_line = QString(APP_7ZA_EXECUTABLE) + " " +
|
process_extractor.start(APP_7ZA_EXECUTABLE, extractor_arguments);
|
||||||
"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);
|
|
||||||
|
|
||||||
if (!process_extractor.waitForFinished()) {
|
if (!process_extractor.waitForFinished()) {
|
||||||
process_extractor.close();
|
process_extractor.close();
|
||||||
@ -252,13 +249,22 @@ bool FormUpdater::doExtractionAndCopying() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool FormUpdater::doFinalCleanup() {
|
bool FormUpdater::doFinalCleanup() {
|
||||||
|
bool result_file;
|
||||||
|
bool result_path;
|
||||||
|
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
|
|
||||||
printNewline();
|
printNewline();
|
||||||
printHeading("Final cleanup");
|
printHeading("Final cleanup");
|
||||||
|
|
||||||
return removeDirectory(m_parsedArguments["output_temp_path"]) &&
|
result_path = removeDirectory(m_parsedArguments["output_temp_path"]);
|
||||||
QFile::remove(m_parsedArguments["update_file_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) {
|
void FormUpdater::keyPressEvent(QKeyEvent* event) {
|
||||||
|
@ -33,6 +33,7 @@ class FormUpdater : public QMainWindow {
|
|||||||
bool doPreparationCleanup();
|
bool doPreparationCleanup();
|
||||||
bool doExtractionAndCopying();
|
bool doExtractionAndCopying();
|
||||||
bool doFinalCleanup();
|
bool doFinalCleanup();
|
||||||
|
void executeMainApplication();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Catch the "press any key event" to exit the updater.
|
// Catch the "press any key event" to exit the updater.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user