tis-freemind

1.0.1-7
FreeMind can create mind maps or map of ideas (mind map in English). These are diagrams that help organize ideas
2952 downloads
Download
See build result See VirusTotal scan
tis-freemind icon
  • package : tis-freemind
  • name : Freemind
  • version : 1.0.1-7
  • categories : Office
  • maintainer : WAPT Team,Tranquil IT,Jimmy PELÉ,Simon Fonteneau
  • installed_size : 41877504
  • editor : Joerg Mueller,Daniel Polansky,Petr Novak,Christian Foltin et.al.
  • licence : GPLv2
  • signature_date : 2022-01-11T04:06:41.108034
  • size : 37.67 Mo
  • locale :
  • target_os : windows
  • impacted_process : FreeMind
  • architecture : all
  • Homepage : http://freemind.sourceforge.net/wiki/index.php/Main_Page
  • Depends :
package           : tis-freemind
version           : 1.0.1-7
architecture      : all
section           : base
priority          : optional
name              : Freemind
categories        : Office
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ,Simon Fonteneau
description       : FreeMind can create mind maps or map of ideas (mind map in English). These are diagrams that help organize ideas
depends           : tis-java8
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 1.8
sources           : https://sourceforge.net/projects/freemind
installed_size    : 41877504
impacted_process  : FreeMind
description_fr    : FreeMind peut créer des cartes mentales ou une carte d’idées (carte en anglais). Ce sont des diagrammes qui aident à organiser les idées
description_pl    : FreeMind może tworzyć mapy myśli lub mapę pomysłów (mapa myśli w języku angielskim). Są to diagramy, które pomagają organizować pomysły
description_de    : FreeMind kann Mind Maps oder Map of Ideas (Mind Map auf Englisch) erstellen. Dies sind Diagramme, die beim Organisieren von Ideen helfen
description_es    : FreeMind puede crear mapas mentales o mapas de ideas (mapa mental en inglés). Estos son diagramas que ayudan a organizar ideas.
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : Joerg Mueller,Daniel Polansky,Petr Novak,Christian Foltin et.al.
keywords          : 
licence           : GPLv2
homepage          : http://freemind.sourceforge.net/wiki/index.php/Main_Page
package_uuid      : 679eb4e4-9000-4464-aa87-e3c4a371ee1b
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 5fdcae4fa3551a9b43a9c301a5d32f82bc99dbbc36294c82fbbd71eb15b8c357
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature         : wPcViZXB6XQQ26/PwPwsotvibnd1BQmPOCn6kF27FIiw1QTqqE7z6hh4JKVUgol+bqAbGdn+/FR9+3twhldu37MZH70KglElj0ZB9at2V0uDePbB9usDkQg3Rm4tawyduwm+avAixPTo8cILGdtHL7MyhctpdXu8O84gM2hSafFOi3yUAmKvXuiefd49RonqmzVbOfpufY+NCMDdWzhvKOaXAlV2n/yjqVRqsFd1uBg6ujRqURXOYUBbvzH9BULHFMJi3Asy3lEmaNphid8coFyYyU14zE9AhnPlNJPdly9PI2ems2F4n0acq2xfLPFLe0zriZLHfHFfB2DMeh8VgQ==
signature_date    : 2022-01-11T04:06:41.108034
signed_attributes : package,version,architecture,section,priority,name,categories,maintainer,description,depends,conflicts,maturity,locale,target_os,min_wapt_version,sources,installed_size,impacted_process,description_fr,description_pl,description_de,description_es,description_pt,description_it,description_nl,description_ru,audit_schedule,editor,keywords,licence,homepage,package_uuid,valid_from,valid_until,forced_install_on,changelog,min_os_version,max_os_version,icon_sha256sum,signer,signer_fingerprint,signature_date,signed_attributes
# -*- coding: utf-8 -*-
from setuphelpers import *
import platform
import json

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
bin_contains = "FreeMind-Windows-Installer-"
silentflags = "/VERYSILENT"
app_uninstallkey = "B991B020-2968-11D8-AF23-444553540000_is1"


def install():
    # Declaring local variables
    package_version = control.get_software_version()
    bin_name = glob.glob("*%s*.exe" % bin_contains)[0]

    # Installing the software
    print("Installing: %s" % bin_name)
    install_exe_if_needed(
        bin_name,
        silentflags=silentflags,
        key=app_uninstallkey,
        min_version=package_version,
    )


def update_package():
    # Declaring local variables
    result = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name
    api_url = "https://sourceforge.net/projects/freemind/best_release.json"

    # Getting latest version information from official sources
    print("API used is: %s" % api_url)
    json_load = json.loads(wgets(api_url, proxies=proxies, timeout=10))
    for download in json_load["platform_releases"]:
        if "-max-java-installer-embedded.exe" in json_load["platform_releases"][download]["filename"]:
            download_url = json_load["platform_releases"][download]["url"].replace("-max-java-installer-embedded.exe", "-max.exe")
            version = json_load["platform_releases"][download]["filename"].split("/")[-2]
            latest_bin = json_load["platform_releases"][download]["filename"].split("/")[-1].replace("-max-java-installer-embedded.exe", "-max.exe")
            break

    print("Latest %s version is: %s" % (app_name, version))
    print("Download URL is: %s" % download_url)

    # Downloading latest binaries
    if not isfile(latest_bin):
        print("Downloading: %s" % latest_bin)
        wget(download_url, latest_bin, proxies=proxies, connect_timeout=20, download_timeout=20)

        # Checking version from file
        version_from_file = get_version_from_binary(latest_bin)
        # if not version_from_file.startswith(version) and version_from_file != '':
        if Version(version_from_file) != Version(version) and version_from_file != "":
            print("Changing version to the version number of the binary (from: %s to: %s)" % (version, version_from_file))
            os.rename(latest_bin, bin_contains + version_from_file + "-max.exe")
            version = version_from_file
        else:
            print("Binary file version corresponds to online version")

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print("Software version updated (from: %s to: %s)" % (control.get_software_version(), Version(version)))
        result = True
    else:
        print("Software version up-to-date (%s)" % Version(version))
    control.version = "%s-%s" % (Version(version), control.version.split("-", 1)[-1])
    # control.set_software_version(version)
    control.save_control_to_wapt()

    # Deleting outdated binaries
    remove_outdated_binaries(version)

    # Validating update-package-sources
    return result


def get_proxies():
    r"""Return system proxy with the urllib python library

    >>> get_proxies()
    {'http': 'http://srvproxy.ad.domain.lan:8080',
    'https': 'http://srvproxy.ad.domain.lan:8080'}

    """
    if platform.python_version_tuple()[0] == "3":
        from urllib.request import getproxies
    else:
        from urllib import getproxies
    return getproxies()


def get_proxies_from_wapt_console():
    r"""Return proxy information from the current user WAPT console

    >>> get_proxies_from_wapt_console()
    {'http': 'http://srvproxy.ad.domain.lan:8080',
    'https': 'http://srvproxy.ad.domain.lan:8080'}

    """
    proxies = {}
    if platform.system() == "Windows":
        waptconsole_ini_path = makepath(user_local_appdata(), "waptconsole", "waptconsole.ini")
    else:
        waptconsole_ini_path = makepath(user_home_directory(), ".config", "waptconsole", "waptconsole.ini")
    if isfile(waptconsole_ini_path):
        proxy_wapt = inifile_readstring(waptconsole_ini_path, "global", "http_proxy")
        if proxy_wapt:
            proxies = {"http": proxy_wapt, "https": proxy_wapt}
    return proxies


def get_version_from_binary(filename, property_name="ProductVersion"):
    r"""Get installer version from file informations, for now, only exe and msi files are compatibles

    Args:
        filename (str): path to the file
        property_name (str): selected property

    Returns:
        str: version number

    """
    if filename.endswith(".msi"):
        return get_msi_properties(filename)[property_name]
    else:
        return get_file_properties(filename)[property_name]


def remove_outdated_binaries(version, filename_contains=None, list_extensions=["exe", "msi", "deb", "rpm", "dmg", "pkg"]):
    r"""Remove files based on the version contained in his filename

    Args:
        version (str): version number of keeped files
        filename_contains (str or list of str): Part of the filename that must be contained (useful for distinguishing architecture and os)
        list_extensions (str or list of str): file extensions of verified files

    Returns:
        None

    .. versionadded:: 2.0

    """
    if type(list_extensions) != list:
        list_extensions = [list_extensions]
    if filename_contains:
        if type(filename_contains) != list:
            filename_contains = [filename_contains]
    list_extensions = ["." + ext for ext in list_extensions if ext[0] != "."]
    for file_ext in list_extensions:
        for bin_in_dir in glob.glob("*%s" % file_ext):
            if not version in bin_in_dir:
                remove_file(bin_in_dir)
            if filename_contains:
                for filename_contain in filename_contains:
                    if not filename_contain in bin_in_dir:
                        remove_file(bin_in_dir)
08901b83aa3966e3c427a6b4883b08fc019c7ad99fe98a6e1e82f887b4c68a79 : setup.py
4b9c70d118803fbc80d0269caa2809e1842d7d5a155da6df7eefdbf0b511bd12 : FreeMind-Windows-Installer-1.0.1-max.exe
5fdcae4fa3551a9b43a9c301a5d32f82bc99dbbc36294c82fbbd71eb15b8c357 : WAPT/icon.png
a5a97261381e1d0ad46ee15916abec9c2631d0201f5cc50ceb0197a165a0bbbf : WAPT/certificate.crt
23cec3009a73fda87d2961dc1c856c2f1b3de53124f90d95ea41c0c8a3335550 : luti.json
91cd5a636aa49241aea1dcdc5222247d9d46566d0161404a4d3cfc79cc6d2149 : WAPT/control