Zotero

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
User avatar
Gaetan
Messages: 169
Registration: August 8, 2019 - 10:16
Location: Toulouse

April 22, 2020 - 4:26 PM

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    :
Last edited by Gaetan on July 9, 2020 - 09:27, edited 2 times.
Yoann
Messages: 51
Registration: July 24, 2019 - 09:39

April 23, 2020 - 2:01 PM

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.
WAPT Community 1.8
User avatar
Gaetan
Messages: 169
Registration: August 8, 2019 - 10:16
Location: Toulouse

April 23, 2020 - 2:30 PM

Hi,
thanks for the info. During testing, I couldn't find the -ms command you're using. ;)
User avatar
Gaetan
Messages: 169
Registration: August 8, 2019 - 10:16
Location: Toulouse

July 9, 2020 - 9:27 AM

Updated based on your advice, thank you ;)
Yoann
Messages: 51
Registration: July 24, 2019 - 09:39

January 27, 2021 - 2:51 PM

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.
WAPT Community 1.8
User avatar
Gaetan
Messages: 169
Registration: August 8, 2019 - 10:16
Location: Toulouse

January 27, 2021 - 3:21 PM

Hello,
thank you for the information, this will be fixed. ;)
Locked