tis-fusioninventory 2.4.1-4

  • package : tis-fusioninventory
  • version : 2.4.1-4
  • description : FusionInventory is a software for inventory computers.
  • maintainer : Kevin Guerineau
  • date : 2018-07-05 11:14:10

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

[["WAPT/icon.png", "fba3af4f79be43de12a5f9438a98831edc7a08c5761e5f216eb9d9ca5d98b3ff"], ["WAPT/certificate.crt", "13fb474c5c23c135a77aba592eb8821b9ecbcc463f5b7312312b87b20eac6779"], ["WAPT/wapt.psproj", "df3e2fa87fea9c7bdfcc22039b9ef7303f092898882d9f3f4233f5d92f90b3c7"], ["fusioninventory-agent_windows-x64_2.4.1.exe", "546a2e25bce5c5615dc32723be86effd464372801681bb644f4235e575598f77"], ["fusioninventory-agent_windows-x86_2.4.1.exe", "10987785b43496ee057aa1af57ec04e97b87962a23103835e79328652ce7ce4a"], ["setup.py", "da76b3165e310e45e660c22f3a12cab6e7fdcbcce8a8d64e885f057d016c9e10"], ["WAPT/control", "55b50a2b6fbef1c5bfb383ade22a87b2dabd151b410811561c5ccf1f62b37308"]]