[bootstrapper] Allow msi extraction on 1809 and older (#11117)

This commit is contained in:
Enrico Giordani 2021-05-05 23:17:06 -07:00 committed by GitHub
parent 0baf2cb9da
commit 0a232cd3e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 12 deletions

View file

@ -219,16 +219,6 @@ int Bootstrapper(HINSTANCE hInstance)
SetupLogger(logDir, severity);
spdlog::debug("PowerToys Bootstrapper is launched\nnoFullUI: {}\nsilent: {}\nno_start_pt: {}\nskip_dotnet_install: {}\nlog_level: {}\ninstall_dir: {}\nextract_msi: {}\n", noFullUI, g_Silent, noStartPT, skipDotnetInstall, logLevel, installDirArg, extractMsiOnly);
const VersionHelper myVersion(VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION);
// Do not support installing on Windows < 1903
if (myVersion >= VersionHelper{0, 36, 0} && updating::is_old_windows_version())
{
ShowMessageBoxError(IDS_OLD_WINDOWS_ERROR);
spdlog::error("PowerToys {} requires at least Windows 1903 to run.", myVersion.toString());
return 1;
}
// If a user requested an MSI -> extract it and exit
if (extractMsiOnly)
@ -241,9 +231,20 @@ int Bootstrapper(HINSTANCE hInstance)
{
spdlog::error("MSI installer couldn't be extracted");
}
return 0;
}
const VersionHelper myVersion(VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION);
// Do not support installing on Windows < 1903
if (updating::is_1809_or_older())
{
ShowMessageBoxError(IDS_OLD_WINDOWS_ERROR);
spdlog::error("PowerToys {} requires at least Windows 1903 to run.", myVersion.toString());
return 1;
}
// Check if there's a newer version installed
const auto installedVersion = updating::get_installed_powertoys_version();
if (installedVersion && *installedVersion >= myVersion)

View file

@ -193,7 +193,7 @@ namespace updating
co_return false;
}
bool is_old_windows_version()
bool is_1809_or_older()
{
return !Is19H1OrHigher();
}

View file

@ -17,5 +17,5 @@ namespace updating
std::optional<VersionHelper> get_installed_powertoys_version();
std::future<bool> uninstall_previous_msix_version_async();
bool is_old_windows_version();
bool is_1809_or_older();
}