[RESOLVED] Package for EdrawMax

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

December 13, 2024 - 1:25 PM

Good morning,

I made a package for the Wondershare EdrawMax software, with update_package() working.

I saw that you had a package for EdrawMind but apparently you are retrieving the installer from your repository (license issues?).


setup.py:

Code: Select all

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

def install():
    appver = control.get_software_version()
    appname = control.name
    install_exe_if_needed(r'edrawmax_%s.exe' % appver, silentflags=r'/VERYSILENT /NORESTART /ACCEPTEULA', min_version=appver, name=appname)
    remove_desktop_shortcut(appname)

def session_setup():
    appname = control.name
    remove_user_desktop_shortcut(appname)
    
def update_package():
    appver = control.get_software_version()
    url = control.sources
    for col in bs_find_all(url, "div", "class", "m-3"):
        if "EdrawMax for Windows" in col.text:
            for release in bs_find_all(col, "div", "class", "font-size-small"):
                if "what's new" in release.text:
                    latest_version = release.text.strip().split("(")[0]
                    break
            for release_link in bs_find_all(col, "div", "class"):
                if "Have trouble" in release_link.text:
                    latest_release_link = bs_find(release_link, "a", "href")
                    if latest_release_link["href"].endswith(".exe"):
                        if r"64bit" in latest_release_link["href"]:
                            latest_url = latest_release_link["href"]
                            break
        if latest_version and latest_url:
            break

    if not latest_version:
        error(r'Error fetching latest version from website !')
    elif not latest_url:
        error(r'Error fetching latest download link from website !')
    else:
        print(r'Latest version : %s' % latest_version)
        print(r'Latest url : %s' % latest_url)

    if Version(latest_version, 3) > Version(appver, 3):
        installer = r'edrawmax_latest.exe'
        installer_version = r'edrawmax_%s.exe'
        wget(latest_url, installer)
        # Get full version from binary
        bin_version = get_version_from_binary(installer)
        if Version(bin_version, 3) != Version(latest_version, 3):
            error(r'Error : binary version and website version are not the same !')
        else:
            # Renaming installer with full version
            os.rename(installer, installer_version % bin_version)
            # Changing version of the package
            control.version = '%s-%s'%(bin_version, control.version.split('-')[-1])
            control.save_control_to_wapt()
            print('Changing version to: %s in WAPT\\control' % control.version)
            remove_outdated_binaries(bin_version)
    else:
        print("Already up to date")
control:

Code: Select all

package           : xxx-edrawmax
version           : 14.1.0.1212-5
architecture      : x64
section           : base
priority          : optional
name              : Wondershare EdrawMax
categories        : Utilities
maintainer        : XXXX
description       : Edraw Max est un logiciel de diagramme d'affaires et technique en 2D qui aide à créer des diagrammes de flux, des organigrammes, des cartes mentales, des diagrammes de réseau, des plans d'étage, des diagrammes de flux de travail, des graphiques d'affaires et des diagrammes d'ingénierie
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 
sources           : https://www.edrawsoft.com/download-edrawmax.html
installed_size    : 
impacted_process  : EdrawMax,EdrawMaxTray
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : EdrawSoft Co.,Ltd.
keywords          : 
licence           : proprietary_restricted
homepage          : https://edrawmax.wondershare.com/
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://www.edrawsoft.com/whats-new/edrawmax.html
min_os_version    : 
max_os_version    : 
italbot
Messages: 61
Registration: Sep 26, 2023 - 3:50 p.m.

December 17, 2024 - 2:29 PM

Hello,

Thank you for sharing and good catch on the EdrawMind package; I've just modified the update_package() function for that package.

Best regards,

Ingrid
Tranquil IT
Locked