[RESOLVED] Package for MediaInfo

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
bastien30
Messages: 38
Registration: March 8, 2024 - 3:21 PM

November 26, 2024 - 2:09 PM

Good morning,

Here is a package I made for the MediaInfo software (https://mediaarea.net/fr/MediaInfo), compatible with 32/64-bit:

Code: Select all

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

def install():
    appver = control.get_software_version()
    install_exe_if_needed(glob.glob("MediaInfo_GUI*.exe")[0],
        silentflags='/S',
        key='MediaInfo',
        min_version=appver
    )

def update_package():
    appver = control.get_software_version()
    url = r'https://mediaarea.net/fr/MediaInfo/Download/Windows'

    for releases in bs_find_all(url, r'a'):
        if not r'Universal (32/64 bit)' in releases.text :
            continue
        else:
            url_dl = r'https:%s' % releases[r'href']
            break
    latest_bin = url_dl.split(r'/')[-1]
    latest_version = url_dl.split(r'/')[-1].split(r'_')[-2]
    print(r'Latest version is %s' % latest_version)

    if Version(latest_version) > Version(appver):
        print(r'Downloading latest binary %s ...' % latest_bin)
        wget(url_dl, latest_bin)
        # Changing version of the package
        control.version = '%s-%s'%(latest_version, control.version.split('-')[-1])
        control.save_control_to_wapt()
        print('Changing version to: %s in WAPT\\control' % control.version)
        remove_outdated_binaries(latest_version)
    else:
        print("Already up to date")
If it can be of use to others :D
fschelfaut
Messages: 30
Registration: Nov 7, 2024 - 12:22

November 28, 2024 - 1:46 PM

Hello,

thank you so much for sharing the code! My colleague Ingrid took care of the package, and we added it on our end.

It will be available on the official store in 5 days. In the meantime, you can find it on the testing repository here

, Flavien.
bastien30
Messages: 38
Registration: March 8, 2024 - 3:21 PM

November 28, 2024 - 2:01 PM

Awesome, thank you! :D
Locked