Update platform check and add help option

This commit is contained in:
EnderIce2 2024-03-07 06:48:29 +02:00
parent d5af2277c5
commit 66a20f51c4
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

16
main.c
View File

@ -60,9 +60,9 @@ void DetectWine()
const char *__sysname; const char *__sysname;
const char *__release; const char *__release;
wine_get_host_version(&__sysname, &__release); wine_get_host_version(&__sysname, &__release);
if (strcmp(__sysname, "Linux") != 0) if (strcmp(__sysname, "Linux") != 0 && strcmp(__sysname, "Darwin") != 0)
{ {
int result = MessageBox(NULL, "This program is designed for Linux only!\nDo you want to proceed?", int result = MessageBox(NULL, "This program is designed for Linux and macOS only!\nDo you want to proceed?",
NULL, MB_YESNO | MB_ICONQUESTION); NULL, MB_YESNO | MB_ICONQUESTION);
if (result == IDYES) if (result == IDYES)
return; return;
@ -114,11 +114,19 @@ int main(int argc, char *argv[])
} }
return 0; return 0;
} }
else if (strcmp(argv[1], "--install") == 0)
if (strcmp(argv[1], "--install") == 0)
InstallService(); InstallService();
else if (strcmp(argv[1], "--uninstall") == 0) else if (strcmp(argv[1], "--uninstall") == 0)
RemoveService(); RemoveService();
else if (strcmp(argv[1], "--help") == 0)
{
printf("Usage:\n");
printf(" %s [args]\n", argv[0]);
printf(" --install - Install service\n");
printf(" --uninstall - Uninstall service\n");
printf(" --help - Show this help\n");
ExitProcess(0);
}
} }
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CreateBridge, CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CreateBridge,