|
|
|
@ -5,25 +5,22 @@ import json |
|
|
|
|
|
|
|
|
|
uninstallkey = [] |
|
|
|
|
|
|
|
|
|
print('Reading variables') |
|
|
|
|
key = open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read() |
|
|
|
|
f = Fernet(key) |
|
|
|
|
variables = json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read())) |
|
|
|
|
if not 'fusinv_server' in variables: |
|
|
|
|
error('Missing fusinv_server variable') |
|
|
|
|
variables = { |
|
|
|
|
'fusinv_servers': [ 'https://glpi.lan.local/plugins/fusioninventory' ] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
# Read local variables file if available |
|
|
|
|
if isfile(makepath(programfiles32,'wapt','private','symetric.txt')) and isfile(makepath(programfiles32,'wapt','private','variables.txt')): |
|
|
|
|
print('Reading local encrypted variables file') |
|
|
|
|
f = Fernet(open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read()) |
|
|
|
|
variables = json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read())) |
|
|
|
|
|
|
|
|
|
def install(): |
|
|
|
|
print('Reading variables') |
|
|
|
|
key = open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read() |
|
|
|
|
f = Fernet(key) |
|
|
|
|
variables = json.loads(f.decrypt(open(makepath(programfiles32,'wapt','private','variables.txt'),'r').read())) |
|
|
|
|
if not 'fusinv_server' in variables: |
|
|
|
|
error('Missing fusinv_server variable') |
|
|
|
|
parameters = '/S /acceptlicense /server="%s" /execmode=service /runnow' % (variables['fusinv_server']) |
|
|
|
|
parameters = '/S /acceptlicense /server="%s" /execmode=service /runnow' % (','.join(variables['fusinv_servers'])) |
|
|
|
|
if 'fusinv_user' in variables and 'fusinv_pass' in variables: |
|
|
|
|
parameters = parameters + ' /user="%s" /password="%s"' % (variables['fusinv_user'],variables['fusinv_pass']) |
|
|
|
|
|
|
|
|
|
print('installing Fusion inventory agent') |
|
|
|
|
print('Installing FusionInventory Agent') |
|
|
|
|
versionpaquet = control['version'].split('-',1)[0] |
|
|
|
|
if iswin64(): |
|
|
|
|
install_exe_if_needed("fusioninventory-agent_windows-x64_%s.exe" % versionpaquet,parameters,key='FusionInventory-Agent',min_version=versionpaquet) |
|
|
|
|