Il faut mettre à jour la variable licence en sachant qu'il existe une licence d'évaluation : MSD-9903999-A
Code : Tout sélectionner
# -*- 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
licence = 'MSD-9903XXX-A'
def install():
# Declaring local variables
import tempfile
import codecs
pathinstallfile = makepath(tempfile.gettempdir(),'Meca3d_v19.inf')
data = r"""[Setup]
Lang=mytrans
Dir=C:\Program Files\Meca3d SolidWorks v19.0
Group=Meca3d SolidWorks v19.0
NoIcons=0
Tasks="""
fichier = codecs.open(pathinstallfile, "w")
fichier.write(data)
fichier.close()
# Installing the software
print("Installing: %s" % control.package)
registry_set(HKEY_LOCAL_MACHINE,r'Software\Atemi\Meca3d SolidWorks','Serial Number',licence,type=REG_SZ)
install_exe_if_needed('Meca3d_Sw2019_x64_Rollout_v19.0.0.113.exe',
silentflags='/verysilent /supressmsgboxes /loadinf=%s' % pathinstallfile,
key='{E4C0044A-A35D-4545-B766-84D0AA148D22}_is1',
min_version='19.0.0.113'
)
uninstallkey.remove('{E4C0044A-A35D-4545-B766-84D0AA148D22}_is1')
remove_file(pathinstallfile)
def uninstall():
run(r'"%s\Meca3d SolidWorks v19.0\unins000.exe" /verysilent' % programfiles64)
if reg_key_exists(HKEY_LOCAL_MACHINE,r'Software\Atemi'):
registry_deletekey(HKEY_LOCAL_MACHINE,r'Software\Atemi\Meca3d SolidWorks','v19')
registry_deletekey(HKEY_LOCAL_MACHINE,r'Software\Atemi','Meca3d SolidWorks')
registry_deletekey(HKEY_LOCAL_MACHINE,r'Software','Atemi')