tis-snagit icon

Snagit

Paquet d’installation silencieuse pour Snagit

25.0.0-1

  • package: tis-snagit
  • name: Snagit
  • version: 25.0.0-1
  • maintainer: Amel FRADJ
  • licence: https://www.techsmith.com/snagit-eula.html
  • target_os: windows
  • architecture: x64
  • signature_date:
  • size: 434.91 Mo
  • homepage : https://www.techsmith.com/screen-capture.html

package           : tis-snagit
version           : 25.0.0-1
architecture      : x64
section           : base
priority          : optional
name              : Snagit
categories        : 
maintainer        : Amel FRADJ
description       : Snagit is a image capture program from TechSmith
depends           : 
conflicts         : 
maturity          : PROD
locale            : 
target_os         : windows
min_wapt_version  : 
sources           : 
installed_size    : 
impacted_process  : 
description_fr    : Snagit est un programme de capture d'images de TechSmith
description_pl    : Snagit to program do przechwytywania obrazów od TechSmith
description_de    : Snagit ist ein Bildaufnahmeprogramm von TechSmith
description_es    : Snagit es un programa de captura de imágenes de TechSmith
description_pt    : Snagit é um programa de captura de imagens da TechSmith
description_it    : Snagit è un programma per l'acquisizione di immagini di TechSmith
description_nl    : Snagit is een programma voor het vastleggen van afbeeldingen van TechSmith
description_ru    : Snagit - программа для захвата изображений от TechSmith
audit_schedule    : 
editor            : 
keywords          : 
licence           : https://www.techsmith.com/snagit-eula.html
homepage          : https://www.techsmith.com/screen-capture.html
package_uuid      : e52e0016-01ca-4071-b835-7866ea0cfc9c
valid_from        : 
valid_until       : 
forced_install_on : 
changelog         : 
min_os_version    : 10.0
max_os_version    : 
icon_sha256sum    : 163f54280570b7a1390d7c09d425e2771f807c1d757f094514af8016a4e73eb3
signer            : Tranquil IT
signer_fingerprint: 8c5127a75392be9cc9afd0dbae1222a673072c308c14d88ab246e23832e8c6bb
signature_date    : 2025-03-01T15:17:14.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         : FpsU/Q+diTU+hpQQ268uhgw6fxyBiFuG9HBMw8F2CedFtDBbo5Gk9jeC3WvO2tWxaYqDYFCKJK9nekhnWgeqkEaaJfLgYd2LIAWlITv5IOS2jHmgwq4h+3O0VH4L+mlA87RUghKuo9xaSjUKnpkVifA9/dTAjARct/1ptpEtG/kggb9Q15rNzP9ARszs+5eFAB27H+uqqPPcpZCue+6c9eLFO7qYn8hTnFiJWAQTGPzOMJcBs4cNEy7UttcgvnWeqgafAHGJrZEtm6HfmEkVpnFitxUBOSVtYAyaPkB2AMbbkI9O87zkPU7M2R8PedFWVL9ez8Lk+iFgt835MDEpiQ==

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

r"""
Usable WAPT package functions: install(), uninstall(), session_setup(), audit(), update_package()

"""
# Declaring global variables - Warnings: 1) WAPT context is only available in package functions; 2) Global variables are not persistent between calls


def install():
    # Declaring local variables
    # Uninstalling older version of the software that can remains
    for to_uninstall in installed_softwares(name="Snagit"):
        if Version(to_uninstall["version"]) < Version(control.get_software_version()):
            print(f"Removing: {to_uninstall['name']} ({to_uninstall['version']})")
            killalltasks(ensure_list(control.impacted_process))
            run(uninstall_cmd(to_uninstall["key"]))
            wait_uninstallkey_absent(to_uninstall["key"])

    # Installing the software
    print("Installing: snagit.msi")
    install_msi_if_needed('snagit.msi')



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

def get_headers(url, proxies=None):
    response = requests.head(url, allow_redirects=True, proxies=proxies)
    return response.headers

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

    url_base = "https://download.techsmith.com/snagit/releases/snagit.msi"
    latest_bin = "snagit.msi"
    headers_file = "last_headers.txt"

    # Get current headers from the URL
    current_headers = get_headers(url_base, proxies)
    current_etag = current_headers.get('ETag')
    current_last_modified = current_headers.get('Last-Modified')

    # Load previous headers
    previous_etag = None
    previous_last_modified = None

    if os.path.isfile(headers_file):
        with open(headers_file, 'r') as f:
            previous_etag = f.readline().strip()
            previous_last_modified = f.readline().strip()

    # Check if there is an update
    download_url = url_base
    if (current_etag and current_etag != previous_etag) or (current_last_modified and current_last_modified != previous_last_modified):
        print("A new version is available. Downloading the latest version.")
        package_updated = True
    elif not os.path.isfile(latest_bin):
        print("File does not exist locally. Downloading the file.")
        package_updated = True
    else:
        print("The current version is up to date. No need to download.")

    # Downloading latest binaries if needed
    if package_updated:
        print(f"Downloading: {latest_bin}")
        wget(download_url, latest_bin, proxies=proxies)

        # Save the current headers for future comparison
        with open(headers_file, 'w') as f:
            if current_etag:
                f.write(current_etag + '\n')
            if current_last_modified:
                f.write(current_last_modified + '\n')

    # Delete outdated binaries
    for f in glob.glob('*.msi'):
        if f != latest_bin:
            remove_file(f)

    # Update the package if there is a new version
    version = get_version_from_binary(latest_bin)
    control.set_software_version(version)
    control.save_control_to_wapt() 

38d056ab130f7bf7c481c12636a4e9959de36561d3dfcbe54c6e3571bc0c1dc3 : WAPT/certificate.crt
4e55a1066cca7a22102b5d27ce44a94a15238bd38f0ea1eb3556fd6fdf3dd5fa : WAPT/control
163f54280570b7a1390d7c09d425e2771f807c1d757f094514af8016a4e73eb3 : WAPT/icon.png
f4af8878ad85dc22c4d99e1a11f8bd1a8a243bfd6c4d3400fdea1458f415a8f0 : last_headers.txt
1369a36dc7d7c9e13978c5e86fd519d96f6b1b20ce02fe480703a8733839b862 : luti.json
0024067d36cebf504ea2644caaa2c2bf1963efa06317a8d93251045c85a81579 : setup.py
8d4ec76778ab3ec2ae481b883704d45f3ac6cfd96d54a51612f345121ef2d863 : snagit.msi
1efb4fa943041f3272bd8244b6ed4c9a825beb6d8a8722a0d7c07c11228c2d4c : update_package.py