tis-jan icon

Jan

Paquet d’installation silencieuse pour Jan

0.5.15-4

  • package: tis-jan
  • name: Jan
  • version: 0.5.15-4
  • categories: Utilities
  • maintainer: WAPT Team,Tranquil IT,Jimmy PELÉ
  • target_os: windows
  • impacted_process: Jan.exe
  • architecture: x64
  • signature_date:
  • size: 1.22 Go
  • installed_size: 2.89 Go
  • depends:

package           : tis-jan
version           : 0.5.15-4
architecture      : x64
section           : base
priority          : optional
name              : Jan
categories        : Utilities
maintainer        : WAPT Team,Tranquil IT,Jimmy PELÉ
description       : Jan - Bring AI to your Desktop
depends           : tis-7zip
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 2.4
sources           : 
installed_size    : 2888863744
impacted_process  : Jan.exe
description_fr    : Jan - L'IA sur votre bureau
description_pl    : Jan - Przenieś sztuczną inteligencję na swój pulpit
description_de    : Jan - Bringen Sie AI auf Ihren Desktop
description_es    : Jan - Lleve la IA a su escritorio
description_pt    : Jan - Traga a IA para o seu ambiente de trabalho
description_it    : Jan - Porta l'intelligenza artificiale sul tuo desktop
description_nl    : Jan - Breng AI naar je desktop
description_ru    : Jan - Привнесите искусственный интеллект на рабочий стол
audit_schedule    : 
editor            : 
keywords          : 
licence           : 
homepage          : 
package_uuid      : 29cf9a01-cb8e-4a50-89b2-436ace8025ca
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 5f9aa2aaa342d6a7468a65ff28ae30917eb3c88ee0e9cf27734175d5dc0a73ce
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-02-19T08:17:28.000000
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
signature         : lJoipdvGoYQbZ5fak7t7Jrd0cnkIhnsaBtOfXtAWKaHSX4LsYR9K1qQyvBCMkRzM66zVygzSIhBM2+52JsHM853wzruLy81jSKztOZSMizl6VOCRYeuKOxZvBcc0lnD3W9DAsrbocqiEVKFL1N1lPknkTE1/uaqqBueUUDqMI6p7Z1Gn8kRBbpQTs86yZNfjHPhjTkbRM80qqbVg5OFkE9+6bDYOL5GD3XlCKODTPWo8koDuV3f5WaVEF3eFDInK/OWlyGLA9ZpsklkwXcNCdqgTMlqt2Cy/5+1ebdcBHvK3kQY3pkUztcGqv+fYtT9ksoRkNfBDKyMkLdz1QTA63g==

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

app_name = "Jan"
app_dir = makepath(programfiles64, "Jan")
app_path = makepath(programfiles64, "Jan", "Jan.exe")

def get_installed_version(app_path):
    return get_file_properties(app_path).get("FileVersion", "")

def install():
    bin_name = glob.glob("Jan-win-x64-*.exe")[0]
    bin_path = makepath(basedir, "Jan")
    unzip_with_7zip(bin_name, "Jan")
    unzip_with_7zip(makepath(bin_path,"$PLUGINSDIR", "app-64.7z"), app_dir)
    remove_tree(bin_path)

    create_desktop_shortcut(app_name, target=app_path)
    create_programs_menu_shortcut(app_name, target=app_path)

def session_setup():
    jan_dir_path_user = makepath(user_appdata, "Jan")
    jan_config_path_user = makepath(jan_dir_path_user, "config.json")

    current_conf = {}
    if isfile(jan_config_path_user):
        current_conf = json_load_file(jan_config_path_user)
    
    current_conf["migrated_version"] = control.get_software_version()

    if not isdir(jan_dir_path_user):
        mkdirs(jan_dir_path_user)
        
    json_write_file(jan_config_path_user, current_conf)

def audit():
    # Auditing software
    audit_status = "OK"
    installed_version = get_installed_version(app_path)
    if Version(installed_version) < Version(control.get_software_version()) and audit_version:
        print("%s is installed in version (%s) instead of (%s)" % (app_name, installed_version, control.get_software_version()))
        audit_status = "WARNING"
    elif isdir(app_dir) and not dir_is_empty(app_dir):
        print("%s (%s) is installed" % (app_name, installed_version))
        audit_status = "OK"
    else:
        print("%s is not installed" % app_name)
        audit_status = "ERROR"
    return audit_status

def uninstall():
    # Uninstalling software
    killalltasks(ensure_list(control.impacted_process))
    if isdir(app_dir):
        remove_tree(app_dir)

    # Removing shortcuts
    remove_desktop_shortcut(app_name)
    remove_programs_menu_shortcut(app_name)

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


def update_package():
    # Declaring local variables
    package_updated = False
    proxies = get_proxies()
    if not proxies:
        proxies = get_proxies_from_wapt_console()
    app_name = control.name

    api_url = "https://api.github.com/repos/janhq/jan/releases/latest"

    # Getting latest version information from official sources
    print("API used is: %s" % api_url)
    json_load = wgets(api_url, proxies=proxies, as_json=True)
    version = json_load["tag_name"].replace("v", "")

    update_dict = {
        "windows-x64": f"jan-win-x64-{version}.exe",
    }

    os_type = control.target_os + "-" + ensure_list(control.architecture)[0]

    for to_download in json_load["assets"]:
        if to_download["name"] == update_dict[os_type]:
            download_url = to_download["browser_download_url"]
            latest_bin = to_download["name"]
            latest_bin_extension = latest_bin.rsplit('.', 1)[-1]
            break

    # Downloading latest binaries
    print(f"Latest {app_name} version is: {version}")
    print(f"Download URL is: {download_url}")
    if not isfile(latest_bin):
        print(f"Downloading: {latest_bin}")
        wget(download_url, latest_bin, proxies=proxies)
    else:
        print(f"Binary is present: {latest_bin}")

    expected_issuer = "Homebrew Computer Company Pte. Ltd."
    sign_name = waptlicences.check_msi_signature(latest_bin)[0]
    if sign_name != expected_issuer:
        error(f'Bad issuer {sign_name} != {expected_issuer} ')

    # Changing version of the package
    if Version(version) > Version(control.get_software_version()):
        print(f"Software version updated (from: {control.get_software_version()} to: {Version(version)})")
        package_updated = True
    else:
        print(f"Software version up-to-date ({Version(version)})")

    for f in glob.glob(f'*.{latest_bin_extension}'):
        if f != latest_bin:
            remove_file(f)

    control.set_software_version(version)
    control.save_control_to_wapt()

    return package_updated

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
ee3e5c8dfb06f5b9682cfa2742be1bc8efae9629b2787942d798b4b9874ecd76 : WAPT/control
5f9aa2aaa342d6a7468a65ff28ae30917eb3c88ee0e9cf27734175d5dc0a73ce : WAPT/icon.png
4b81833a3aacc6b6c587b49c96eb1c51e08d40562fa893019959828dc99425df : jan-win-x64-0.5.15.exe
32880075da0e20bedb020f03c36b599891695d68b4bad74ef44a92a090bac565 : luti.json
61bf8e7b32da4f4919b5a04b115fb06acd473e98a3273189eebc4df173715867 : setup.py
1cbfcedd40e88cfc5ba1ae092df936ec4337a43df7caebefc3eac97c2e966cb1 : update_package.py