bootstrapper: use WinAPI progress bar window instead of toast notific… (#8210)

* bootstrapper: use WinAPI progress bar window instead of toast notifications

* remove obsolete msi action
This commit is contained in:
Andrey Nekrasov
2020-11-27 00:31:00 +03:00
committed by GitHub
parent 9757a4574f
commit 9735459552
13 changed files with 246 additions and 135 deletions

View File

@@ -20,9 +20,9 @@ namespace updating
return runtimes->find(DESKTOP_DOTNET_RUNTIME_STRING) != std::string::npos;
}
bool install_dotnet(const bool silent)
std::optional<fs::path> download_dotnet()
{
const wchar_t DOTNET_DESKTOP_DOWNLOAD_LINK[] = L"https://download.visualstudio.microsoft.com/download/pr/3eb7efa1-96c6-4e97-bb9f-563ecf595f8a/7efd9c1cdd74df8fb0a34c288138a84f/windowsdesktop-runtime-3.1.6-win-x64.exe";
const wchar_t DOTNET_DESKTOP_DOWNLOAD_LINK[] = L"https://download.visualstudio.microsoft.com/download/pr/513acf37-8da2-497d-bdaa-84d6e33c1fee/eb7b010350df712c752f4ec4b615f89d/windowsdesktop-runtime-3.1.10-win-x64.exe";
const wchar_t DOTNET_DESKTOP_FILENAME[] = L"windowsdesktop-runtime.exe";
auto dotnet_download_path = fs::temp_directory_path() / DOTNET_DESKTOP_FILENAME;
@@ -44,10 +44,11 @@ namespace updating
// couldn't download
}
}
if (!download_success)
{
return false;
}
return download_success ? std::make_optional(dotnet_download_path) : std::nullopt;
}
bool install_dotnet(fs::path dotnet_download_path, const bool silent = false)
{
SHELLEXECUTEINFOW sei{ sizeof(sei) };
sei.fMask = { SEE_MASK_NOASYNC | SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NO_CONSOLE };
sei.lpFile = dotnet_download_path.c_str();

View File

@@ -1,7 +1,12 @@
#pragma once
#include <filesystem>
#include <optional>
namespace fs = std::filesystem;
namespace updating
{
bool dotnet_is_installed();
bool install_dotnet(const bool silent = false);
std::optional<fs::path> download_dotnet();
bool install_dotnet(fs::path dotnet_download_path, const bool silent);
}

View File

@@ -17,4 +17,6 @@
#include <filesystem>
#include <expected.hpp>
#include <optional>
#endif //PCH_H