tis-kryptor-portable icon

Kryptor

Silent install package for Kryptor

4.1.1-1

  • package: tis-kryptor-portable
  • name: Kryptor
  • version: 4.1.1-1
  • maintainer: Amel FRADJ
  • licence: GPL-3.0 license
  • target_os: windows
  • architecture: x64
  • signature_date:
  • size: 9.54 Mo
  • homepage : https://www.kryptor.co.uk/

package           : tis-kryptor-portable
version           : 4.1.1-1
architecture      : x64
section           : base
priority          : optional
name              : Kryptor
categories        : 
maintainer        : Amel FRADJ
description       : Kryptor is free and open source file encryption and signing software
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 
sources           : https://github.com/samuel-lucas6/Kryptor
installed_size    : 
impacted_process  : 
description_fr    : Kryptor est un logiciel libre et gratuit de cryptage et de signature de fichiers
description_pl    : Kryptor to darmowe i otwarte oprogramowanie do szyfrowania i podpisywania plików
description_de    : Kryptor ist eine kostenlose und quelloffene Software zur Dateiverschlüsselung und -signierung
description_es    : Kryptor es un software de cifrado y firma de archivos gratuito y de código abierto
description_pt    : O Kryptor é um software gratuito e de código aberto para encriptação e assinatura de ficheiros
description_it    : Kryptor è un software gratuito e open source per la crittografia e la firma dei file
description_nl    : Kryptor is gratis en open source software voor het versleutelen en ondertekenen van bestanden
description_ru    : Kryptor - это бесплатное программное обеспечение для шифрования и подписи файлов с открытым исходным кодом
audit_schedule    : 
editor            : 
keywords          : 
licence           : GPL-3.0 license
homepage          : https://www.kryptor.co.uk/
package_uuid      : 9b4c57c2-8723-459c-b0b5-7e6bf7d658b7
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 
max_os_version    : 
icon_sha256sum    : d1edc7b4c9c7fbb3d1e1653f36c9d0101540fd7e3cbc22c690e04652886602de
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-01-17T17:00:12.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         : Gs3MDa89oIC+QyRWy2tSREo/qv/dQfNVC3BaEbmMih33PB2k5QuvHfjm3IpLslnUjqeO0TZEluOu+s0mxx17rJ+bogI3ap/xyKN7ZLTWDp6MNCUO9zJ4fF9BPYdYFio21dKb6B2zzOSh/LNewV3tVV0a7aUuh/2W57VzM+2zC1zJVa92cnrX2fQTOAri9nVOo9U6rQzZOYw8Aem3R7kijusFoDo6j2TqleesO8sv6N2F+srTVNCF6lULRJrMGbPelu4gL7NBfK2mLxiSQET+UnUbRvb49MJv7euEY3RI/I3pMdkamqjZN8iYYuz9zga2xFbX3I2XGkfjOfdvA+5dfA==

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

app_name = "kryptor"
app_dir = makepath(programfiles, app_name)
app_path = makepath(app_dir,"kryptor.exe")
audit_version = False

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

def install():
    # Find the zip file
    zip_name = glob.glob(f"{app_name}*.zip")[0]
    unzip_dest = makepath(".", "temp_dezip")
    
    # Remove the temporary directory if it already exists
    if isdir(unzip_dest):
        remove_tree(unzip_dest)
    
    # Extract the zip file
    print(f"Extracting: {zip_name} to: {unzip_dest}")
    unzip(zip_name, unzip_dest)
    
    # List the contents of the temporary directory
    extracted_files = os.listdir(unzip_dest)
    print(f"Contents of the temporary directory after extraction: {extracted_files}")
    
    # Find the name of the extracted directory or the extracted files
    if not extracted_files:
        raise Exception("No extracted files or directories found")
    
    # If the first extracted item is a directory, use that directory, otherwise use unzip_dest
    first_extracted_item = makepath(unzip_dest, extracted_files[0])
    if isdir(first_extracted_item):
        unzipped_dir = first_extracted_item
    else:
        unzipped_dir = unzip_dest
    
    # Verify that the extracted directory exists
    if not isdir(unzipped_dir):
        raise Exception(f"Invalid source directory for copytree2: {unzipped_dir}")
    
    # Remove the old application directory if it exists
    if isdir(app_dir):
        remove_tree(app_dir)
    
    # Move the new extracted directory or files to the final installation directory
    copytree2(unzipped_dir, app_dir, onreplace=default_overwrite)
    
    # Remove the temporary directory
    remove_tree(unzip_dest)
    
    # Create custom shortcuts
    create_programs_menu_shortcut(app_name, target=app_path)
    
    # Get the desktop path
    desktop_path = os.path.expanduser("~\\Desktop")
    desktop_shortcut_path = makepath(desktop_path, f"{app_name}.lnk")
    
    # Create the desktop shortcut
    print(f"Creating desktop shortcut: {desktop_shortcut_path}")
    create_shortcut(desktop_shortcut_path, target=app_path)
    
    print(f"Desktop shortcut created successfully: {desktop_shortcut_path}")

def create_shortcut(shortcut_path, target):
    try:
        create_desktop_shortcut(shortcut_path, target=target)
        return True
    except Exception as e:
        print(f"Error creating shortcut: {e}")
        return False

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)
        if isdir(app_dir):
            print(f"Failed to remove installation directory: {app_dir}")
        else:
            print(f"Installation directory removed successfully: {app_dir}")

    # Removing shortcuts
    desktop_path = os.path.expanduser("~\\Desktop")
    desktop_shortcut_path = makepath(desktop_path, f"{app_name}.lnk")
    
    if os.path.exists(desktop_shortcut_path):
        print(f"Removing desktop shortcut: {desktop_shortcut_path}")
        os.remove(desktop_shortcut_path)
    
    remove_programs_menu_shortcut(app_name)

    # Additional check
    if os.path.exists(desktop_shortcut_path):
        print(f"Failed to remove desktop shortcut: {desktop_shortcut_path}")
    else:
        print(f"Desktop shortcut removed successfully: {desktop_shortcut_path}")

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


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

    dict_arch = {
        "x64" : "-windows-x64"
    }
    git_repo = "samuel-lucas6/Kryptor"
    url_api = "https://api.github.com/repos/%s/releases/latest" % git_repo
    # Getting latest version information from official sources
    print("API used is: %s" % url_api)
    json_load = json.loads(wgets(url_api, proxies=proxies))

    for download in json_load["assets"]:
        if download["browser_download_url"].endswith(".zip") and dict_arch[control.architecture] in download["browser_download_url"] :
            url_dl = download["browser_download_url"]
            version = json_load["tag_name"].replace("v", "")
            filename = download["name"]
            break

    if not isfile(filename):
        package_updated = True
        wget(url_dl,filename,proxies=proxies)

    #nettoyer les fichiers temporaires
    for f in glob.glob('*.zip'):
        if f != filename:
            remove_file(f)
    
    control.set_software_version(version)
    control.save_control_to_wapt()

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
a301f35c4c16c7380258d28e75f6a109f919476292076817687583306c5fd941 : WAPT/control
d1edc7b4c9c7fbb3d1e1653f36c9d0101540fd7e3cbc22c690e04652886602de : WAPT/icon.png
7e0e29ea48660762004877de3ded4de8061fef59473b6b16e5891e87e11669b3 : kryptor-windows-x64.zip
08781f2659cb291de376ad154879751cfafcc1d5862057e4f3823182edbe96aa : luti.json
7d4bdbc49982fb2c5d18a52fb96dbe45ad79a3bed7a9222a1a61a7ed72a41b85 : setup.py
9d2a2aaa8f9c2320eb73a8b29e83a0f2506c4084c35dffabb32e49954112f944 : update_package.py