[SOLVED] Package for ChatGPT (MacOS)

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

September 4, 2025 - 12:00

Good morning,

I made a package for the ChatGPT desktop client for MacOS, with update_package() working.

Note: according to their website, the DMG is compatible with ARM processors only.

For Windows, the application is available in the store, so you just need to use the dedicated template package: https://wapt.tranquil.it/store/fr/tis-t ... -store-app

setup.py:

Code: Select all

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

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

    # Installing the package
    bin_name= glob.glob('%s*.dmg' % app_name)[0]
    install_dmg(bin_name, key="/Applications/%s.app" % app_name, min_version=package_version)

def update_package():
    app_name = control.name
    bin_name = r'%s.dmg' % app_name
    dl_url = r'%s/%s' % (control.sources, bin_name)
    plist_file_name = r'Info.plist'

    # Downloading and extracting to compare version
    if isfile(bin_name):
        remove_file(bin_name)
    wget(dl_url, bin_name)

    if isfile(plist_file_name):
        remove_file(plist_file_name)
    unzip_with_7zip(bin_name, target=basedir, filenames=["%s Installer/%s.app/Contents/Info.plist" % (app_name, app_name)], extract_with_full_paths=False, recursive=False)
    
    plist_file = get_plist_obj(plist_file_name)
    latest_version = plist_file[r'CFBundleShortVersionString']
    print(r'Latest %s version is %s' % (app_name, latest_version))
    remove_file(plist_file_name)

    if Version(latest_version) > Version(control.get_software_version()):
        print(r'Latest %s version is %s' % (app_name, latest_version))
        # Changing version of the package
        control.version = '%s-%s' % (latest_version, control.version.split('-', 1)[-1])
        control.save_control_to_wapt()
        print('Changing version to: %s in WAPT\\control' % control.version)
    else:
        print(r'Already up to date !')

def get_plist_obj(plist_file):
    """ Returns a plist obj when given the path to a plist file. """

    with open(plist_file, 'rb') as fp :
        plist_obj = plistlib.load(fp)
    return plist_obj
control:

Code: Select all

package           : xxx-chatgpt
version           : 1.2025.231-2
architecture      : arm
section           : base
priority          : optional
name              : ChatGPT
categories        : Utilities
maintainer        : XXXX
description       : ChatGPT Officiel Desktop Client
depends           : 
conflicts         : 
maturity          : PROD
locale            : all
target_os         : darwin
min_wapt_version  : 2.0
sources           : https://persistent.oaistatic.com/sidekick/public/
installed_size    : 
impacted_process  : chatgpt
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : OpenAI
keywords          : 
licence           : proprietary_free,wapt_public
homepage          : https://chatgpt.com
package_uuid      :
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : https://help.openai.com/en/articles/9703738-chatgpt-macos-app-release-notes
min_os_version    : 
max_os_version    : 
Answer