tis-snagit icon

Snagit

Silent install package for Snagit

25.2.0-1

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

package           : tis-snagit
version           : 25.2.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      : 071747bc-edbe-487e-9d56-d6cbb6532e5a
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-06-10T18:00:23.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         : qH7Om+v4CgWlkCnCml8wv2d2aghZDo10+fqg0FyIIr9W+G4eZmwyS24ehwLjSjHn3OOOryaE3UYAJ3lXA9YqdgUx1nqzg4+ksAfQi4BP1EbX2NsHInvEhKFWvzLjIc5fxe9AMtpkPuSQfvtAH50Jew5Jct2Oof58cSStox1aPo49q9dNx5k4irb/LRYqWYwT/TLT9eD5nJVTy4BUmXJYNBsTjnI7Dfudn2s94P8NHChTn0I7fwUVR0xkb9D9I87i3g2TzyynjzastKx4zvd9EH6kbLmzOmqkZWVWfYSO/TT6Dyj6ISpBnxbU8D5n8yKoQWheRmkZwbeXOI/2YaDkOg==

# -*- 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
07c98673e825243ce7dda74e743ebb666264cdf5afd025fb8dad855e12fff8b9 : WAPT/control
163f54280570b7a1390d7c09d425e2771f807c1d757f094514af8016a4e73eb3 : WAPT/icon.png
8e0866066f85a12dcce2f25bf2acb88aa3d8fc70f9aeba93de7191bd97587b58 : last_headers.txt
31d99655ed48323d52d7365abd809fb27964d2ae7cf77b4569dad7b14dcee1c4 : luti.json
0024067d36cebf504ea2644caaa2c2bf1963efa06317a8d93251045c85a81579 : setup.py
6710e530254412b3aac57f2ad0a2b315ca536028a4719f6f495356b646f68d1f : snagit.msi
1efb4fa943041f3272bd8244b6ed4c9a825beb6d8a8722a0d7c07c11228c2d4c : update_package.py