tis-fusioninventory 2.4-1

  • package : tis-fusioninventory
  • version : 2.4-1
  • description : FusionInventory is a software for inventory computers.
  • maintainer : Kevin Guerineau
  • date : 2018-03-12 18:18:49

setup.py

# -*- coding: utf-8 -*-
from setuphelpers import *

uninstallkey = []


serveur = "http://glpi/glpi/plugins/fusioninventory/"

parameters = '/S /acceptlicense /server="%s" /execmode=service /no-ssl-check /runnow' % (serveur)

key='FusionInventory-Agent'

def install():

    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('a',{'class':'css-truncate'}).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()


    

Changelog

No changelog
    

manifest.sha256

[["fusioninventory-agent_windows-x86_2.4.exe", "91796158da18bc53b11154ca9ac409b6915f9a7052caef5d671702ad2516ed32"], ["WAPT/icon.png", "fba3af4f79be43de12a5f9438a98831edc7a08c5761e5f216eb9d9ca5d98b3ff"], ["WAPT/certificate.crt", "79e5388683c0b6cb03f4f81e4e58e3a11463b2b6cf169dd9c453098027dcfaa4"], ["WAPT/wapt.psproj", "79adab7ad1d3821b05c9d018c5c1a8949b4400aa9ddb54bfb62d829484739d1a"], ["fusioninventory-agent_windows-x64_2.4.exe", "9a823580df4dd0cffa20d14c6266f1d05aeea789a4102f4026f98028912b49de"], ["setup.py", "da76b3165e310e45e660c22f3a12cab6e7fdcbcce8a8d64e885f057d016c9e10"], ["WAPT/control", "7277d2721a534871880fd5580462d109c203e3e1e58610a354f2b27ce29a7f12"]]