davidpryke / gitso

Automatically exported from code.google.com/p/gitso
0 stars 0 forks source link

Windows 7 (UAC) Issues #72

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Connect to a Windows 7 box
2. Do something that requires UAC
3. Get disconnected

What is the expected output? What do you see instead?
It shouldn't disconnect every time a UAC prompt comes up, but it does.

What version of the product are you using? On what operating system?
Both ends are running latest version (0.6) in Windows 7 64 bit

Please provide any additional information below.

Original issue reported on code.google.com by webmas...@metmayhem.com on 12 Jan 2011 at 12:54

GoogleCodeExporter commented 9 years ago

Original comment by gerbe...@gmail.com on 12 Jan 2011 at 1:33

GoogleCodeExporter commented 9 years ago
I've fixed this by including TightVNC 2.0 and adding 'uac_info': 
"requireAdministrator" to setup.py like described: 

http://stackoverflow.com/questions/195109/running-compiled-python-py2exe-as-admi
nistrator-in-vista/1445547#1445547

You still have to have the remote user click allow as you can't see or controll 
that dialog, but your connection stays. 

I changed the line in Processes.py to:
subprocess.Popen(['tvnserver.exe', '-controlapp','-connect', '%s' % host])

This does however add the problem that the desktop background isn't restored on 
stop. 

Original comment by toddejoh...@gmail.com on 6 Apr 2011 at 2:01

GoogleCodeExporter commented 9 years ago
I'm not a python (or any other) developer, but I've managed to get rid of the 
dialog by adding this code into processes.py right after "elif sys.platform == 
"win32" in the function 'getSupport' (I know - absolutely no error handling.... 
:-) :

import platform
wver = platform.version()
if wver > '5.2':
    import _winreg
    x = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
    y = _winreg.OpenKey(x, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", 0, _winreg.KEY_ALL_ACCESS)
    _winreg.SetValueEx(y, "ConsentPromptBehaviorAdmin", 0, _winreg.REG_DWORD, 0)
    _winreg.CloseKey(y)
    _winreg.CloseKey(x)

and in the KillPID definiton I'm resetting the registry key to its defaults:
if sys.platform == 'win32':
import platform
wver = platform.version()
    if wver > '5.2':
    #re-enable UAC Messages on exit
    import _winreg
    x = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
    y = _winreg.OpenKey(x, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", 0, _winreg.KEY_ALL_ACCESS)
    _winreg.SetValueEx(y, "ConsentPromptBehaviorAdmin", 0, _winreg.REG_DWORD, 2)
    _winreg.CloseKey(y)
    _winreg.CloseKey(x)

this registry key will disable/re-enable the popup message each time UAC is 
called...

so far it seems to work quiet well. the only condition is: the user has to run 
gitso as an administrator.

Original comment by godzilla...@gmail.com on 27 Sep 2013 at 1:10