[SOLVED] Version issue

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
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

October 20, 2019 - 8:30 PM

WAPT 1.7.4.6165 Enterprise
- Debian 9.9

Good morning,

I'm working on a package that will install the BIOS.

I'm conducting an audit:

Code: Select all

Bios = registry_readstring(HKEY_LOCAL_MACHINE, r'HARDWARE\\DESCRIPTION\\System\BIOS','BIOSVersion')
System = registry_readstring(HKEY_LOCAL_MACHINE, r'HARdWARE\\DESCRIPTION\\System\BIOS','SystemProductName')
VerBIOS = '1.12.1'

def audit():
    if Bios < VerBIOS and System == "VMware Virtual Platform":
        print ('BIOS a mettre a jour ')
        return 'WARNING'
    if Bios > VerBIOS and System == "VMware Virtual Platform":
        print ('Version du package obsoléte, Package à mettre à jour')
        return 'WARNING'
    if Bios == VerBIOS and System == "VMware Virtual Platform":
        print ('Version du BIOS a Jour')
        return 'OK'
    if System != "VMware Virtual Platform":
        print ('Pas le bon systeme')
        raise EWaptSetupException('Fatal error : %s' %  (''.join("Pas le bon systeme ")))
I am experiencing a problem on a machine; the current BIOS version is 1.6.5.

The new version is 1.12.1

During my audit, the result is the 2nd if statement when it should be the 1st.

After checking in the console when I sort the BIOS versions in ascending order, 1.6.5 is greater than 1.12.1.

I wanted to know how to correct the problem and understand why 1.6.5 is greater than 1.12.1

I thought about adding a 0 in front of the 6 which would work but that would mean changing a lot of posts because it's not the only model to have this problem.
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

October 20, 2019 - 11:22 PM

Hi Mathieu,

when you compare versions you need to use the Version class.

Example:

https://www.wapt.fr/fr/doc/wapt-create- ... g-software
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

October 23, 2019 - 9:28 PM

Thank you

, I spent hours on something so simple ^^

I learn something new every day
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
User avatar
vcardon
WAPT Expert
Messages: 278
Registration: Oct 06, 2017 - 10:55 p.m.
Location: Nantes, France

October 23, 2019 - 9:58 PM

Mathieu wrote: Oct 23, 2019 - 9:28 PM Thank you

, I spent hours on something so simple ^^

I learn something new every day
Hi Matthieu

Futuroscope has a packaging contract (... I think because I don't have the management tools at hand), call the office, get answers quickly and then take part of the time you saved to disseminate what you learned with the list, your gain in experience deserves to be shared if it is not confidential.

Those with contracts are those who, a priori, will want to save time and gain certainty. This is the core of Tranquil IT's business model.

A++

VC
Vincent CARDON
Tranquil IT
User avatar
Mathieu
Messages: 91
Registration: August 18, 2016 - 10:24

October 24, 2019 - 12:15

Yeah, I don't usually think about it, but I'm the type to search and try things out, and if I get really stuck, I'll look into it.


Also, if there's a place to post creations, no problem, I can share them.
- WAPT 2.2.3.12463 Enterprise
- Debian 9.9
- Windows 10 21H2 & Windows 11 22h2
Locked