[SOLVED] MacOS package for Figma

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 8, 2024 - 4:51 PM

Good morning,

Here is my package for the Figma software under MacOS.
The update-package is almost identical to the Windows version, and it is x64/arm compatible:

Code: Select all

# -*- coding: utf-8 -*-
from setuphelpers import *
from setupdevhelpers import *
from pathlib import Path
import glob

def install():
    # Initializing variables
    package_version = control.version.split("-")[0]

    # Installing the package
    bin_name= glob.glob('%s*.pkg' % r'Figma')[0]
    install_pkg(bin_name, min_version=package_version, killbefore=r'Figma')

def uninstall():
    # Remove all Figma pkg
    killalltasks(r'Figma')
    all_figma_pkgs = run(r'pkgutil --pkgs | grep -i com.figma').rstrip().split('\n')
    for pkg in all_figma_pkgs:
        uninstall_pkg(pkg)
    
    # Remove app leftovers after pkg was removed
    uninstall_app(r'Figma.app')

def update_package():
    package_updated = False
    proxies = get_proxies_from_wapt_console()
    if not proxies:
        proxies = get_proxies()

    # Récupérer les données depuis l'URL et décoder en tant que chaîne de caractères
    sitewebdata = wgets('https://desktop.figma.com/mac-universal/releases.xml').decode('utf-8')

    # Recherche des liens .pkg dans les données
    for u in sitewebdata.split('.pkg'):
        lnk = u.split('https://')[-1]
        fullnk = 'https://' + lnk + '.pkg'
        break

    url_download = fullnk.split('/')[-1]
    latest_bin = url_download.split("/")[-1]
    
    # remove old pkg
    for f in glob.glob("*.pkg"):
        if f != latest_bin:
            remove_file(f)
    
    if not isfile(latest_bin):
        package_updated = True
        wget(fullnk, latest_bin, proxies=proxies)
    else:
        print(r'Already up to date !')
    
    if package_updated:
        last_version = Path(latest_bin).stem.split("-")[-1]
        control.set_software_version(last_version)
        control.save_control_to_wapt()

    # Validating update-package-sources
    return package_updated
If it's possible for it to be adopted for the TIS store, that would be nice too :D
Thanks in advance.
fschelfaut
Messages: 30
Registration: Nov 7, 2024 - 12:22

November 12, 2024 - 11:56

Hello,

the Figma macOS package has been added to the store!
It will appear on the public store in 5 days.

Otherwise, you can get it from the PREPROD here

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

November 12, 2024 - 12:00

Hello,

thank you so much! :D
Locked