Update file paths

This commit is contained in:
EnderIce2 2024-04-05 22:36:05 +03:00
parent 7af098ab26
commit aeda375cba
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
2 changed files with 7 additions and 7 deletions

10
main.c
View File

@ -248,9 +248,9 @@ void HandleArguments(int argc, char *argv[])
{
char filename[MAX_PATH];
GetModuleFileName(NULL, filename, MAX_PATH);
CopyFile(filename, "C:\\bridge.exe", FALSE);
CopyFile(filename, "C:\\windows\\bridge.exe", FALSE);
InstallService(SERVICE_AUTO_START, "C:\\bridge.exe --service");
InstallService(SERVICE_AUTO_START, "C:\\windows\\bridge.exe --service");
ExitProcess(0);
}
else if (strcmp(argv[1], "--uninstall") == 0)
@ -264,9 +264,9 @@ void HandleArguments(int argc, char *argv[])
printf(" %s [args]\n", argv[0]);
printf(" --help - Show this help\n");
printf(" --install - Install service\n");
printf(" This will copy the binary to C:\\bridge.exe and register it as a service\n");
printf(" This will copy the binary to C:\\windows\\bridge.exe and register it as a service\n");
printf(" --uninstall - Uninstall service\n");
printf(" This will remove the service and delete C:\\bridge.exe\n");
printf(" This will remove the service and delete C:\\windows\\bridge.exe\n");
printf(" --steam - Reserved for Steam\n");
printf(" This will start the service and exit (used with bridge.sh)\n");
printf(" --no-service - Do not run as service\n");
@ -279,7 +279,7 @@ void HandleArguments(int argc, char *argv[])
int main(int argc, char *argv[])
{
DetectWine();
char *logFilePath = "C:\\bridge.log";
char *logFilePath = "C:\\windows\\logs\\bridge.log";
g_logFile = fopen(logFilePath, "w");
if (g_logFile == NULL)
{

View File

@ -134,7 +134,7 @@ void RemoveService()
SC_HANDLE schSCManager, schService;
SERVICE_STATUS ssSvcStatus;
schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_CONNECT);
schSCManager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
if (schSCManager == NULL)
{
MessageBox(NULL, GetErrorMessage(),
@ -184,7 +184,7 @@ void RemoveService()
ExitProcess(1);
}
DeleteFile("C:\\bridge.exe");
DeleteFile("C:\\windows\\bridge.exe");
print("Service removed successfully\n");
CloseServiceHandle(schService);
CloseServiceHandle(schSCManager);