mirror of
https://github.com/EnderIce2/rpc-bridge.git
synced 2025-05-25 14:04:37 +00:00
Print version on program start
This commit is contained in:
parent
7363ee64d5
commit
ccf09806c9
5
.vscode/c_cpp_properties.json
vendored
5
.vscode/c_cpp_properties.json
vendored
@ -5,7 +5,10 @@
|
|||||||
"includePath": [
|
"includePath": [
|
||||||
"${workspaceFolder}/**"
|
"${workspaceFolder}/**"
|
||||||
],
|
],
|
||||||
"defines": [],
|
"defines": [
|
||||||
|
"GIT_COMMIT",
|
||||||
|
"GIT_BRANCH"
|
||||||
|
],
|
||||||
"cStandard": "c17",
|
"cStandard": "c17",
|
||||||
"cppStandard": "gnu++17",
|
"cppStandard": "gnu++17",
|
||||||
"intelliSenseMode": "windows-gcc-x64"
|
"intelliSenseMode": "windows-gcc-x64"
|
||||||
|
5
Makefile
5
Makefile
@ -1,7 +1,10 @@
|
|||||||
C_SOURCES = $(shell find ./ -type f -name '*.c')
|
C_SOURCES = $(shell find ./ -type f -name '*.c')
|
||||||
C_OBJECTS = $(C_SOURCES:.c=.o)
|
C_OBJECTS = $(C_SOURCES:.c=.o)
|
||||||
|
|
||||||
CFLAGS = -std=c17 -Wno-int-conversion
|
GIT_COMMIT = $(shell git rev-parse --short HEAD)
|
||||||
|
GIT_BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
|
||||||
|
|
||||||
|
CFLAGS = -std=c17 -Wno-int-conversion -DGIT_COMMIT='"$(GIT_COMMIT)"' -DGIT_BRANCH='"$(GIT_BRANCH)"'
|
||||||
LFLAGS = -lgdi32
|
LFLAGS = -lgdi32
|
||||||
|
|
||||||
# DBGFLAGS = -Wl,--export-all-symbols -g -O0 -ggdb3 -Wall
|
# DBGFLAGS = -Wl,--export-all-symbols -g -O0 -ggdb3 -Wall
|
||||||
|
13
gui.c
13
gui.c
@ -191,11 +191,14 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||||||
case IDM_HELP_ABOUT:
|
case IDM_HELP_ABOUT:
|
||||||
{
|
{
|
||||||
char msg[256];
|
char msg[256];
|
||||||
sprintf(msg, "rpc-bridge v%s\n\n"
|
snprintf(msg, sizeof(msg),
|
||||||
"Simple bridge that allows you to use Discord Rich Presence with Wine games/software.\n\n"
|
"rpc-bridge v%s\n"
|
||||||
"Created by EnderIce2\n\n"
|
" branch: %s\n"
|
||||||
"Licensed under the MIT License",
|
" commit: %s\n\n"
|
||||||
VER_VERSION_STR);
|
"Simple bridge that allows you to use Discord Rich Presence with Wine games/software.\n\n"
|
||||||
|
"Created by EnderIce2\n\n"
|
||||||
|
"Licensed under the MIT License",
|
||||||
|
VER_VERSION_STR, GIT_BRANCH, GIT_COMMIT);
|
||||||
MessageBox(NULL, msg, "About", MB_OK);
|
MessageBox(NULL, msg, "About", MB_OK);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
61
main.c
61
main.c
@ -273,38 +273,38 @@ void HandleArguments(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else if (strcmp(argv[1], "--version") == 0)
|
else if (strcmp(argv[1], "--version") == 0)
|
||||||
{
|
{
|
||||||
printf("%s\n", VER_VERSION_STR);
|
/* Already shows the version */
|
||||||
ExitProcess(0);
|
ExitProcess(0);
|
||||||
}
|
}
|
||||||
else if (strcmp(argv[1], "--help") == 0)
|
else if (strcmp(argv[1], "--help") == 0)
|
||||||
{
|
{
|
||||||
printf("Usage:\n"
|
print("Usage:\n"
|
||||||
" %s [args]\n"
|
" %s [args]\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Arguments:\n"
|
"Arguments:\n"
|
||||||
" --help Show this help\n"
|
" --help Show this help\n"
|
||||||
"\n"
|
"\n"
|
||||||
" --version Show version\n"
|
" --version Show version\n"
|
||||||
"\n"
|
"\n"
|
||||||
" --install Install service\n"
|
" --install Install service\n"
|
||||||
" This will copy the binary to C:\\windows\\bridge.exe and register it as a service\n"
|
" This will copy the binary to C:\\windows\\bridge.exe and register it as a service\n"
|
||||||
"\n"
|
"\n"
|
||||||
" --uninstall Uninstall service\n"
|
" --uninstall Uninstall service\n"
|
||||||
" This will remove the service and delete C:\\windows\\bridge.exe\n"
|
" This will remove the service and delete C:\\windows\\bridge.exe\n"
|
||||||
"\n"
|
"\n"
|
||||||
" --steam Reserved for Steam\n"
|
" --steam Reserved for Steam\n"
|
||||||
" This will start the service and exit (used with bridge.sh)\n"
|
" This will start the service and exit (used with bridge.sh)\n"
|
||||||
"\n"
|
"\n"
|
||||||
" --no-service Do not run as service\n"
|
" --no-service Do not run as service\n"
|
||||||
" (only for --steam)\n"
|
" (only for --steam)\n"
|
||||||
"\n"
|
"\n"
|
||||||
" --service Reserved for service\n"
|
" --service Reserved for service\n"
|
||||||
"\n"
|
"\n"
|
||||||
" --rpc <dir> Set RPC_PATH environment variable\n"
|
" --rpc <dir> Set RPC_PATH environment variable\n"
|
||||||
" This is used to specify the directory where 'discord-ipc-0' is located\n"
|
" This is used to specify the directory where 'discord-ipc-0' is located\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Note: If no arguments are provided, the GUI will be shown instead\n",
|
"Note: If no arguments are provided, the GUI will be shown instead\n",
|
||||||
argv[0]);
|
argv[0]);
|
||||||
ExitProcess(0);
|
ExitProcess(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -316,11 +316,12 @@ int main(int argc, char *argv[])
|
|||||||
g_logFile = fopen(logFilePath, "w");
|
g_logFile = fopen(logFilePath, "w");
|
||||||
if (g_logFile == NULL)
|
if (g_logFile == NULL)
|
||||||
{
|
{
|
||||||
printf("Failed to open logs file: %ld\n",
|
MessageBox(NULL, "Failed to open logs file", "Error", MB_OK | MB_ICONERROR);
|
||||||
GetLastError());
|
printf("Failed to open logs file: %ld\n", GetLastError());
|
||||||
ExitProcess(1);
|
ExitProcess(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print("rpc-bridge v%s %s-%s\n", VER_VERSION_STR, GIT_BRANCH, GIT_COMMIT);
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
HandleArguments(argc, argv);
|
HandleArguments(argc, argv);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user