Commit 0db34f31 by Csók Tamás

client: HKCU instead of HKLM and error corrections

parent 5c10fbda
......@@ -211,7 +211,7 @@ SectionGroup /e '!$(NAME_Install)'
;Initialize Running Directory
ClearErrors
ReadRegStr $running_directory HKLM "Software\${Company} ${AppName}" "running_directory"
ReadRegStr $running_directory HKCU "Software\${Company} ${AppName}" "running_directory"
${If} ${Errors}
StrCpy $running_directory ${DefaulLocation}
ClearErrors
......@@ -219,7 +219,7 @@ SectionGroup /e '!$(NAME_Install)'
;Store installation folder
WriteRegStr HKLM "Software\${Company} ${AppName}" "install_directory" $INSTDIR
WriteRegStr HKLM "Software\${Company} ${AppName}" "running_directory" $running_directory
WriteRegStr HKCU "Software\${Company} ${AppName}" "running_directory" $running_directory
;Create uninstaller
WriteUninstaller "$INSTDIR\${AppUninstaller}"
......@@ -861,7 +861,7 @@ FunctionEnd
;Uninstaller Section
Section "Uninstall"
ClearErrors
ReadRegStr $running_directory HKLM "Software\${Company} ${AppName}" "running_directory"
ReadRegStr $running_directory HKCU "Software\${Company} ${AppName}" "running_directory"
${If} ${Errors}
StrCpy $running_directory ${DefaulLocation}
ClearErrors
......
......@@ -37,7 +37,7 @@ def parse_arguments():
"""
parser = argparse.ArgumentParser()
parser.add_argument(
"uri", type=str, help="Specific schema handler", nargs='?',
"uri", type=unicode, help="Specific schema handler", nargs='?',
default=None)
parser.add_argument(
"-l", "--loglevel",
......@@ -47,7 +47,7 @@ def parse_arguments():
parser.add_argument(
"-f", "--logfile",
help="Explicit location of the wanted logfile location and name",
type=str,
type=unicode,
default=("%(directory)s\\%(file)s" % {
'directory': ClientRegistry.directory(),
'file': 'client.log'}))
......@@ -70,10 +70,17 @@ def main():
try:
if args.uri is not None:
logger.info('Received the following URI: %s', args.uri)
vm = Struct()
x, vm.protocol, vm.user, vm.password, vm.host, vm.port = \
args.uri.split(':', 5)
logger.info(("Received the following URI: %(handler)s:"
"%(protocol)s:%(user)s:password:%(host)s:%(port)s" % {
'handler': x,
'protocol': vm.protocol,
'user': vm.user,
'host': vm.host,
'port': vm.port
}))
vm.protocol = vm.protocol.upper()
logger.debug("The Client split it followingly: protocol -> %s | "
"user -> %s | password -> %s | "
......
......@@ -31,9 +31,9 @@ def connect(vm):
vm.password -- Password used for the connection
"""
logger = logging.getLogger()
logger.info('Connect methods started')
logger.debug('Connect methods started')
if vm.protocol == "SSH":
logger.debug('SSH protocol received')
logger.info('SSH protocol received')
arguments = ("-ssh -P %(port)s -pw %(password)s"
" %(user)s@%(host)s" % {
'port': vm.port,
......@@ -41,13 +41,13 @@ def connect(vm):
'user': vm.user,
'host': vm.host})
directory = os.path.dirname(os.path.abspath(__file__))
logger.debug('Popen: "%s\\putty.exe"', directory)
logger.info('Determined arguments: %s', arguments)
logger.info('Popen: "%s\\putty.exe"', directory)
logger.debug('Determined arguments: %s', arguments)
subprocess.Popen('"%(path)s\\putty.exe" %(arguments)s' % {
'path': directory,
'arguments': arguments}, shell=True)
elif vm.protocol == "NX":
logger.debug('NX protocol received')
logger.info('NX protocol received')
listdir = os.path.expanduser("~\\.nx\\config\\*.nxs")
found = False
server = "\"Server host\" value=\"%s\"" % vm.host
......@@ -73,7 +73,7 @@ def connect(vm):
logger.debug('Popen the config file: %s', config_file)
subprocess.Popen('"%s"' % config_file, shell=True)
elif vm.protocol == "RDP":
logger.debug('NX protocol received')
logger.info('RDP protocol received')
listdir = ClientRegistry.directory() + "\\.rdp\\*.rdp"
found = False
full_address = "full address:s:%s:%s" % (vm.host, vm.port)
......
......@@ -38,7 +38,7 @@ def parse_arguments():
local_default = os.environ['APPDATA'] + "\\CIRCLE\\"
parser.add_argument(
"-l", "--location", help="Location of the client files in the system",
default=local_default, required=False)
type=unicode, default=local_default, required=False)
parser.add_argument(
"-r", "--remove",
help="Remove installed files instead of creating them",
......@@ -50,7 +50,7 @@ def parse_arguments():
parser.add_argument(
"-t", "--target",
help="If this is an URL icon, where should it point",
default="https://cloud.bme.hu/", required=False)
type=unicode, default="https://cloud.bme.hu/", required=False)
args = parser.parse_args()
return args
......
......@@ -57,7 +57,9 @@ class Struct:
class ClientRegistry:
@staticmethod
def directory():
handler = RegistryHandler()
custom_param = Struct()
custom_param.registry = "HKCU"
handler = RegistryHandler(custom_param)
directory = None
try:
directory = handler.get_key_value(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment