Skip to content

Commit

Permalink
Runner: fix restarting with same elevation (microsoft#1133)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzoz authored and udit3333 committed Feb 19, 2020
1 parent 94119d7 commit d1aafe8
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 d1aafe8

Please sign in to comment.