diff --git a/installer/PowerToysBootstrapper/bootstrapper/bootstrapper.cpp b/installer/PowerToysBootstrapper/bootstrapper/bootstrapper.cpp index 144f54abaa..f2d996c30e 100644 --- a/installer/PowerToysBootstrapper/bootstrapper/bootstrapper.cpp +++ b/installer/PowerToysBootstrapper/bootstrapper/bootstrapper.cpp @@ -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) diff --git a/src/common/updating/installer.cpp b/src/common/updating/installer.cpp index fd5c7574c1..f7b4a673a3 100644 --- a/src/common/updating/installer.cpp +++ b/src/common/updating/installer.cpp @@ -193,7 +193,7 @@ namespace updating co_return false; } - bool is_old_windows_version() + bool is_1809_or_older() { return !Is19H1OrHigher(); } diff --git a/src/common/updating/installer.h b/src/common/updating/installer.h index 5263fe4e3e..0da8952482 100644 --- a/src/common/updating/installer.h +++ b/src/common/updating/installer.h @@ -17,5 +17,5 @@ namespace updating std::optional get_installed_powertoys_version(); std::future uninstall_previous_msix_version_async(); - bool is_old_windows_version(); + bool is_1809_or_older(); } \ No newline at end of file