You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.3 KiB
C++
39 lines
1.3 KiB
C++
/*
|
|
* Copyright (c) Contributors to the Open 3D Engine Project.
|
|
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 OR MIT
|
|
*
|
|
*/
|
|
|
|
#include <Source/StandaloneToolsApplication.h>
|
|
|
|
namespace StandaloneTools
|
|
{
|
|
bool BaseApplication::LaunchDiscoveryService()
|
|
{
|
|
WCHAR exeName[MAX_PATH] = { 0 };
|
|
::GetModuleFileName(::GetModuleHandle(nullptr), exeName, MAX_PATH);
|
|
WCHAR drive[MAX_PATH] = { 0 };
|
|
WCHAR dir[MAX_PATH] = { 0 };
|
|
WCHAR discoveryServiceExe[MAX_PATH] = { 0 };
|
|
WCHAR workingDir[MAX_PATH] = { 0 };
|
|
|
|
_wsplitpath_s(exeName, drive, static_cast<size_t>(AZ_ARRAY_SIZE(drive)), dir, static_cast<size_t>(AZ_ARRAY_SIZE(dir)), nullptr, 0, nullptr, 0);
|
|
_wmakepath_s(discoveryServiceExe, drive, dir, L"GridHub", L"exe");
|
|
_wmakepath_s(workingDir, drive, dir, nullptr, nullptr);
|
|
|
|
STARTUPINFO si;
|
|
ZeroMemory(&si, sizeof(si));
|
|
|
|
si.cb = sizeof(si);
|
|
si.dwFlags = STARTF_USESHOWWINDOW;
|
|
si.wShowWindow = SW_MINIMIZE;
|
|
|
|
PROCESS_INFORMATION pi;
|
|
|
|
wchar_t commandLine[] = L"-fail_silently";
|
|
return ::CreateProcessW(discoveryServiceExe, commandLine, nullptr, nullptr, FALSE, 0, nullptr, workingDir, &si, &pi) == TRUE;
|
|
}
|
|
}
|