Skip to content

Commit

Permalink
Remove Windows XP remnants
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocobo1 committed Jul 30, 2019
1 parent cdb0db0 commit 3ab2fe9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 25 deletions.
5 changes: 0 additions & 5 deletions src/base/private/profile_p.cpp
Expand Up @@ -84,11 +84,6 @@ QString Private::DefaultProfile::dataLocation() const

QString Private::DefaultProfile::downloadLocation() const
{
#if defined(Q_OS_WIN)
if (QSysInfo::windowsVersion() <= QSysInfo::WV_XP) // Windows XP
return QDir(QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)).absoluteFilePath(
QCoreApplication::translate("fsutils", "Downloads"));
#endif
return QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
}

Expand Down
26 changes: 6 additions & 20 deletions src/gui/mainwindow.cpp
Expand Up @@ -28,11 +28,6 @@

#include "mainwindow.h"

#if defined(Q_OS_WIN)
#include <Windows.h>
#include <versionhelpers.h> // must follow after Windows.h
#endif

#include <QCloseEvent>
#include <QDebug>
#include <QDesktopServices>
Expand Down Expand Up @@ -2007,9 +2002,7 @@ void MainWindow::installPython()
{
setCursor(QCursor(Qt::WaitCursor));
// Download python
const QString installerURL = (::IsWindowsVistaOrGreater()
? "https://www.python.org/ftp/python/3.6.6/python-3.6.6.exe"
: "https://www.python.org/ftp/python/3.4.4/python-3.4.4.msi");
const QString installerURL = "https://www.python.org/ftp/python/3.6.6/python-3.6.6.exe";
Net::DownloadManager::instance()->download(
Net::DownloadRequest(installerURL).saveToFile(true)
, this, &MainWindow::pythonDownloadFinished);
Expand All @@ -2030,26 +2023,19 @@ void MainWindow::pythonDownloadFinished(const Net::DownloadResult &result)
QProcess installer;
qDebug("Launching Python installer in passive mode...");

if (::IsWindowsVistaOrGreater()) {
QFile::rename(result.filePath, result.filePath + ".exe");
installer.start('"' + Utils::Fs::toNativePath(result.filePath) + ".exe\" /passive");
}
else {
QFile::rename(result.filePath, result.filePath + ".msi");
installer.start(Utils::Misc::windowsSystemPath() + "\\msiexec.exe /passive /i \"" + Utils::Fs::toNativePath(result.filePath) + ".msi\"");
}
QFile::rename(result.filePath, result.filePath + ".exe");
installer.start('"' + Utils::Fs::toNativePath(result.filePath) + ".exe\" /passive");

// Wait for setup to complete
installer.waitForFinished(10 * 60 * 1000);

qDebug("Installer stdout: %s", installer.readAllStandardOutput().data());
qDebug("Installer stderr: %s", installer.readAllStandardError().data());
qDebug("Setup should be complete!");

// Delete temp file
if (::IsWindowsVistaOrGreater())
Utils::Fs::forceRemove(result.filePath + ".exe");
else
Utils::Fs::forceRemove(result.filePath + ".msi");
Utils::Fs::forceRemove(result.filePath + ".exe");

// Reload search engine
if (Utils::ForeignApps::pythonInfo().isSupportedVersion()) {
m_ui->actionSearchWidget->setChecked(true);
Expand Down

0 comments on commit 3ab2fe9

Please sign in to comment.