|
|
@ -5,25 +5,22 @@ import json |
|
|
|
|
|
|
|
|
|
|
|
uninstallkey = [] |
|
|
|
uninstallkey = [] |
|
|
|
|
|
|
|
|
|
|
|
print('Reading variables') |
|
|
|
variables = { |
|
|
|
key = open(makepath(programfiles32,'wapt','private','symetric.txt'),'r').read() |
|
|
|
'fusinv_servers': [ 'https://glpi.lan.local/plugins/fusioninventory' ] |
|
|
|
f = Fernet(key) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 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())) |
|
|
|
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') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def install(): |
|
|
|
def install(): |
|
|
|
print('Reading variables') |
|
|
|
parameters = '/S /acceptlicense /server="%s" /execmode=service /runnow' % (','.join(variables['fusinv_servers'])) |
|
|
|
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']) |
|
|
|
|
|
|
|
if 'fusinv_user' in variables and 'fusinv_pass' in variables: |
|
|
|
if 'fusinv_user' in variables and 'fusinv_pass' in variables: |
|
|
|
parameters = parameters + ' /user="%s" /password="%s"' % (variables['fusinv_user'],variables['fusinv_pass']) |
|
|
|
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] |
|
|
|
versionpaquet = control['version'].split('-',1)[0] |
|
|
|
if iswin64(): |
|
|
|
if iswin64(): |
|
|
|
install_exe_if_needed("fusioninventory-agent_windows-x64_%s.exe" % versionpaquet,parameters,key='FusionInventory-Agent',min_version=versionpaquet) |
|
|
|
install_exe_if_needed("fusioninventory-agent_windows-x64_%s.exe" % versionpaquet,parameters,key='FusionInventory-Agent',min_version=versionpaquet) |
|
|
|