Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
client
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0db34f31
authored
Jun 25, 2015
by
Csók Tamás
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
client: HKCU instead of HKLM and error corrections
parent
5c10fbda
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
15 deletions
+24
-15
src/nsi/cloud.nsi
+3
-3
src/nsi/installer/cloud.py
+10
-3
src/nsi/installer/cloud_connect_from_windows.py
+6
-6
src/nsi/installer/win_install.py
+2
-2
src/nsi/installer/windowsclasses.py
+3
-1
No files found.
src/nsi/cloud.nsi
View file @
0db34f31
...
...
@@ -211,7 +211,7 @@ SectionGroup /e '!$(NAME_Install)'
;Initialize Running Directory
ClearErrors
ReadRegStr $running_directory HK
LM
"Software\${Company} ${AppName}" "running_directory"
ReadRegStr $running_directory HK
CU
"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 HK
LM
"Software\${Company} ${AppName}" "running_directory" $running_directory
WriteRegStr HK
CU
"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 HK
LM
"Software\${Company} ${AppName}" "running_directory"
ReadRegStr $running_directory HK
CU
"Software\${Company} ${AppName}" "running_directory"
${If} ${Errors}
StrCpy $running_directory ${DefaulLocation}
ClearErrors
...
...
src/nsi/installer/cloud.py
View file @
0db34f31
...
...
@@ -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 | "
...
...
src/nsi/installer/cloud_connect_from_windows.py
View file @
0db34f31
...
...
@@ -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
)
...
...
src/nsi/installer/win_install.py
View file @
0db34f31
...
...
@@ -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
...
...
src/nsi/installer/windowsclasses.py
View file @
0db34f31
...
...
@@ -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
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment