Page 1 of 1

[RESOLVED] Package for MediaInfo

Published: November 26, 2024 - 2:09 PM
by bastien30
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

Re: [RESOLVED] Package for MediaInfo

Published: November 28, 2024 - 1:46 PM
by fschelfaut
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.

Re: [RESOLVED] Package for MediaInfo

Published: November 28, 2024 - 2:01 PM
by bastien30
Awesome, thank you! :D