Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Runner: fix restarting with same elevation (#1133)
  • Loading branch information
bzoz committed Jan 23, 2020
1 parent f8bcf52 commit cc99abc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/common/common.cpp
Expand Up @@ -248,7 +248,7 @@ bool run_elevated(const std::wstring& file, const std::wstring& params) {
}

bool run_non_elevated(const std::wstring& file, const std::wstring& params) {
auto executable_args = file;
auto executable_args = L"\"" + file + L"\"";
if (!params.empty()) {
executable_args += L" " + params;
}
Expand Down Expand Up @@ -311,7 +311,7 @@ bool run_non_elevated(const std::wstring& file, const std::wstring& params) {
}

bool run_same_elevation(const std::wstring& file, const std::wstring& params) {
auto executable_args = file;
auto executable_args = L"\"" + file + L"\"";
if (!params.empty()) {
executable_args += L" " + params;
}
Expand Down
2 changes: 1 addition & 1 deletion src/runner/restart_elevated.cpp
Expand Up @@ -47,5 +47,5 @@ bool restart_same_elevation()
constexpr DWORD exe_path_size = 0xFFFF;
auto exe_path = std::make_unique<wchar_t[]>(exe_path_size);
GetModuleFileNameW(nullptr, exe_path.get(), exe_path_size);
return run_same_elevation(exe_path.get(), {});
return run_same_elevation(exe_path.get(), L"--dont-elevate");
}

0 comments on commit cc99abc

Please sign in to comment.