mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-02-17 14:07:28 +08:00
This reverts commit 6e62c10fa0.
This commit is contained in:
@@ -765,16 +765,6 @@ void TryCreateStartServiceByShell(LPWSTR svcName, LPWSTR svcBinary, LPWSTR szSvc
|
||||
WcaLog(LOGMSG_STANDARD, "Service \"%ls\" is created with shell.", svcName);
|
||||
}
|
||||
|
||||
hr = StringCchPrintfW(szCmd, cchCmd, L"/c sc config %ls start= delayed-auto", svcName);
|
||||
if (FAILED(hr)) {
|
||||
WcaLog(LOGMSG_STANDARD, "Failed to format delayed auto-start command for service: %ls, HRESULT: 0x%08X", svcName, hr);
|
||||
} else {
|
||||
hi = ShellExecuteW(NULL, L"open", L"cmd.exe", szCmd, NULL, SW_HIDE);
|
||||
if ((int)hi <= 32) {
|
||||
WcaLog(LOGMSG_STANDARD, "Failed to configure delayed auto-start for service with shell: %d, last error: 0x%08X.", (int)hi, GetLastError());
|
||||
}
|
||||
}
|
||||
|
||||
// Query and log if the service is running.
|
||||
for (int k = 0; k < 10; ++k) {
|
||||
if (!QueryServiceStatusExW(svcName, &svcStatus)) {
|
||||
|
||||
@@ -49,15 +49,6 @@ bool MyCreateServiceW(LPCWSTR serviceName, LPCWSTR displayName, LPCWSTR binaryPa
|
||||
WcaLog(LOGMSG_STANDARD, "Service installed successfully\n");
|
||||
}
|
||||
|
||||
SERVICE_DELAYED_AUTO_START_INFO delayedStart = { TRUE };
|
||||
if (!ChangeServiceConfig2W(
|
||||
schService,
|
||||
SERVICE_CONFIG_DELAYED_AUTO_START_INFO,
|
||||
&delayedStart
|
||||
)) {
|
||||
WcaLog(LOGMSG_STANDARD, "Failed to configure delayed auto-start for service: %ls, Error: %d\n", serviceName, GetLastError());
|
||||
}
|
||||
|
||||
CloseServiceHandle(schService);
|
||||
CloseServiceHandle(schSCManager);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user