tis-charlemagne-rhplanning icon

Charlemagne RHPlanning

Silent install package for Charlemagne RHPlanning

0.16.0.0-6

  • package: tis-charlemagne-rhplanning
  • name: Charlemagne RHPlanning
  • version: 0.16.0.0-6
  • categories: Education
  • maintainer: WAPT Team,Tranquil IT, Flavien Schelfaut
  • editor: Aplim
  • locale: all
  • target_os: windows
  • impacted_process: RHPlanning.exe
  • architecture: all
  • signature_date:
  • size: 39.31 Mo
  • homepage : https://www.aplim.fr
  • depends:

package           : tis-charlemagne-rhplanning
version           : 0.16.0.0-6
architecture      : all
section           : base
priority          : optional
name              : Charlemagne RHPlanning
categories        : Education
maintainer        : WAPT Team,Tranquil IT, Flavien Schelfaut
description       : Charlemagne RHPlanning
depends           : tis-charlemagne-outils
conflicts         : 
maturity          : PROD
locale            : all
target_os         : windows
min_wapt_version  : 2.1
sources           : https://api.ecoledirecte.com/v3/c/0/download/majcharlemagne.awp?verbe=get&chemin=MiseAJour\V2\&fichier=wRHPlanning.exe
installed_size    : 
impacted_process  : RHPlanning.exe
description_fr    : 
description_pl    : 
description_de    : 
description_es    : 
description_pt    : 
description_it    : 
description_nl    : 
description_ru    : 
audit_schedule    : 
editor            : Aplim
keywords          : 
licence           : 
homepage          : https://www.aplim.fr
package_uuid      : 8bdebb80-8aed-42fb-9437-7c80732cfc40
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 10.0
max_os_version    : 
icon_sha256sum    : a23d7a6937d8ea609e952dd8ffe40835c6b54e0472b3e581098c2c135fa0bd75
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-04-02T20:58:41.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         : MEc3SAY2mGeiuWCjgFxoJAwxLR2x/WUWOXON+mJiKDk66HED7QY0ypvlCp7E/SUFygkDI3wLQtqD+isVlk+2QA0mqvxbOCfGCFdwH5xbyoqqTbeyIsrW6BiCrl7/ePXeNV6mpgOCZ3hLluk3A8UijZXaBjipZr3fsKb8VDEoeBSFEB+1ABCkg6I1sF05NXuneCOkJVleiYbvFQrtX2fGCFiAa/XoYzhP40d6bAfhlo2+XBtY7ra0eDVS0xK/AsfrDQwCPNr0cfewerRNq7izBWQtJSftB6kZZ6wgRHbpBz6OOMH/QEK8Tc0CtnbmKBsxJiTuOch7qcN6hfEXi8uZLw==

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

# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls
bin_name = "charlemagne_rhplanning.exe"
silent_args = "/S"
desktop_shortcut_name = 'Charlemagne RH'
path_folder = makepath(programfiles32(),'alcuin')
bin_exe = makepath(path_folder, 'RHPlanning.exe') # Edit here the name of the executable

def install():
    
    # Initializing variables
    package_version = control.version.split("-")[0]
    
    # Installing the package
    print(f"Installing: {bin_name}")
    if force or not isfile(bin_exe) or Version(get_version_from_binary(bin_exe)) < Version(package_version):
        killalltasks(control.impacted_process)
        run(f"{makepath(basedir, bin_name)} {silent_args}")

    if not isfile(bin_exe): 
        error('error %s not found' % bin_exe) 

    bin_version = get_version_from_binary(bin_exe)
    if Version(bin_version) < Version(package_version):
        error('Version file for %s is %s' % (bin_exe,bin_version))
    
    remove_desktop_shortcut(desktop_shortcut_name)

def uninstall():
    remove_desktop_shortcut(desktop_shortcut_name)
    remove_file(bin_exe)

def audit():
    
    if not isfile(bin_exe):
        print(f"The executable can't be found here : {bin_exe}")
        return "ERROR"

    bin_version = get_version_from_binary(bin_exe)
    package_version = control.version.split("-")[0]

    if Version(bin_version) < Version(package_version):
        print('Version file for %s is %s' % (bin_exe,bin_version))
        return "ERROR"        

    if Version(bin_version) > Version(package_version):
        print('Version file for %s is %s' % (bin_exe,bin_version))
        return "WARNING"

    print("The installation has been done correctly")
    return "OK"

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

url_dl = "https://api.ecoledirecte.com/v3/c/0/download/majcharlemagne.awp?verbe=get&chemin=MiseAJour\V2\&fichier=wRHPlanning.exe"
latest_bin = 'charlemagne_rhplanning.exe'

def update_package():

    def contains_letters(chaine):
         return any(c.isalpha() for c in chaine)

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

    print(f"Download url is: {url_dl}")

    if isfile(latest_bin):
        remove_file(latest_bin)

    print("Downloading: " + latest_bin)
    wget(url_dl, latest_bin, proxies=proxies)

    expected_issuer = 'Aplim'
    sign_name = waptlicences.check_exe_signing_certificate(latest_bin)[0]
    if sign_name != expected_issuer:
        error(f'Bad issuer {sign_name} != {expected_issuer} ')
    
    version = get_version_from_binary(latest_bin)

    print(f"Latest {app_name} version is: {version}")
        
    # Before Aplim set up a bad naming scheme for its applications (Ex: 21.B , 9.2A ...)
    # so we check if this is not the case
    if contains_letters(version):
        print("For the moment, this application cannot be packaged due to incorrect version naming...")
        return package_updated

    for f in glob.glob('*.exe'):
        if Version(get_version_from_binary(f)) < Version(version):
            remove_file(f)

    # 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})")
        package_updated = True
    else:
        print(f"Software version up-to-date ({version})")
        
    control.set_software_version(get_version_from_binary(latest_bin))
    control.save_control_to_wapt()

    # Validating or not update-package-sources
    return package_updated

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
5ff6adc04d2451e22a25d0ac7523255186e46c268ef18a52876d5af833307050 : WAPT/control
a23d7a6937d8ea609e952dd8ffe40835c6b54e0472b3e581098c2c135fa0bd75 : WAPT/icon.png
d92712c20dbd038f34712189ce2ed45b39a505f0f51e8079d5b561b64a15b7d2 : charlemagne_rhplanning.exe
f996605d8c181dd6aa763a1dee980989782b0b9b5ab9c363a616f81c54d146e6 : luti.json
fa7c6fdc9b55704c699a081df36d85288ac13c549993a706b60f4f0113376433 : setup.py
7eae241587a139d27ae0874b1ccf7911afdc7af897cf0885c3af457201dadb2d : update_package.py