parent
02f5c2209d
commit
78d725386a
4 changed files with 408 additions and 0 deletions
@ -0,0 +1,33 @@ |
||||
package : fws-fusioninventory |
||||
version : 2.4.2 |
||||
architecture : all |
||||
section : base |
||||
priority : optional |
||||
maintainer : Kevin Guerineau |
||||
description : FusionInventory is a software for inventory computers. |
||||
depends : |
||||
conflicts : |
||||
maturity : |
||||
locale : all |
||||
target_os : windows |
||||
min_os_version : 5.0 |
||||
max_os_version : |
||||
min_wapt_version : 1.3.12 |
||||
sources : |
||||
installed_size : |
||||
impacted_process : |
||||
description_fr : FusionInventory est un logiciel d'inventaire d'ordinateurs |
||||
description_pl : |
||||
description_de : |
||||
description_es : |
||||
audit_schedule : |
||||
editor : |
||||
keywords : |
||||
licence : |
||||
homepage : |
||||
package_uuid : 8151a535-59a4-4951-bb82-c3f7c98644f5 |
||||
signer : Daniel Berteaud |
||||
signer_fingerprint: 3c9415559e2dedbc4390e3faa2c28d3b67265baa5b35902d2764d9e41c3b3f0a |
||||
signature : S189A65mxvE2N/PLheSzz8Hm431rKfUPe7FCUaeybLGeq8R1Z8z6rhgHMm5KU0wdckeAC6lgKsnhQY6rEvedxE7GPtoC3LOLmdUkzj7rjB7rVOObyafJaobjTgJRlDIirK4YBg6/sebuv0SDcBU+IrPt7SRlHjb+q2+S0KlagPsKpFLGBgnXZQZzX0M7t25twZP64S7Zqw0qRjojy3BFdUizvOB47ZwMHZqdGdDnFrIsDHrDcIYsKl/0Cf91Fj0KPTl12F6EhMRllTxoAQOevgP+uEh2gZ78Oq+uEv/IWywTQlp4MIiX16KLjaXerFUjNPjwHwWQgmLDQUUENAfECg== |
||||
signature_date : 20181123-101110 |
||||
signed_attributes : package,version,architecture,section,priority,maintainer,description,depends,conflicts,maturity,locale,target_os,min_os_version,max_os_version,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,audit_schedule,editor,keywords,licence,homepage,package_uuid,signer,signer_fingerprint,signature_date,signed_attributes |
After Width: | Height: | Size: 2.3 KiB |
@ -0,0 +1,80 @@ |
||||
# -*- coding: utf-8 -*- |
||||
from setuphelpers import * |
||||
|
||||
uninstallkey = [] |
||||
|
||||
key='FusionInventory-Agent' |
||||
|
||||
def install(): |
||||
print('Opening variable file') |
||||
variables = json.loads(open(makepath(programfiles32,'wapt','variables.json'),'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) |
||||
else: |
||||
install_exe_if_needed("fusioninventory-agent_windows-x86_%s.exe" % versionpaquet,parameters,key=key,min_version=versionpaquet) |
||||
|
||||
|
||||
|
||||
def update_package(): |
||||
import BeautifulSoup,requests,re |
||||
|
||||
from waptpackage import PackageEntry |
||||
verify=True |
||||
pe = PackageEntry() |
||||
pe.load_control_from_wapt(os.getcwd()) |
||||
current_version = pe['version'].split('-',1)[0] |
||||
verify=True |
||||
|
||||
url = 'https://github.com/fusioninventory/fusioninventory-agent/releases' |
||||
|
||||
import requests,BeautifulSoup |
||||
page = requests.get(url + '/latest',headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'},verify=verify).text |
||||
bs = BeautifulSoup.BeautifulSoup(page) |
||||
|
||||
bs_raw_string = str(bs.find('span',{'class':'css-truncate-target'}).text) |
||||
|
||||
version = bs_raw_string |
||||
|
||||
url64 = url + "/download/" + version + "/fusioninventory-agent_windows-x64_%s.exe" % version |
||||
url86 = url + "/download/" + version + "/fusioninventory-agent_windows-x86_%s.exe" % version |
||||
|
||||
filenamex86 = "fusioninventory-agent_windows-x86_%s.exe" % version |
||||
filenamex64 = "fusioninventory-agent_windows-x64_%s.exe" % version |
||||
|
||||
if not isfile( filenamex64 ) : |
||||
wget( url64 ) |
||||
if not isfile( filenamex86 ) : |
||||
wget( url86 ) |
||||
|
||||
|
||||
for fileexe in glob.glob('fusioninventory-agent_windows-x64*.exe'): |
||||
if fileexe != filenamex64 : |
||||
print('Delete ' + fileexe) |
||||
remove_file(fileexe) |
||||
|
||||
for fileexe in glob.glob('fusioninventory-agent_windows-x86*.exe'): |
||||
if fileexe != filenamex86 : |
||||
print('Delete ' + fileexe) |
||||
remove_file(fileexe) |
||||
|
||||
if not isfile(filenamex64): |
||||
print('Download ' + url64) |
||||
wget(url64,filenamex64) |
||||
|
||||
if not isfile(filenamex86): |
||||
print('Download ' + url86) |
||||
wget(url86,filenamex86) |
||||
|
||||
|
||||
if __name__ == '__main__': |
||||
update_package() |
||||
|
Loading…
Reference in new issue