[RESOLU] Paquet MATLAB

Questions about WAPT Packaging / Requêtes et aides autour des paquets Wapt.
Règles du forum
Règles du forum communautaire
* English support on www.reddit.com/r/wapt
* Le support communautaire en français se fait sur ce forum
* Merci de préfixer le titre du topic par [RESOLU] s'il est résolu.
* Merci de ne pas modifier un topic qui est taggé [RESOLU]. Ouvrez un nouveau topic en référençant l'ancien
* Préciser version de WAPT installée, version complète ET numéro de build (2.2.1.11957 / 2.2.2.12337 / etc.) AINSI QUE l'édition Enterprise / Discovery
* Les versions 1.8.2 et antérieures ne sont plus maintenues. Les seules questions acceptées vis à vis de la version 1.8.2 sont liés à la mise à jour vers une version supportée (2.1, 2.2, etc.)
* Préciser OS du serveur (Linux / Windows) et version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019)
* Préciser OS de la machine d'administration/création des paquets et de la machine avec l'agent qui pose problème le cas échéant (Windows 7 / 10 / 11 / Debian 11 / etc.)
* Eviter de poser plusieurs questions lors de l'ouverture de topic, sinon il risque d'être ignorer. Si plusieurs sujet, ouvrir plusieurs topic, et de préférence les uns après les autres et pas tous en même temps (ie ne pas spammer le forum).
* Inclure directement les morceaux de code, les captures d'écran et autres images directement dans le post. Les liens vers les pastebin, les bitly et autres sites tierces seront systématiquement supprimés.
* Comme tout forum communautaire, le support est fait bénévolement par les membres. Si vous avez besoin d'un support commercial, vous pouvez contacter le service commercial Tranquil IT au 02.40.97.57.55
olaplanche
Messages : 173
Inscription : 26 janv. 2017 - 11:11

24 sept. 2020 - 13:19

Bonjour,

Je vous propose mon paquet pour l'installation de MATLAB 2013, il me semble avoir vu que le principe n'avait pas changé pour les versions plus récentes, donc ça devrait pouvoir rendre service à certains d'entre vous. J'ai fait le choix de générer les fichiers textes d'installation et désinstallation silencieuse directement dans le paquet et je ne traite pas l'activation de la licence car il s'agit de licence monoposte :

Code : Tout sélectionner

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

uninstallkey = []

def install():
    print('installing wapt-MatlabR2013b')
    import tempfile
    import codecs
    pathinstallbin = makepath(basedir,'Matlab_R2013b_x64','bin','win64')
    pathinstallfile = makepath(tempfile.gettempdir(),'unattended.txt')
    data = ur"""##################################################################
##
## Use this file to specify parameters required by the installer at runtime.
##
## Instructions for using this file.
##
## 1. Create a copy of this template file and fill in the required
##    information.
##
## 2. Uncomment only those lines that start with a single '#'
##    and set the desired values. All allowed values for the
##    parameters are defined in the comments section for each
##    parameter.
##
## 3. Launch the installer from the command line, using the -inputFile option
##    to specify the name of your installer initialization file.
##
##    (Windows) setup.exe -inputFile <file_name>
##    (Mac/Unix) install -inputFile <file_name>
##
## NOTE:
##    If you want to run the activation application in silent
##    mode immediately after the installer completes, you must create
##    an activation initialization file and specify its name as the
##    value of the activationPropertiesFile= option. You can also
##    pass the name of the activation initialization file to the
##    installer using the -activationPropertiesFile command line
##    option.
##
##################################################################
##
##
## SPECIFY INSTALLATION FOLDER
##
## Example:
##        (Windows) destinationFolder=C:\Program Files\MATLAB\RXXXX
##        (Unix) destinationFolder=/usr/local/RXXXX
##        (Mac) destinationFolder=/Applications
##
## Set the desired value for destinationFolder and
## uncomment the line.

destinationFolder=c:\Program Files\MATLAB\R2013b

##
## SPECIFY FILE INSTALLATION KEY
##
## Example: fileInstallationKey=xxxxx-xxxxx-xxxxx-xxxxx.....
##
## Set the desired value for fileInstallationKey and
## uncomment the line.
##
fileInstallationKey=xxxxx-xxxxx-xxxxx-xxxxx.....

##
## ACCEPT LICENSE AGREEMENT
##
## You must agree to the license agreement to install MathWorks products.
## The license agreement can be found in the license.txt file at the
## root level of the installation DVD.
##
## Example: agreeToLicense=yes
##
## Set agreeToLicense value to yes or no and
## uncomment the line.

agreeToLicense=yes

##
## SPECIFY OUTPUT LOG
##
## Specify full path of file into which you want the results of the
## installation to be recorded.
##
## Example:
##            (Windows) outputFile=C:\TEMP\mathworks_<user_name>.log
##            (Unix/Mac) outputFile=/tmp/mathworks_<user_name>.log
##
## Set the desired value for outputFile and
## uncomment the line.

# outputFile=

## SPECIFY INSTALLER MODE
##
## interactive: Run the installer GUI, waiting for user input on all
##              dialog boxes.
##
## silent:      Run the installer without displaying the GUI.
##
## automated:   Run the installer GUI, displaying all dialog boxes, but only
##              waiting for user input on dialogs that are missing required
##              input.
##
## Set mode value to either interactive, silent, or automated and
## uncomment the line.

mode=silent

## SPECIFY LENGTH OF TIME DIALOG BOXES ARE DISPLAYED
##
## Specify how long the installer dialog boxes are displayed, in milliseconds.
##
## NOTE: Use this value only if you set the installer mode to automated.
##
## By default, the dialog boxes display on the screen for one second.
##
## Example: (To specify a value of 1 second.) automatedModeTimeout=1000
##
## Set the desired value for automatedModeTimeout and
## uncomment the line.

# automatedModeTimeout=3000

## SPECIFY ACTIVATION PROPERTIES FILE (For non-network license types only)
##
## Enter the path to an existing file that contains properties to configure
## the activation process.

# activationPropertiesFile=

########## Begin: Options for Network License Types #########
##
## SPECIFY PATH TO LICENSE FILE (Required for network license types only)
##
## This value is required when installing either the License Manager or when
## installing as a Network End-User
## Example:
##            (Windows) licensePath=C:\TEMP\license.dat
##            (Unix) licensePath=/tmp/license.dat
## Set the desired value for licensePath and
## uncomment the line.

# licensePath=

## CHOOSE TO INSTALL LICENSE MANAGER (For network license types only)
##
## Installs license manager files to disk.
##
## NOTE: You only need to install the license manager files
## on your license server.
##
## Set lmgrFiles value to true or false and
## uncomment the line.

# lmgrFiles=

## INSTALL LICENSE MANAGER AS A SERVICE (For network license types only)
##
## Configure the license manager as a service on Windows.
##
## NOTE: Not applicable for Unix or Mac.
##
## NOTE: The lmgr_files option (set in previous step) must also be set to true.
##
## Set lmgrService value to true or false and
## uncomment the line.

# lmgrService=

########## End: Options for Network License Types #########



################# Begin - Windows Only Options ################
##
## CHOOSE TO SET FILE ASSOCIATIONS
##
## Set to true if you want the installer to associate file types used by MathWorks
## products to this version of MATLAB, or false if you do not want the installer to
## associate MathWorks file types with this version of MATLAB.
##
## Default value is true.
##
## Set setFileAssoc value to true or false and
## uncomment the line.

setFileAssoc=true

##
## CHOOSE TO CREATE WINDOWS DESKTOP SHORTCUT
##
## Set to true if you would like the installer to create a desktop shortcut icon
## when MATLAB is installed or false if you don't want the shortcut created.
##
## Set desktopShortcut value to true or false and
## uncomment the line.

desktopShortcut=false

## CHOOSE TO ADD SHORTCUT TO WINDOWS START MENU
##
## Set to true if you would like the installer to create a Start Menu shortcut
## icon when MATLAB is installed or false if you don't want the shortcut created.
##
## Set startMenuShortcut value to true or false and
## uncomment the line.

startMenuShortcut=true

## CREATE a MATLAB Startup Accelerator task
##
## The MATLAB Startup Accelerator installer creates a
## system task to preload MATLAB into the system’s cache
## for faster startup.
##
## NOTE: By default, a MATLAB Startup Accelerator task will
## automatically be created.
##
## If you want a MATLAB Startup Accelerator task to be created,
## do not edit this section.
##
## Set createAccelTask value to false if you do not want to
## create an Accelerator task and uncomment the line.

createAccelTask=false

################ End - Windows Only Options ################


## SPECIFY PRODUCTS YOU WANT TO INSTALL
##
## By default, the installer installs all the products and
## documentation for which you are licensed. Products you are not licensed for
## are not installed, even if they are listed here.
##
## Note:
## 1. To automatically install all your licensed products, do not edit
##    any lines in this section.
##
## 2. To install a specific product or a subset of products for
##    which you are licensed, uncomment the line for the product(s) you want
##    to install.

#product.Aerospace_Blockset
#product.Aerospace_Toolbox
#product.Bioinformatics_Toolbox
#product.Communications_System_Toolbox
#product.Computer_Vision_System_Toolbox
#product.Control_System_Toolbox
#product.Curve_Fitting_Toolbox
#product.DO_Qualification_Kit
#product.DSP_System_Toolbox
#product.Data_Acquisition_Toolbox
#product.Database_Toolbox
#product.Datafeed_Toolbox
#product.Econometrics_Toolbox
#product.Embedded_Coder
#product.Filter_Design_HDL_Coder
#product.Financial_Instruments_Toolbox
#product.Financial_Toolbox
#product.Fixed_Point_Designer
#product.Fuzzy_Logic_Toolbox
#product.Gauges_Blockset
#product.Global_Optimization_Toolbox
#product.HDL_Coder
#product.HDL_Verifier
#product.IEC_Certification_Kit
#product.Image_Acquisition_Toolbox
#product.Image_Processing_Toolbox
#product.Instrument_Control_Toolbox
#product.MATLAB
#product.MATLAB_Builder_EX
#product.MATLAB_Builder_JA
#product.MATLAB_Builder_NE
#product.MATLAB_Coder
#product.MATLAB_Compiler
#product.MATLAB_Distributed_Computing_Server
#product.MATLAB_Production_Server
#product.MATLAB_Report_Generator
#product.Mapping_Toolbox
#product.Model_Predictive_Control_Toolbox
#product.Model_Based_Calibration_Toolbox
#product.Neural_Network_Toolbox
#product.OPC_Toolbox
#product.Optimization_Toolbox
#product.Parallel_Computing_Toolbox
#product.Partial_Differential_Equation_Toolbox
#product.Phased_Array_System_Toolbox
#product.Polyspace_Bug_Finder
#product.Polyspace_Code_Prover
#product.RF_Toolbox
#product.Real_Time_Windows_Target
#product.Robust_Control_Toolbox
#product.Signal_Processing_Toolbox
#product.SimBiology
#product.SimDriveline
#product.SimElectronics
#product.SimEvents
#product.SimHydraulics
#product.SimMechanics
#product.SimPowerSystems
#product.SimRF
#product.Simscape
#product.Simulink
#product.Simulink_3D_Animation
#product.Simulink_Code_Inspector
#product.Simulink_Coder
#product.Simulink_Control_Design
#product.Simulink_Design_Optimization
#product.Simulink_Design_Verifier
#product.Simulink_PLC_Coder
#product.Simulink_Report_Generator
#product.Simulink_Verification_and_Validation
#product.Spreadsheet_Link_EX
#product.Stateflow
#product.Statistics_Toolbox
#product.Symbolic_Math_Toolbox
#product.System_Identification_Toolbox
#product.SystemTest
#product.Trading_Toolbox
#product.Vehicle_Network_Toolbox
#product.Wavelet_Toolbox
#product.xPC_Target
#product.xPC_Target_Embedded_Option
"""
    fichier = codecs.open(pathinstallfile, "w", encoding='mbcs')
    fichier.write(data)
    fichier.close()
    install_exe_if_needed("%s\setup.exe" % pathinstallbin,silentflags='-inputfile %s' % pathinstallfile,key='Matlab R2013b',min_version='8.2',killbefore='matlab.exe',timeout=900)
    uninstallkey.remove('Matlab R2013b')

def uninstall():
    print('uninstalling wapt-MatlabR2013b')
    import tempfile
    pathuninstallbin = makepath(programfiles64,'MATLAB','R2013b','uninstall','bin','win64')
    pathuninstallfile = makepath(tempfile.gettempdir(),'uninstaller_input.txt')
    data = ur"""##################################################################
##
## Use this file to specify parameters required by the uninstaller at runtime.
##
## Instructions for using this file.
##
## 1. Create a copy of this template file and fill in the required
##    information.
##
## 2. Uncomment only those lines that start with a single '#'
##    and set the desired values. All allowed values for the
##    parameters are defined in the comments section for each
##    parameter.
##
## 3. Launch the uninstaller from the command line, using the -inputFile option
##    to specify the name of your uninstaller initialization file.
##
##    (Windows) uninstall.exe -inputFile <file_name>
##
##################################################################
##
## SPECIFY OUTPUT LOG
##
## Specify full path of file into which you want the results of the
## uninstallation to be recorded.
##
## Example:
##            (Windows) outputFile=C:\TEMP\mathworks_<user_name>.log
##
## Set the desired value for outputFile
## and uncomment the line.

# outputFile=

## SPECIFY UNINSTALLER MODE
##
## interactive: Run the uninstaller GUI, waiting for user input on all dialog boxes.
##
## silent:      Run the uninstaller without displaying the GUI.
##
## automated:  Run the uninstaller GUI, displaying all dialog boxes, but only
##             waiting for user input on dialogs that are missing required input.
##
## Set mode value to either interactive, silent, or automated and
## uncomment the line.

mode=silent

## SET PREFS
##
## Set to true to uninstall your MATLAB preferences when uninstalling MATLAB.
##
## Set prefs value to true or false and uncomment the line.

prefs=true

## SPECIFY LENGTH OF TIME DIALOG BOXES ARE DISPLAYED
##
## Specify how long the uninstaller dialog boxes are displayed, in milliseconds.
##
## NOTE: Use this value only if you set the uninstaller mode to automated.
##
## By default, the dialog boxes display on the screen for one second.
##
## Example: (To specify a value of 1 second.) timeout=1000
##
## Set the desired value for timeout and uncomment the line.

# timeout=

## SPECIFY PRODUCTS YOU WANT TO UNINSTALL
##
## By default, the uninstaller uninstalls all the products and
## documentation that are installed.
##
## Note:
## 1. To automatically uninstall all installed products, do not edit
##    any lines in this section.
##
## 2. To uninstall a specific product or a subset of products
##    that are installed, uncomment the line for the product(s) you want
##    to uninstall.

#product.Aerospace_Blockset
#product.Aerospace_Toolbox
#product.Bioinformatics_Toolbox
#product.Communications_System_Toolbox
#product.Computer_Vision_System_Toolbox
#product.Control_System_Toolbox
#product.Curve_Fitting_Toolbox
#product.DO_Qualification_Kit
#product.DSP_System_Toolbox
#product.Data_Acquisition_Toolbox
#product.Database_Toolbox
#product.Datafeed_Toolbox
#product.Econometrics_Toolbox
#product.Embedded_Coder
#product.Filter_Design_HDL_Coder
#product.Financial_Instruments_Toolbox
#product.Financial_Toolbox
#product.Fixed_Point_Designer
#product.Fuzzy_Logic_Toolbox
#product.Gauges_Blockset
#product.Global_Optimization_Toolbox
#product.HDL_Coder
#product.HDL_Verifier
#product.IEC_Certification_Kit
#product.Image_Acquisition_Toolbox
#product.Image_Processing_Toolbox
#product.Instrument_Control_Toolbox
#product.MATLAB
#product.MATLAB_Builder_EX
#product.MATLAB_Builder_JA
#product.MATLAB_Builder_NE
#product.MATLAB_Coder
#product.MATLAB_Compiler
#product.MATLAB_Distributed_Computing_Server
#product.MATLAB_Production_Server
#product.MATLAB_Report_Generator
#product.Mapping_Toolbox
#product.Model_Predictive_Control_Toolbox
#product.Model_Based_Calibration_Toolbox
#product.Neural_Network_Toolbox
#product.OPC_Toolbox
#product.Optimization_Toolbox
#product.Parallel_Computing_Toolbox
#product.Partial_Differential_Equation_Toolbox
#product.Phased_Array_System_Toolbox
#product.Polyspace_Bug_Finder
#product.Polyspace_Code_Prover
#product.RF_Toolbox
#product.Real_Time_Windows_Target
#product.Robust_Control_Toolbox
#product.Signal_Processing_Toolbox
#product.SimBiology
#product.SimDriveline
#product.SimElectronics
#product.SimEvents
#product.SimHydraulics
#product.SimMechanics
#product.SimPowerSystems
#product.SimRF
#product.Simscape
#product.Simulink
#product.Simulink_3D_Animation
#product.Simulink_Code_Inspector
#product.Simulink_Coder
#product.Simulink_Control_Design
#product.Simulink_Design_Optimization
#product.Simulink_Design_Verifier
#product.Simulink_PLC_Coder
#product.Simulink_Report_Generator
#product.Simulink_Verification_and_Validation
#product.Spreadsheet_Link_EX
#product.Stateflow
#product.Statistics_Toolbox
#product.Symbolic_Math_Toolbox
#product.System_Identification_Toolbox
#product.SystemTest
#product.Trading_Toolbox
#product.Vehicle_Network_Toolbox
#product.Wavelet_Toolbox
#product.xPC_Target
#product.xPC_Target_Embedded_Option

"""
    fichier = open(pathuninstallfile, "w")
    fichier.write(data)
    fichier.close()
    run(r'"%s\uninstall.exe" -inputfile %s' % (pathuninstallbin,pathuninstallfile))
    remove_tree(makepath(programfiles64,'MATLAB'))
- Version de WAPT installée : 2.3.0.13516 Enterprise
- OS du serveur : Linux / Debian Buster
- OS de la machine d'administration/création des paquets : Windows 10
Verrouillé