Small patch proposed

Developers may discuss here.

Small patch proposed

Postby Peter2121 » 2020-04-24 09:18

Hello,
Playing with winvnc.exe, I noticed that in case of starting winvnc.exe with -install argument (to install the service) it ignores -inifile argument, so it is impossible to install the service with a custom path of ini file. Hopefully, the fix is trivial, so I propose the following patch to include in a future release:
Code: Select all
--- service_motor.cpp.orig   2020-03-13 10:23:51.952582000 +0100
+++ service_motor.cpp   2020-04-24 10:46:24.331245000 +0200
@@ -334,7 +334,13 @@

     strcpy_s(service_path, "\"");
     strcat_s(service_path, exe_file_name);
-   strcat_s(service_path, "\" -service");
+   strcat_s(service_path, "\"");
+   if (g_szIniFile)
+   {
+      strcat_s(service_path, " -inifile ");
+      strcat_s(service_path, g_szIniFile);
+   }
+   strcat_s(service_path, " -service");
   return 0;
}
////////////////////////////////////////////////////////////////////////////////

There are two limitations though:
1. No spaces in ini file path (escaping does not work)
2. service_commandline option with -inifile argument must be present in ini file himself
Peter2121
 
Posts: 1
Joined: 2020-04-24 08:55

Re: Small patch proposed

Postby Neustradamus » 2020-08-04 07:33

@Rudi De Vos: have you seen?
Neustradamus
20
20
 
Posts: 45
Joined: 2011-03-26 20:22

Re: Small patch proposed

Postby Neustradamus » 2020-09-26 01:42

@Peter2121: UltraVNC is now on GitHub, can you create a PR?
- https://github.com/ultravnc/ultravnc
Neustradamus
20
20
 
Posts: 45
Joined: 2011-03-26 20:22


Return to Developer discussions (mainly user-mode)

Who is online

Users browsing this forum: No registered users and 1 guest