tis-charlemagne-moteur icon

Charlemagne Moteur

Silent install package for Charlemagne Moteur

30.0-12
Education
Education

  • package: tis-charlemagne-moteur
  • name: Charlemagne Moteur
  • version: 30.0-12
  • categories: Education
  • maintainer: WAPT Team,Tranquil IT, Flavien Schelfaut
  • editor: Aplim
  • locale: all
  • target_os: windows
  • architecture: all
  • signature_date:
  • size: 316.60 Mo
  • homepage : https://www.aplim.fr

package           : tis-charlemagne-moteur
version           : 30.0-12
architecture      : all
section           : base
priority          : optional
name              : Charlemagne Moteur
categories        : Education
maintainer        : WAPT Team,Tranquil IT, Flavien Schelfaut
description       : Charlemagne Moteur
depends           : 
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=wMoteur.exe
installed_size    : 
impacted_process  : 
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      : 7390f566-2e46-47fb-8867-ad60e1d7682c
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 10.0
max_os_version    : 
icon_sha256sum    : 1a1cade259c2fa39e2bd34b839f32b0df2e4443ed74ae22996111b18339965e0
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-12-30T15:02:01.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         : nW5WDKZp4Uubom7Iy9vw92hjTM/EV48vT8gPsLBR3OuELa1RRIHpn48vqQYRZodEZUARdJJwD0tiCuZS+iIpIEdggVcap8qERLS0Dl3R3e2ZVstcYdOG5+C7uQMRPJP2ZplblEwcxVByt/C3qknSIgpTMmn7ekaqDmywrEOhSww8iCLxCsu4tyZJql44DeAA+mj/6K5jogAuVaUgEZa9DgcCyYY85FAdmbDuzemSHz7HBFr6zTnQoHlE1/WPnefMKSCn/AJO2A6peE5JL5jCsi1h1YBaX0THWEd5ooQ5BvxBIH2RkXWyPzWaQpBHrEdldeyrPDSYIGYuiZ7n+FKGbQ==

# -*- 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_moteur.exe"
silent_args = "/S"
desktop_shortcut_names = []
path_folder = makepath(programfiles32(),'alcuin')
all_path_bin_exe = [ # Edit here the name of the executable
    makepath(path_folder, 'Donnees.exe'),
    makepath(path_folder, 'WDModFic.exe'),
    makepath(path_folder, 'WDOptimizer.exe')
]

def is_binary_outdated(bin_path, control):
    return (
        Version(get_version_from_binary(bin_path), 2)
        < Version(control.get_software_version(), 2)
    )


def install():

    if force or is_binary_outdated(all_path_bin_exe[1], control):
        print(f"Installing: {bin_name}")
        run(f"{makepath(basedir, bin_name)} {silent_args}")

    if is_binary_outdated(all_path_bin_exe[1], control):
        error(f'Version not updated to {control.get_software_version()}!')

    # Allow user to delete shortcut / or remove the shortcut
    for desktop_shortcut_name in desktop_shortcut_names:
        file_path = rf"{makepath(common_desktop(), desktop_shortcut_name)}.lnk"
        # run_powershell(rf"icacls '{file_path}' /grant '*S-1-5-32-545:(RX,DE)'") # BUILTIN\Utilisateurs
        remove_file(file_path)

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

    if is_binary_outdated(all_path_bin_exe[1], control):
        print(f'Version not updated to {control.get_software_version()}!')
        return "WARNING"
    
    print("The installation has been done correctly")
    return "OK"

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

targeted_text = "wMoteur"
latest_bin = "charlemagne_moteur.exe"

api_version_url = "https://apic.ecoledirecte.com/v3/c/maj/versions.awp?verbe=get&mc=Outils"
api_download_url = f"https://api.ecoledirecte.com/v3/c/0/download/majcharlemagne.awp?verbe=get&chemin=MiseAJour/V2/&fichier={targeted_text}.exe"
user_agent = "CHARLIE"

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

    app_name = control.name

    version = requests.post(api_version_url, headers={"User-Agent": user_agent}, proxies=proxies).json()['data'][targeted_text]

    print(f"Latest {app_name} version is: {version}")
    print(f"Download url is: {api_download_url}")

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

    if not isfile(latest_bin):
        print(f"Downloading: {latest_bin}")
        package_updated = True
        wget(api_download_url, latest_bin, proxies=proxies)
    else:
        print(f"Binary is present: {latest_bin}")

    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} ')

    # 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()

    return package_updated

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
031079e8e2960f639eb074d5f154d7ab7020a6419edad1a42f812d9578be3499 : WAPT/control
1a1cade259c2fa39e2bd34b839f32b0df2e4443ed74ae22996111b18339965e0 : WAPT/icon.png
7d8e08e6365a6afdd51320ae729b3d089c0acee531f75920f5d6e501e0f10d75 : charlemagne_moteur.exe
e312d7d670a3c036872d93cec5b225e3152dd1f1e5465785a522109a870a1d11 : luti.json
f526e41881587de13fafa13a6b4c3ab17a034d03051163497611ded5594ea111 : setup.py
6cc68bee4daf7841b76ab3199ab7e2199feed0148d41c9fa2d5381c45577b1cc : update_package.py