Revert "[PowerToys Run] Update to net5 (#12434)" (#12543)

This reverts commit c651a4b36e.
This commit is contained in:
Mykhailo Pylyp
2021-07-28 14:15:47 +03:00
committed by GitHub
parent 0c02a9acd7
commit 9731cdee67
58 changed files with 402 additions and 180 deletions

View File

@@ -407,39 +407,25 @@ int Bootstrapper(HINSTANCE hInstance)
{
if (installDotnet)
{
auto dotnet3Info = std::make_tuple(VersionHelper{ 3, 1, 15 },
L"https://download.visualstudio.microsoft.com/download/pr/d30352fe-d4f3-4203-91b9-01a3b66a802e/bb416e6573fa278fec92113abefc58b3/windowsdesktop-runtime-3.1.15-win-x64.exe");
auto dotnet5Info = std::make_tuple(VersionHelper{ 5, 0, 7 },
L"https://download.visualstudio.microsoft.com/download/pr/2b83d30e-5c86-4d37-a1a6-582e22ac07b2/c7b1b7e21761bbfb7b9951f5b258806e/windowsdesktop-runtime-5.0.7-win-x64.exe");
const std::array dotnetsToInstall = { std::move(dotnet3Info), std::move(dotnet5Info) };
for (const auto& [ver, downloadLink] : dotnetsToInstall)
spdlog::debug("Detecting if dotnet is installed");
const bool dotnetInstalled = updating::dotnet_is_installed();
spdlog::debug("Dotnet is already installed: {}", dotnetInstalled);
if (!dotnetInstalled)
{
const auto& [major, minor, minimalRequiredPatch] = ver;
spdlog::debug("Detecting if dotnet {} is installed", ver.toString());
const bool dotnetInstalled = updating::dotnet_is_installed(major, minor, minimalRequiredPatch);
if (dotnetInstalled)
{
spdlog::debug("Dotnet {} is already installed: {}", ver.toString(), dotnetInstalled);
continue;
}
bool installedSuccessfully = false;
if (const auto dotnetInstallerPath = updating::download_dotnet(downloadLink))
if (const auto dotnet_installer_path = updating::download_dotnet())
{
// Dotnet installer has its own progress bar
CloseProgressBarDialog();
installedSuccessfully = updating::install_dotnet(*dotnetInstallerPath, g_Silent);
installedSuccessfully = updating::install_dotnet(*dotnet_installer_path, g_Silent);
if (!installedSuccessfully)
{
spdlog::error("Couldn't install dotnet {}", ver.toString());
spdlog::error("Couldn't install dotnet");
}
}
else
{
spdlog::error("Couldn't download dotnet {}", ver.toString());
spdlog::error("Couldn't download dotnet");
}
if (!installedSuccessfully)