Page 1 of 1

Zotero

Published: April 22, 2020 - 4:26 PM
by Gaetan
Hello everyone,
Today, a package for the Zotero software.

The uninstall is defined beforehand to avoid code redundancy.

setup.py file:

Code: Select all

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

InstallExe= "Zotero-%s_setup.exe"

#Récupération du fichier Control
Control = PackageEntry().load_control_from_wapt('.')

Logiciel = Control.name

Exename = Control.impacted_process

#Récupération de la version
PackageVersion = Control.version.split('-',1)[0]

#Clé de désinstallation
KeyUninstall = ""

def install():

    print('installing ' + Logiciel)

    install_exe_if_needed(InstallExe% PackageVersion,'-ms',key=KeyUninstall,min_version=PackageVersion)

def uninstall():

    print('uninstalling ' + Logiciel)

    for uninstall in installed_softwares(Logiciel):
        if uninstall_key_exists(uninstall['key']):
            killalltasks(Exename)
            run(uninstall_cmd(uninstall['key']))
            time.sleep (5)

Fichier control :

[code]package           : tls-zotero
version           : 5.0.88-0
architecture      : x64
section           : base
priority          : optional
name              : Zotero
categories        : office
maintainer        : Gaetan
description       : Zotero (Corporation for Digital Scholarship)
depends           :
conflicts         :
maturity          : PROD
locale            :
target_os         : windows
min_os_version    :
max_os_version    :
min_wapt_version  :
sources           :
installed_size    : 115191808
impacted_process  :
description_fr    :
description_pl    :
description_de    :
description_es    :
description_pt    :
description_it    :
description_nl    :
description_ru    :
audit_schedule    :

Re: Zotero

Published: April 23, 2020 - 2:01 PM
by Yoann
Good morning,

It is not necessary to extract the Zotero installer to install it.

Code: Select all

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

uninstallkey = []

def install():
    print('installing Zotero')
    version = control.version.split('-',1)[0]
    ukey = 'Zotero %s (x86 en-US)' % version
    exe = 'Zotero-%s_setup.exe' % version

    install_exe_if_needed(exe, '-ms', key=ukey, min_version=version, killbefore='zotero.exe')
Sincerely.

Re: Zotero

Published: April 23, 2020 - 2:30 PM
by Gaetan
Hi,
thanks for the info. During testing, I couldn't find the -ms command you're using. ;)

Re: Zotero

Published: July 9, 2020 - 9:27 AM
by Gaetan
Updated based on your advice, thank you ;)

Re: Zotero

Published: January 27, 2021 - 2:51 PM
by Yoann
Good morning,

The package tis-zotero made available in the repository, has a problem (the variable bin_name is used instead of bin_name_string ):

Code: Select all

print('Installing: %s' % bin_name)
Or, judging from the other packages, the following lines are missing from the code:

Code: Select all

    package_version = control.version.split('-')[0]
    bin_name = bin_name_string % package_version

Sincerely.

Re: Zotero

Published: January 27, 2021 - 3:21 PM
by Gaetan
Hello,
thank you for the information, this will be fixed. ;)