refactor: Use core mode for daemon install on Windows
This commit is contained in:
parent
d6228416a1
commit
53038760de
1 changed files with 4 additions and 7 deletions
|
|
@ -603,16 +603,13 @@ void ArchDaemonWindows::installDaemon()
|
|||
{
|
||||
// install default daemon if not already installed.
|
||||
if (!isDaemonInstalled(DEFAULT_DAEMON_NAME)) {
|
||||
char path[MAX_PATH];
|
||||
GetModuleFileName(ArchMiscWindows::instanceWin32(), path, MAX_PATH);
|
||||
char binPath[MAX_PATH];
|
||||
GetModuleFileName(ArchMiscWindows::instanceWin32(), binPath, MAX_PATH);
|
||||
|
||||
// wrap in quotes so a malicious user can't start \Program.exe as admin.
|
||||
std::stringstream ss;
|
||||
ss << '"';
|
||||
ss << path;
|
||||
ss << '"';
|
||||
const auto command = "\"" + std::string(binPath) + "\"";
|
||||
|
||||
installDaemon(DEFAULT_DAEMON_NAME, DEFAULT_DAEMON_INFO, ss.str().c_str(), "", "");
|
||||
installDaemon(DEFAULT_DAEMON_NAME, DEFAULT_DAEMON_INFO, command.c_str(), "", "");
|
||||
}
|
||||
|
||||
start(DEFAULT_DAEMON_NAME);
|
||||
|
|
|
|||
Loading…
Reference in a new issue