Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Letting UVNC use the registry without presence of ini file?

Post Reply
AnotherUVNCuser
40
40
Posts: 68
Joined: 2017-09-13 00:40

Letting UVNC use the registry without presence of ini file?

Post by AnotherUVNCuser »

Hi everyone,

Is there a way to let UltraVNC *only* use the Windows registry without the presence of UltraVNC.ini?

I'm sure the ini file has its advantages (for portability reasons) but it would be a nice addition if UVNC used the registry if no UltraVNC.ini is present.


I'm looking forward to hearing from you! :-)

edit:I noticed that a lot of WINVNC's options aren't present in the GUI, nor are they written to the registry.
Does this mean that many of the supported extra settings are only accessible via the .ini file and there's (currently) no way to add them to the registry?

Best regards,
AnotherUVNCuser
Last edited by AnotherUVNCuser on 2017-09-18 17:41, edited 3 times in total.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Letting UVNC use the registry without presence of ini fi

Post by Rudi De Vos »

You can try to enable the registry in the ini file...there is still an option... use registry. "UseRegistry=0"
winvnc start, find UseRegistry=0 and try to read the rest from the registry.

The registry is a hell.
When you start winvnc as application he use the HKCU, as service HKLM
The passwd set as user X is not valid for user Y and when you forget to set if for the service no passwd is set and winvnc fail to start.
Running as service... the popup telling you that the password is empty is covered by the logon screen. We got 100x mails with passwd not working.
AnotherUVNCuser
40
40
Posts: 68
Joined: 2017-09-13 00:40

Re: Letting UVNC use the registry without presence of ini fi

Post by AnotherUVNCuser »

Rudi De Vos wrote:You can try to enable the registry in the ini file...there is still an option... use registry. "UseRegistry=0"
winvnc start, find UseRegistry=0 and try to read the rest from the registry.

The registry is a hell.
When you start winvnc as application he use the HKCU, as service HKLM
The passwd set as user X is not valid for user Y and when you forget to set if for the service no passwd is set and winvnc fail to start.
Running as service... the popup telling you that the password is empty is covered by the logon screen. We got 100x mails with passwd not working.
I know about UseRegistry setting, i found everything here. I just wondered if there's a way to not rely on the .ini file (i.e. not needing the .ini file) and only use the registry.
But i understand where you're coming from when saying the registry being 'hell', but wouldn't using HKEY_CURRENT_USER or specially created user subkeys be a possible solution to that?

Also, many of the available settings aren't even written to the registry (ConnectPriority, to name one), so i guess i'm out off options and am pretty much depended on using the .ini file.


Thank you Rudi for your time answering (all of) my question(s).

/AnotherUVNCuser
Last edited by AnotherUVNCuser on 2017-09-18 22:27, edited 1 time in total.
AnotherUVNCuser
40
40
Posts: 68
Joined: 2017-09-13 00:40

Re: Letting UVNC use the registry without presence of ini fi

Post by AnotherUVNCuser »

I had to split the post because it became too long/messy.

The following appears to be a long standing problem it seems (running as service with UseRegistry 'hell' option enabled :wink: ):


Image

Manually importing the values to HKEY_LOCAL_MACHINE\SOFTWARE\ORL\WinVNC3\Default also doesn't seem to make the difference:

Image

This looks like a user(access) permission type of problem, which i find strange.

Would it make a difference if i ran WINVNC with administrator privileges? Or is this a special (unsolvable) case?



Best regards,
AnotherUVNCuser
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Letting UVNC use the registry without presence of ini fi

Post by Rudi De Vos »

An administartor with UAC enabled is not an elevated administrator unless you start the app with "runas admin".
open a notepad as admin and just try to edit the ultravnc.ini ( in program files) -> permission denied
start notepad with runas admin -> write access
same for HKLM

As admin start winvnc.exe with runas admin to get full access.

A service always run with elevated permission...
AnotherUVNCuser
40
40
Posts: 68
Joined: 2017-09-13 00:40

Re: Letting UVNC use the registry without presence of ini fi

Post by AnotherUVNCuser »

Rudi De Vos wrote:An administartor with UAC enabled is not an elevated administrator unless you start the app with "runas admin".
open a notepad as admin and just try to edit the ultravnc.ini ( in program files) -> permission denied
start notepad with runas admin -> write access
same for HKLM

As admin start winvnc.exe with runas admin to get full access.

A service always run with elevated permission...
I happen to know how UAC works but i never faced any problems like this with other VNC solutions that i use(d) as service, that's why it surpsrised me :wink:

Besides that i was starting the service from an elevated Windows prompt.


Atleast you've confirmed what i was thinking but not believing to be the culprit :mrgreen:
AnotherUVNCuser
40
40
Posts: 68
Joined: 2017-09-13 00:40

Re: Letting UVNC use the registry without presence of ini fi

Post by AnotherUVNCuser »

Perhaps its me not getting it but how can i manage to see/change the Admin properties of a winvnc service, if i can only start the winvnc service from an elevated windows prompt or via the Windows services menu?

Right clicking the exe and "run as Administrator" starts winvnc in application mode and starting the Windows service uvnc_service also doesn't make the winvnc systray/taskbar icon appear.

The only setting i have configured is UseRegistry=1
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Letting UVNC use the registry without presence of ini fi

Post by Rudi De Vos »

A long time ago i used it myself.

What are you trying to do, i need to test it myself before i can answer.
AnotherUVNCuser
40
40
Posts: 68
Joined: 2017-09-13 00:40

Re: Letting UVNC use the registry without presence of ini fi

Post by AnotherUVNCuser »

The problem is that i'm unable to get to UVNC's Admin properties window when UVNC is running as service and using the registry (UseRegistry=1).
It always throws those errors and there seems no way around it (as if something is broken in UVNC's functionality).

I also never experienced this with other VNC programs i've used in the past. They all worked without issues when running them as service <-> registry.

Using .ini file is easy and more friendly of course but the reason i choose the registry is so that users won't be able to mess up the .ini settings as the registry is a bit 'harder' to navigate (i also prefer the registry because the disadvantages don't really apply for me).


Because i've tried everything to solve the permission error i start to believe something's broken with UVNC's registry functionality, which is a shame (if i knew the exact cause and were able to reproduce and code, i would've commited a fix for it).


Best regards :wink:
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Letting UVNC use the registry without presence of ini fi

Post by Rudi De Vos »

Let see if i find something this evening... possible it just block because some parameters are required to startup.

Users can not temper with the ini settings.
Default it install in program files, only domain and local admins have write access.
If you install winvnc in a custom folder, you can give write access with the standrd MS security file properties.
Yes it's readable but that's the registry tio..
AnotherUVNCuser
40
40
Posts: 68
Joined: 2017-09-13 00:40

Re: Letting UVNC use the registry without presence of ini fi

Post by AnotherUVNCuser »

Thank you for looking into it Rudi :thumbs:

Perhaps this is also useful to know:

When using the registry with winvnc in application mode, there are no problems.
It only happens with service mode.


Am i correct that i won't have access to network shares/drives when using the filetransfer manager in application mode (due to the lack of user impersonation)?


Best regards.

edit: If you manage to find something, can you please add registry support for DisableTrayIcon and Image? These (and some other values) appear to be missing for the registry.
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Letting UVNC use the registry without presence of ini fi

Post by Rudi De Vos »

shares:
The service [v]impersonate the desktop user -> shares OK, We takeover the permissions of the desktop user
The service [_]impersonate -> full local admin access ( independed of the desktop user, no user share access)
Application
You don't need to impersonate, the app run as the desktop user and has access to that users mapped drives.

Remark: in some cases the service does not have permission to impersonate the desktop user.
Suppose you logon as domain admin. Now the service ( local admin) try to impersonate the domain admin.
Impersonation -> Fail
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Letting UVNC use the registry without presence of ini fi

Post by Rudi De Vos »

The registry is a no go.
In the newer windows versions the service is isloated from the rest of the apps. A desktop app can not longer communicate direct
with the service. Registry code is still based on the old method and that fail to give you access.

This require code changes...
AnotherUVNCuser
40
40
Posts: 68
Joined: 2017-09-13 00:40

Re: Letting UVNC use the registry without presence of ini fi

Post by AnotherUVNCuser »

I fully understand Rudi, it requires too much of your time and patience.


Now i only have to find a solution for the uVNC viewer crashing when there's multiple incoming connections in a row.
The viewer (and its tray icon menu) sometimes becomes unresponsive for some seconds while loading the screens but this is something i can live with.

The crashing however is a pain in the .....

But i'm probably better off by creating a new topic for it (sigh :wink: )


Best regards!
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Letting UVNC use the registry without presence of ini fi

Post by Rudi De Vos »

If you are able to give me a "repeatable" method to crash something it's usual solved fast.

I need to able to crash in debug. If that not works, we need to make special builds that generate a dump for analyse
and let you create the dump...
AnotherUVNCuser
40
40
Posts: 68
Joined: 2017-09-13 00:40

Re: Letting UVNC use the registry without presence of ini fi

Post by AnotherUVNCuser »

For me, the viewer always crashes after a few seconds (only tested x64 for now).

crashloop.cmd

Code: Select all

@ECHO OFF

:LOOP
winvnc.exe -connect 192.168.0.226

PING -n 2 127.0.0.1>NUL

goto LOOP
(replace 192.168.0.226 with your own local IP)


winvnc service (changed) settings

Code: Select all

[Permissions]
[admin]
DisableTrayIcon=1
AuthRequired=0
ConnectPriority=1
AllowShutdown=0
AllowProperties=0
AllowEditClients=0
BlankMonitorEnabled=0
SocketConnect=0
HTTPConnect=0
QuerySetting=1
QueryTimeout=0
QueryAccept=1
QueryIfNoLogon=0

listen_viewer.cmd

Code: Select all

@vncviewer.exe -listen -viewonly -shared -autoacceptincoming -disablesponsor -autoscaling -nocursor -normalcursor -nocursorshape -disableclipboard -noauto -encoding tight -8bit -loglevel 10 -logfile vncviewer.log"
vncviewer crash .log (loglevel 10)

Code: Select all

Started and Winsock (v 2) initialised
In listening mode - staring daemons
Adding tray icon
bufsize expanded to 4352
Registered connection with app
Saving to C:\Users\Admin\Desktop\_\v\options.vnc
DSMPlugin not enabled
RFB server supports protocol version 3.8
Connected to RFB server, using protocol version 3.8
No authentication needed
Read a 107-byte string
Desktop name "desktop-jrk3f3i ( 10.0.151.241, 169.254.59.255, 192.168.91.1, 192.168.130.1, 192.168.0.226 ) - service mode "
Geometry 2560 x 1440 depth 32
Screen work area is 2560 x 1400
Reset keyboard for first use
Flush dead key gives: 1 character(s): 0x0020 ( )
Requesting 8-bit truecolour
Clipboard changed
Ignore Clipboard while initializing!
No next window in chain; WM_DRAWCLIPBOARD will not be passed
SetClipboardViewer to 0x000f03e0; next is 0x000b035e. Last error 0x00000000Screen work area is 2560 x 1400
Update-processing thread started
Screen work area is 2560 x 1400
Screen work area is 2560 x 1400
ServerState- reading 11 bytes
ServerState (2, 5)
New keepalive interval 5ServerState- reading 11 bytes
ServerState (3, 0)
New IdleTiler interval 0Read remote clipboard change
Read remote extended clipboard change
bufsize expanded to 10029
zlibbufsize expanded to 65792
bufsize expanded to 11079
bufsize expanded to 12668
zlibbufsize expanded to 397444
bufsize expanded to 14679
bufsize expanded to 82176
bufsize expanded to 4352
Registered connection with app
Saving to C:\Users\Admin\Desktop\_\v\options.vnc
DSMPlugin not enabled
RFB server supports protocol version 3.8
Connected to RFB server, using protocol version 3.8
No authentication needed
Read a 107-byte string
Desktop name "desktop-jrk3f3i ( 10.0.151.241, 169.254.59.255, 192.168.91.1, 192.168.130.1, 192.168.0.226 ) - service mode "
Geometry 2560 x 1440 depth 32
Screen work area is 2560 x 1400
Reset keyboard for first use
Flush dead key gives: 1 character(s): 0x0020 ( )
Requesting 8-bit truecolour
Clipboard changed
Ignore Clipboard while initializing!
No next window in chain; WM_DRAWCLIPBOARD will not be passed
SetClipboardViewer to 0x00250d34; next is 0x000f03e0. Last error 0x00000000Screen work area is 2560 x 1400
Update-processing thread started
Screen work area is 2560 x 1400
Screen work area is 2560 x 1400
ServerState- reading 11 bytes
ServerState (2, 5)
New keepalive interval 5ServerState- reading 11 bytes
ServerState (3, 0)
New IdleTiler interval 0Read remote clipboard change
Read remote extended clipboard change
bufsize expanded to 5321
zlibbufsize expanded to 65792
bufsize expanded to 5898
bufsize expanded to 12912
bufsize expanded to 15537
zlibbufsize expanded to 397444
bufsize expanded to 82176
If you want you may move this post to a new topic (or just tell me to delete/create a new one).
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Letting UVNC use the registry without presence of ini fi

Post by Rudi De Vos »

vncviewer.exe -listen -viewonly -shared -autoacceptincoming -disablesponsor -autoscaling -nocursor -normalcursor -nocursorshape -disableclipboard -noauto -encoding tight -8bit -loglevel 10 -logfile vncviewer.log
Viewer close, i don't get a crash, but internal error close the viewer

Started to play with the options...

looks like tight 8bit is causing it

-noauto -encoding zrle -8bit OK
-noauto -encoding tight -8bit FAIL

I also test it with a 5 second delay to be able to debug something.
If a faster connect is causing issue' i Always can add a min time between 2 connections.

Code: Select all

:LOOP
winvnc.exe -connect localhost
rem PING -n 2 127.0.0.1
timeout /t 5
goto LOOP
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Letting UVNC use the registry without presence of ini fi

Post by Rudi De Vos »

looks like the jpeg lib crash
a pure jpeg encoder also crash
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6832
Joined: 2004-04-23 10:21
Contact:

Re: Letting UVNC use the registry without presence of ini fi

Post by Rudi De Vos »

Found, some jpeg stuff was declared global.... not Multi thread.

http://www.uvnc.eu/download/1216/vncviewerTEST1WIN8.zip
AnotherUVNCuser
40
40
Posts: 68
Joined: 2017-09-13 00:40

Re: Letting UVNC use the registry without presence of ini fi

Post by AnotherUVNCuser »

Rudi De Vos wrote:Found, some jpeg stuff was declared global.... not Multi thread.

http://www.uvnc.eu/download/1216/vncviewerTEST1WIN8.zip
Thanks! It doesn't crash anymore :-) I only don't know if the .exe is 32- or 64-bit (haven't looked for a PE or PE+ header yet).
Rudi De Vos wrote:I also test it with a 5 second delay to be able to debug something.
If a faster connect is causing issue' i Always can add a min time between 2 connections.
A minute delay is not needed anymore, i tested the fix and even with 1 second of delay it didn't crash :thumbs:
(however, you always could add a config option to set the delay time between connections 8) )
Post Reply