Update package to read encrypted variables

master
Daniel Berteaud 6 years ago
parent 2938075df3
commit 6887868621
  1. 2
      WAPT/control
  2. BIN
      fusioninventory-agent_windows-x64_2.4.2.exe
  3. BIN
      fusioninventory-agent_windows-x86_2.4.2.exe
  4. 16
      setup.py

@ -1,5 +1,5 @@
package : fws-fusioninventory
version : 2.4.2
version : 2.4.2-3
architecture : all
section : base
priority : optional

@ -1,28 +1,27 @@
# -*- coding: utf-8 -*-
from setuphelpers import *
from cryptography.fernet import Fernet
import json
uninstallkey = []
key='FusionInventory-Agent'
def install():
print('Opening variable file')
variables = json.loads(open(makepath(programfiles32,'wapt','variables.json'),'r').read())
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'])
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')
versionpaquet = control['version'].split('-',1)[0]
if iswin64():
install_exe_if_needed("fusioninventory-agent_windows-x64_%s.exe" % versionpaquet,parameters,key=key,min_version=versionpaquet)
install_exe_if_needed("fusioninventory-agent_windows-x64_%s.exe" % versionpaquet,parameters,key='FusionInventory-Agent',min_version=versionpaquet)
else:
install_exe_if_needed("fusioninventory-agent_windows-x86_%s.exe" % versionpaquet,parameters,key=key,min_version=versionpaquet)
install_exe_if_needed("fusioninventory-agent_windows-x86_%s.exe" % versionpaquet,parameters,key='FusionInventory-Agent',min_version=versionpaquet)
def update_package():
@ -75,7 +74,6 @@ def update_package():
print('Download ' + url86)
wget(url86,filenamex86)
if __name__ == '__main__':
update_package()

Loading…
Cancel
Save