Change service_name of uvnc server in service mode

Developers may discuss here.

Change service_name of uvnc server in service mode

Postby Thohoj » 2016-06-30 08:26

Hi,

I need to change the service name when registering the uvnc as a windows service.

I've found this in the changelog (http://www.uvnc.com/general/whatsnew.html):
- You can now register the service with a custom name.


But I cannot find any option to do this. Looking at the current code, the service_name variable seems not to be changed anywhere from "uvnc_service" in anything else. Am I missing something? Is it possible to change the service name (without prior installing it and then change it via editing the registry)?

Regards
Thorsten
Thohoj
 
Posts: 4
Joined: 2016-06-30 08:13

Re: Change service_name of uvnc server in service mode

Postby Thohoj » 2016-07-01 06:59

I found the solution in the source code:

winvnc.cpp / WinMain(...)
Code: Select all
            
// rest of command line service name, if provided.
char *pServiceName = &szCmdLine[i];
...
// if a service name is supplied, and it differs except in case from
// the default, use the supplied service name instead
if (*pServiceName && (_strcmpi(pServiceName, service_name) != 0))
{
  strncpy(service_name, pServiceName, 256);
  service_name[255] = 0;
}
...


One can choose an alternative service name by calling
Code: Select all
winvnc.exe -install <service_name>


"-install <service_name>" should be the last command line parameter.

But I could not get two instances of winvnc services running in parallel.
Thohoj
 
Posts: 4
Joined: 2016-06-30 08:13


Return to Developer discussions (mainly user-mode)

Who is online

Users browsing this forum: No registered users and 1 guest

cron