tis-charlemagne-config-outils-template icon

Configuration Charlemagne Outils

Paquet d’installation silencieuse pour Configuration Charlemagne Outils

1-1

  • package: tis-charlemagne-config-outils-template
  • name: Configuration Charlemagne Outils
  • version: 1-1
  • maintainer: WAPT Team,Tranquil IT,Flavien Schelfaut
  • target_os: windows
  • architecture: all
  • signature_date:
  • size: 14.79 Ko
  • depends:

package           : tis-charlemagne-config-outils-template
version           : 1-1
architecture      : all
section           : base
priority          : optional
name              : Configuration Charlemagne Outils
categories        : 
maintainer        : WAPT Team,Tranquil IT,Flavien Schelfaut
description       : Configuration Charlemagne Outils
depends           : tis-charlemagne-outils
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 2.1
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      : 26f1c3b7-424d-4e72-8e1b-72333dc11470
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : 12be6049114c27b51eade6183664fd272c60246b46d6a2d5429de958264223d1
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2024-09-30T10:56:48.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         : FcNFFfhexAj31psJk67+41HP1YMZIFHABUN2pAPhK6Px9RGkpnl1OYns8pvINNV8YtcGjxo/69GkM9WVxFeVvLkoNhu4NX2F7HumSLFP4UHEiV6xIK5v4ShFTdq58J98+XQD1CpaO4GqG5RoWRvHiXrjI9m4IiLEPi2YTM+LixK6uNl5LHnuSQOS/TNGS/NW2p9XUUHikub+0rumfTRXMn3SM8m5bNlKhosa6A3KQsDNMErzyUk6Ow0Zyjqek0Cn6CPAAQ61T8qqh7eoAnSZpewj7edm84pQUF6NnqLrU0ACkUhX+3BL05DWRepnf4mWmMvzbBzzSjvtu8DwaMCfFg==

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

charlemagne_folder = makepath(programfiles32, 'alcuin')
charlemagne_config_file = makepath(charlemagne_folder, 'statim.ini')
configuration_file = 'configuration.json'

def json_to_ini_file(source_file, dest_file):
    with open(source_file) as f:
        conf = json.load(f)

    for key, value in conf.items():
        inifile_writestring(dest_file, 'CONFIGURATION', key, value)

def install():

    if not isfile(configuration_file):
        error('No configuration file found, run the update_package to generate one !')

    print("Configuration of charlemagne Outils ...")
    mkdirs(charlemagne_folder) # In case of the alcuin folder doesnt exist
    json_to_ini_file(configuration_file, charlemagne_config_file)
    print(f"Configuration applied to '{charlemagne_config_file}' file !")

  
def uninstall():
    print(f"Deleting of the configuration file: '{charlemagne_config_file}'")
    remove_file(charlemagne_config_file)

from setuphelpers import *
from setupdevhelpers import *


def update_package():
    # Declaring local variables
    package_updated = False
    configuration_file = 'configuration.json'

    # Interact differently with Luti
    if params.get("running_as_luti"):
        return "OK"
    
    configuration = dict()
    configuration['TypeBase'] = 'ClientServeur'

    configuration['Server'] = ask_input(
        control.package,
        "Please enter the IP address of the Charlemagne database server",
        "YOU_SERVER_IP_OR_DNS_NAME",
        raise_error=True,
    )

    configuration['Port'] = ask_input(
        control.package,
        "Please enter the Port of the Charlemagne database server",
        "4900",
        raise_error=True,
    )

    with open(configuration_file, 'w') as f:
        json.dump(configuration, f)

    # Renaming package
    if "template" in control.package:
        
        complete_control_package(control)
        complete_control_name(control)

        # User not modify the package name
        if "template" in control.package:
            error("Please rename the package.")

        version = str(int(control.get_software_version()) + 1)
    else:
        version = control.get_software_version()

    # 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(version)
    control.save_control_to_wapt()

    # Validating or not update-package-sources
    return package_updated

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
9b634da4adaf19aba694f9db9660d07c46adac49b4d820e3daf3fbc3ff57d14a : WAPT/control
12be6049114c27b51eade6183664fd272c60246b46d6a2d5429de958264223d1 : WAPT/icon.png
12bbeacc4ed4085fa5d7d7f3d3ba973b365e02c5e5924416cdf463bcd5c258a5 : luti.json
4cfb3d888b5ef512bc01419eae4aa9f17ee225d697af6e4218f91667b7ca8e32 : setup.py
f64775e5cf8b7a51670881e7e7e35afcf861cf741e7485e1cc8eb464884cd0e5 : update_package.py