[SOLVED] Update-Upgrade package fusioninventory

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
maintenancevla
Messages: 18
Registration: March 21, 2018 - 2:30 PM

April 26, 2018 - 11:33

Hello


, I'm writing because I'm having some trouble upgrading my Fusion Inventory package.

I changed GLPI servers as a result, so I updated my Fusion Inventory package to version 2.4.5, but unfortunately, the update isn't working on the client machines. They're still on version 2.4.2, or worse, they show version 2.4.5 but with the error message: "

Installing Fusion Inventory agent.exe
setup fusioninventory-agent_windows-x64_2.4.exe already installed. Skipping".

What steps am I missing?

Thank you in advance.
- Installed WAPT version: 2.6.0.16795
- Server OS: Debian 11
- Administration/package creation machine OS: Windows Server 2019
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

April 26, 2018 - 4:25 PM

Hello,
could you please post the contents of your setup.py file?
I think either you haven't updated the uninstallation key or the version if the key is the same regardless of the version

.
Tranquil IT
maintenancevla
Messages: 18
Registration: March 21, 2018 - 2:30 PM

April 27, 2018 - 8:07 AM

Here, I even tested it with => min_version='2.4-3'.
For your information, it was also version 2.4 before, so now it's just URL modifications. GLPI server



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

uninstallkey = []


server = "http://XXX.XXX.XXX.XXX/plugins/fusioninventory/"

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

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" % packageversion,parameters,key=key,min_version='2.4-3')
else:
install_exe_if_needed("fusioninventory-agent_windows-x86_%s.exe" % packageversion,parameters,key=key,min_version=packageversion)




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/fusi ... t/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()
- Installed WAPT version: 2.6.0.16795
- Server OS: Debian 11
- Administration/package creation machine OS: Windows Server 2019
User avatar
htouvet
WAPT Expert
Messages: 436
Registration: March 16, 2015 - 10:48
Contact :

April 27, 2018 - 2:19 PM

In the min_version, I see '2.4-3' (with a hyphen... I think '2.4' (with a period) would be more correct).
The Fusion Inventory binary hasn't changed; it's still 2.4 from the publisher, so it's normal that WAPT doesn't reinstall it if it's already the correct version.
However, the parameters have changed, so you would need to:
* increment the package version (in the control file, change from .2.4-0 to 2.4-1, for example).
* force the reinstallation with the new parameters. The install_exe_if_needed function doesn't handle this; this function only checks the uninstallation key and the version registered in the registry, but doesn't remember the parameters used.
Tranquil IT
Locked