mirror of
https://github.com/EnderIce2/rpc-bridge.git
synced 2025-05-27 15:04:34 +00:00
Prevent installing as service on macOS
This commit is contained in:
parent
16291ec0fd
commit
d5af2277c5
19
service.c
19
service.c
@ -83,10 +83,29 @@ void ServiceMain(DWORD argc, LPTSTR *argv)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DetectDarwin()
|
||||||
|
{
|
||||||
|
static void(CDECL * wine_get_host_version)(const char **sysname, const char **release);
|
||||||
|
wine_get_host_version = (void *)GetProcAddress(GetModuleHandle("ntdll.dll"),
|
||||||
|
"wine_get_host_version");
|
||||||
|
const char *__sysname;
|
||||||
|
const char *__release;
|
||||||
|
wine_get_host_version(&__sysname, &__release);
|
||||||
|
if (strcmp(__sysname, "Darwin") == 0)
|
||||||
|
{
|
||||||
|
/* FIXME: I don't know how to get the TMPDIR without getenv */
|
||||||
|
MessageBox(NULL, "Registering as a service is not supported on macOS at the moment.",
|
||||||
|
"Unsupported", MB_OK | MB_ICONINFORMATION);
|
||||||
|
ExitProcess(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void InstallService()
|
void InstallService()
|
||||||
{
|
{
|
||||||
print("Registering to run on startup\n");
|
print("Registering to run on startup\n");
|
||||||
|
|
||||||
|
DetectDarwin();
|
||||||
|
|
||||||
SC_HANDLE schSCManager, schService;
|
SC_HANDLE schSCManager, schService;
|
||||||
DWORD dwTagId;
|
DWORD dwTagId;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user