J'ai une erreur "IndexError: tuple index out of range" d'installation sur un paquet mais sur un seul poste. Sur d'autres postes sous W10 et W7 en x86 et x64 tout fonctionne bien.
Dans le doute, j'ai réinstallé l'agent après avoir tout purgé.
Voici le script tournant avec wapt 1.7.4 ... peut-être que le problème est lié à session_setup():
Au passage si vous voulez ajouter des options pour les tampons/signature à votre paquet tis-foxit, ce que j'ai ajouté fonctionne bien.
Code : Tout sélectionner
# -*- coding: utf-8 -*-
from setuphelpers import *
import requests
import platform
try:
import bs4 as BeautifulSoup
except:
import BeautifulSoup
uninstallkey = []
# Declaring specific app values (TO CHANGE)
bin_name_string = 'FoxitReader_%s_Setup.exe'
silent_args_string = '/ForceInstall /VERYSILENT DESKTOP_SHORTCUT="0" MAKEDEFAULT="1" VIEWINBROWSER="0" LAUNCHCHECKDEFAULT="1" AUTO_UPDATE="0" /passive /norestart /LANG=%s'
app_uninstallkey = 'Foxit Reader_is1'
def install():
# Specific app values
package_version = control.version.split('-',1)[0]
lang = get_language()
# Installing the package
install_exe_if_needed(bin_name_string % package_version
,silentflags=silent_args_string % lang
,key=app_uninstallkey
,min_version=package_version)
registry_setstring(HKEY_LOCAL_MACHINE,r'SOFTWARE\Policies\Explorer\DisallowRun','foxit_updater','FoxitReaderUpdater.exe')
remove_desktop_shortcut('Foxit Reader')
# Purge des anciens modèles
remove_tree(r'c:\ProgramData\Foxit Software\Signature')
remove_tree(r'c:\ProgramData\Foxit Software\UserStamps')
# Copie du modèle de signature Domitia
copytree2('Signature',r'c:\ProgramData\Foxit Software\Signature')
# Copie du modèle de tampon
copytree2('UserStamps',r'c:\ProgramData\Foxit Software\UserStamps')
def session_setup():
print('Disabling auto update check')
# Specific app values
package_version = control.version.split('-',1)[0]
split_package_version = package_version.split('.')
short_package_version = '%s.%s'% (split_package_version[0],split_package_version[1])
registry_setstring(HKEY_CURRENT_USER,r'Software\Foxit Software\Foxit Reader %s\plugins\Updater' % short_package_version,'UpdateMode','0')
updater_path = makepath(user_appdata,'Foxit Software','Addon','Foxit Reader','FoxitReaderUpdater.exe')
if isfile(updater_path):
remove_file(updater_path)
#Ordinateur\HKEY_CURRENT_USER\Software\Foxit Software\Foxit Reader 10.0\Preferences\Registration
#bShowRegisterDlg = 0
# Désactivation enregistrement à la première utilisation
registry_setstring(HKEY_CURRENT_USER, r"Software\Foxit Software\Foxit Reader 10.0\Preferences\Registration",'bShowRegisterDlg','0', type=REG_SZ)
# Intégration de la signature Domitia
mkdirs(makepath(user_appdata,'Foxit Software','Foxit Reader','Signature'))
filecopyto(r'c:\ProgramData\Foxit Software\Signature\style.foxitdata',makepath(user_appdata,'Foxit Software','Foxit Reader','Signature'))
# Intégration du modèle de tampon Domitia
mkdirs(makepath(user_appdata,'Foxit Software','Foxit Reader','Stamps','UserStamps'))
filecopyto(r'c:\ProgramData\Foxit Software\UserStamps\FXSvlmkiquvspwvgxy.pdf',makepath(user_appdata,'Foxit Software','Foxit Reader','Stamps','UserStamps'))
# Suppression d'ancien modèle de tampon
remove_file(makepath(user_appdata,'Foxit Software','Foxit Reader','Stamps','UserStamps','FXSusgzziovrftavgp.pdf'))
def update_package():
print('Download/Update package content from upstream binary sources')
# Getting proxy informations from WAPT settings
proxy = {}
if platform.system()=='Windows' and isfile(makepath(user_local_appdata(),'waptconsole','waptconsole.ini')):
proxywapt = inifile_readstring(makepath(user_local_appdata(),'waptconsole','waptconsole.ini'),'global','http_proxy')
if proxywapt :
proxy = {'http':proxywapt,'https':proxywapt}
# Specific app values
app_name = control.name
url = 'https://www.foxitsoftware.com/pdf-reader/version-history.php'
# Getting latest version from official website
page = requests.get(url,headers={'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'}).text
bs = BeautifulSoup.BeautifulSoup(page)
#bs = BeautifulSoup.BeautifulSoup(page,features="html.parser") # For bs4 only
bs_raw_string = str(bs.find('h3').text)
version = bs_raw_string.replace('Version ','')
url_dl = 'https://www.foxitsoftware.com/downloads/latest.php?product=Foxit-Reader&platform=Windows&package_type=exe&language=French&version=%s' % version
latest_bin = bin_name_string % version
print('Latest ' + app_name + ' version is: ' + version)
print('Download url is: ' + url_dl)
# Downloading latest binaries
if not isfile(latest_bin):
print('Downloading: ' + latest_bin)
wget(url_dl,latest_bin,proxies=proxy)
# Get version from file
version_from_file = get_file_properties(latest_bin)['ProductVersion']
if version != version_from_file and version_from_file != '':
version = version_from_file
old_latest_bin = latest_bin
latest_bin = bin_name_string % version
if isfile(latest_bin):
remove_file(latest_bin)
os.rename(old_latest_bin,latest_bin)
# Change version of the package
pe = PackageEntry().load_control_from_wapt('.')
pe.version = '%s-%s'%(version,int(pe.version.split('-',1)[1])+1)
pe.save_control_to_wapt('.')
print('Changing version to ' + pe.version + ' in WAPT\\control')
print('Update package done. You can now build-upload your package')
else:
print('This package is already up-to-date')
# Deleting outdated binaries
for bin_in_dir in glob.glob('*.exe') or glob.glob('*.msi'):
if bin_in_dir != latest_bin :
print('Outdated binary: ' + bin_in_dir + ' Deleted')
remove_file(bin_in_dir)
2020-07-02 10:17:10,618 DEBUG Default encoding : ascii
2020-07-02 10:17:10,618 DEBUG Setting encoding for stdout and stderr to cp850
2020-07-02 10:17:10,624 DEBUG Python path ['C:\\Program Files (x86)\\wapt', 'C:\\Program Files (x86)\\wapt', 'C:\\Progra
m Files (x86)\\wapt\\python27.zip', 'C:\\Program Files (x86)\\wapt\\DLLs', 'C:\\Program Files (x86)\\wapt\\lib', 'C:\\Pr
ogram Files (x86)\\wapt\\lib\\plat-win', 'C:\\Program Files (x86)\\wapt\\lib\\lib-tk', 'C:\\Program Files (x86)\\wapt',
'C:\\Program Files (x86)\\wapt\\lib\\site-packages', 'C:\\Program Files (x86)\\wapt\\lib\\site-packages\\pywin32-223-py2
.7-win32.egg']
2020-07-02 10:17:10,625 INFO Using local waptservice configuration C:\Program Files (x86)\wapt\wapt-get.ini
2020-07-02 10:17:10,625 DEBUG Config file: C:\Program Files (x86)\wapt\wapt-get.ini
Using config file: C:\Program Files (x86)\wapt\wapt-get.ini
2020-07-02 10:17:10,628 DEBUG Thread 1480 is connecting to wapt db
2020-07-02 10:17:10,694 DEBUG Using host certificate C:\Program Files (x86)\wapt\private\4C4C4544-0048-5010-8039-B5C04F3
33332.pem for repo global auth
2020-07-02 10:17:10,723 DEBUG Thread 1480 is connecting to wapt db
2020-07-02 10:17:10,723 DEBUG DB Start transaction
2020-07-02 10:17:10,723 DEBUG DB commit
2020-07-02 10:17:10,782 DEBUG Using host certificate C:\Program Files (x86)\wapt\private\4C4C4544-0048-5010-8039-B5C04F3
33332.pem for repo wapt auth
2020-07-02 10:17:10,901 DEBUG Using host certificate C:\Program Files (x86)\wapt\private\4C4C4544-0048-5010-8039-B5C04F3
33332.pem for repo wapt-host auth
2020-07-02 10:17:10,930 INFO User Groups:[]
2020-07-02 10:17:10,930 DEBUG WAPT base directory : C:\Program Files (x86)\wapt
2020-07-02 10:17:10,930 DEBUG Package cache dir : C:\Program Files (x86)\wapt\cache
2020-07-02 10:17:10,930 DEBUG WAPT DB Structure version;: 20190606
2020-07-02 10:17:10,930 DEBUG Checking if old install in progress
2020-07-02 10:17:10,940 DEBUG reset stalled install_status in database
installing WAPT packages ophlm-foxit
2020-07-02 10:17:10,974 DEBUG Loading ssl context with cert C:\Program Files (x86)\wapt\private\4C4C4544-0048-5010-8039-
B5C04F333332.crt and key C:\Program Files (x86)\wapt\private\4C4C4544-0048-5010-8039-B5C04F333332.pem
2020-07-02 10:17:11,178 INFO Use cached package file from C:\Program Files (x86)\wapt\cache\ophlm-foxit_10.0.0.35798-1
1_PREPROD.wapt
2020-07-02 10:17:11,384 DEBUG Stores cert chain check in cache
2020-07-02 10:17:11,385 DEBUG Downloaded : {'downloaded': [], 'skipped': [u'C:\\Program Files (x86)\\wapt\\cache\\ophlm-
foxit_10.0.0.35798-11_PREPROD.wapt'], 'errors': [], 'packages': [PackageEntry(u'ophlm-foxit',u'10.0.0.35798-11' maturity
=u'PREPROD')]}
Installing ophlm-foxit(=10.0.0.35798-11)
2020-07-02 10:17:11,387 INFO Register start of install C:\Program Files (x86)\wapt\cache\ophlm-foxit_10.0.0.35798-11_PRE
PROD.wapt as user latijoel to local DB with params {}
2020-07-02 10:17:11,387 INFO Interactive user:latijoel, usergroups []
2020-07-02 10:17:11,588 INFO Status : Installing package ophlm-foxit version 10.0.0.35798-11 ...
2020-07-02 10:17:11,588 DEBUG DB Start transaction
2020-07-02 10:17:11,588 DEBUG DB commit
2020-07-02 10:17:11,631 DEBUG DB Start transaction
2020-07-02 10:17:11,634 DEBUG DB commit
2020-07-02 10:17:11,674 INFO Control data for package C:\Program Files (x86)\wapt\cache\ophlm-foxit_10.0.0.35798-11_PREP
ROD.wapt verified by certificate SSLCertificate cn=domitia
2020-07-02 10:17:11,674 INFO Installing package C:\Program Files (x86)\wapt\cache\ophlm-foxit_10.0.0.35798-11_PREPROD.wa
pt
2020-07-02 10:17:11,678 INFO Unzipping package C:\Program Files (x86)\wapt\cache\ophlm-foxit_10.0.0.35798-11_PREPROD.wap
t to directory c:\users\latijoel\appdata\local\temp\waptxdg9ol
2020-07-02 10:17:11,993 INFO Package has a setup.py, code signing certificate is required.
2020-07-02 10:17:11,996 DEBUG Certificate {'countryName': u'FR', 'commonName': u'domitia', 'emailAddress': u'serviceinfo
rmatique@domitia-habitat.fr', 'organizationName': u'Domitia Habitat', 'localityName': u'Narbonne'} is trusted by root CA
domitia
2020-07-02 10:17:11,997 DEBUG Checking signature with SSLCertificate cn=domitia
2020-07-02 10:17:12,000 DEBUG OK with SSLCertificate cn=domitia
2020-07-02 10:17:12,000 INFO Package issued by {'countryName': u'FR', 'commonName': u'domitia', 'emailAddress': u'servic
einformatique@domitia-habitat.fr', 'organizationName': u'Domitia Habitat', 'localityName': u'Narbonne'}
2020-07-02 10:17:12,325 INFO Unzipped files verified by certificate SSLCertificate cn=domitia
2020-07-02 10:17:12,325 DEBUG Removing existing persistent dir C:\Program Files (x86)\wapt\private\persistent\883da6a5-8
ae2-4477-b9e9-bd9b66350454
2020-07-02 10:17:12,328 INFO sourcing install file c:\users\latijoel\appdata\local\temp\waptxdg9ol\setup.py
2020-07-02 10:17:12,328 DEBUG Import source c:\users\latijoel\appdata\local\temp\waptxdg9ol\setup.py as __waptsetup_qkz8
8wxt4v__
2020-07-02 10:17:12,338 INFO Install parameters : {}
2020-07-02 10:17:12,339 DEBUG DB Start transaction
2020-07-02 10:17:12,342 DEBUG DB commit
2020-07-02 10:17:12,489 INFO executing install script
2020-07-02 10:17:12,503 DEBUG DB Start transaction
2020-07-02 10:17:12,505 DEBUG DB commit
Exe setup FoxitReader_10.0.0.35798_Setup.exe already installed. Skipping
2020-07-02 10:17:12,542 INFO File C:\Users\Public\Desktop\Foxit Reader.lnk doesn't exist, so not removed
2020-07-02 10:17:12,543 DEBUG Cleaning package tmp dir
2020-07-02 10:17:12,559 DEBUG DB Start transaction
2020-07-02 10:17:12,561 DEBUG DB commit
2020-07-02 10:17:12,607 DEBUG DB Start transaction
2020-07-02 10:17:12,608 DEBUG DB commit
2020-07-02 10:17:12,651 DEBUG DB Start transaction
2020-07-02 10:17:12,653 DEBUG DB commit
2020-07-02 10:17:12,707 DEBUG Removing module: __waptsetup_qkz88wxt4v__, refcnt: 4
2020-07-02 10:17:12,776 DEBUG Checking availability of host packages "[PackageEntry(u'4C4C4544-0048-5010-8039-B5C04F3333
32',u'4' )]"
2020-07-02 10:17:12,778 DEBUG Checking if 4C4C4544-0048-5010-8039-B5C04F333332(=4) is installed/outdated
2020-07-02 10:17:12,836 DEBUG store status in DB
2020-07-02 10:17:12,838 DEBUG DB Start transaction
2020-07-02 10:17:12,838 DEBUG DB commit
2020-07-02 10:17:12,891 INFO Status :
2020-07-02 10:17:12,894 DEBUG DB Start transaction
2020-07-02 10:17:12,894 DEBUG DB commit
2020-07-02 10:17:12,937 CRITICAL Package ophlm-foxit [x64_fr_PROD,PREPROD] not installed due to errors : IndexError: tup
le index out of range
FATAL ERROR : IndexError: tuple index out of range
Traceback (most recent call last):
File "<string>", line 1425, in <module>
File "<string>", line 542, in main
File "C:\Program Files (x86)\wapt\common.py", line 4855, in install
force=force
File "C:\Program Files (x86)\wapt\common.py", line 3934, in install_wapt
raise e
IndexError: tuple index out of range
Exception at 00441CD4: EPyIndexError:
exceptions.IndexError: tuple index out of range.