void UpdaterDialog::initUpdate(void) { //Clean up files from previous attempt if(!m_binaries.isEmpty()) { cleanFiles(); } //Check binary files QString wgetBin, gpgvBin; if(!checkBinaries(wgetBin, gpgvBin)) { ui->buttonCancel->setEnabled(true); const QString message = QString("%1<br><br><nobr><a href=\"%2\">%3</a></nobr><br>").arg(tr("At least one file required by the web-update tool is missing or corrupted.<br>Please re-install this application and then try again!"), QString::fromLatin1(m_updateUrl), QString::fromLatin1(m_updateUrl).replace("-", "−")); if(QMessageBox::critical(this, tr("File Error"), message, tr("Download Latest Version"), tr("Discard")) == 0) { QDesktopServices::openUrl(QUrl(QString::fromLatin1(m_updateUrl))); } close(); return; } //Make sure user does have admin access if(!MUtils::OS::user_is_admin()) { qWarning("User is not in the \"admin\" group, cannot update!"); QString message; message += QString("<nobr>%1</nobr><br>").arg(tr("Sorry, but only users in the \"Administrators\" group can install updates.")); message += QString("<nobr>%1</nobr>").arg(tr("Please start application from an administrator account and try again!")); if(QMessageBox::critical(this, this->windowTitle(), message, tr("Discard"), tr("Ignore")) != 1) { ui->buttonCancel->setEnabled(true); close(); return; } } //Create and setup thread if(!m_thread) { m_thread.reset(new MUtils::UpdateChecker(m_binaries.value("wget.exe"), m_binaries.value("gpgv.exe"), m_binaries.value("gpgv.gpg"), "Simple x264 Launcher", x264_version_build(), false)); connect(m_thread.data(), SIGNAL(statusChanged(int)), this, SLOT(threadStatusChanged(int))); connect(m_thread.data(), SIGNAL(finished()), this, SLOT(threadFinished())); connect(m_thread.data(), SIGNAL(terminated()), this, SLOT(threadFinished())); connect(m_thread.data(), SIGNAL(messageLogged(QString)), this, SLOT(threadMessageLogged(QString))); }
static void x264_print_logo(void) { //Print version info qDebug("Simple x264 Launcher v%u.%02u.%u - use 64-Bit x264 with 32-Bit Avisynth", x264_version_major(), x264_version_minor(), x264_version_build()); qDebug("Copyright (c) 2004-%04d LoRd_MuldeR <*****@*****.**>. Some rights reserved.", qMax(MUtils::Version::app_build_date().year(), MUtils::OS::current_date().year())); qDebug("Built on %s at %s with %s for Win-%s.\n", MUTILS_UTF8(MUtils::Version::app_build_date().toString(Qt::ISODate)), MUTILS_UTF8(MUtils::Version::app_build_time().toString(Qt::ISODate)), MUtils::Version::compiler_version(), MUtils::Version::compiler_arch()); //print license info qDebug("This program is free software: you can redistribute it and/or modify"); qDebug("it under the terms of the GNU General Public License <http://www.gnu.org/>."); qDebug("Note that this program is distributed with ABSOLUTELY NO WARRANTY.\n"); //Print library version qDebug("This application is powerd by MUtils library v%u.%02u (%s, %s).\n", MUtils::Version::lib_version_major(), MUtils::Version::lib_version_minor(), MUTILS_UTF8(MUtils::Version::lib_build_date().toString(Qt::ISODate)), MUTILS_UTF8(MUtils::Version::lib_build_time().toString(Qt::ISODate))); //Print warning, if this is a "debug" build if(MUTILS_DEBUG) { qWarning("---------------------------------------------------------"); qWarning("DEBUG BUILD: DO NOT RELEASE THIS BINARY TO THE PUBLIC !!!"); qWarning("---------------------------------------------------------\n"); } }