runner: only launch update threads when we know we won't be elevated and show windows for the child (#1537)
This commit is contained in:
parent
bd2cf19ec1
commit
20e89f21ff
|
@ -442,6 +442,7 @@ bool run_elevated(const std::wstring& file, const std::wstring& params)
|
||||||
exec_info.fMask = SEE_MASK_NOCLOSEPROCESS;
|
exec_info.fMask = SEE_MASK_NOCLOSEPROCESS;
|
||||||
exec_info.lpDirectory = 0;
|
exec_info.lpDirectory = 0;
|
||||||
exec_info.hInstApp = 0;
|
exec_info.hInstApp = 0;
|
||||||
|
exec_info.nShow = SW_SHOWDEFAULT;
|
||||||
|
|
||||||
if (ShellExecuteExW(&exec_info))
|
if (ShellExecuteExW(&exec_info))
|
||||||
{
|
{
|
||||||
|
|
|
@ -167,6 +167,17 @@ int runner(bool isProcessElevated)
|
||||||
int result = -1;
|
int result = -1;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
std::thread{ [] {
|
||||||
|
github_update_checking_worker();
|
||||||
|
} }.detach();
|
||||||
|
|
||||||
|
if (winstore::running_as_packaged())
|
||||||
|
{
|
||||||
|
std::thread{ [] {
|
||||||
|
start_msi_uninstallation_sequence();
|
||||||
|
} }.detach();
|
||||||
|
}
|
||||||
|
|
||||||
notifications::register_background_toast_handler();
|
notifications::register_background_toast_handler();
|
||||||
|
|
||||||
chdir_current_executable();
|
chdir_current_executable();
|
||||||
|
@ -318,17 +329,6 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||||
int result = 0;
|
int result = 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
std::thread{ [] {
|
|
||||||
github_update_checking_worker();
|
|
||||||
} }.detach();
|
|
||||||
|
|
||||||
if (winstore::running_as_packaged())
|
|
||||||
{
|
|
||||||
std::thread{ [] {
|
|
||||||
start_msi_uninstallation_sequence();
|
|
||||||
} }.detach();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Singletons initialization order needs to be preserved, first events and
|
// Singletons initialization order needs to be preserved, first events and
|
||||||
// then modules to guarantee the reverse destruction order.
|
// then modules to guarantee the reverse destruction order.
|
||||||
SystemMenuHelperInstace();
|
SystemMenuHelperInstace();
|
||||||
|
|
Loading…
Reference in a new issue