Source : https://support.ebp.com/hc/fr/articles/ ... 17-Express et https://www.itninja.com/blog/view/unatt ... tudio-2012
Plus besoin de psexec
Fichier control :
Code : Tout sélectionner
package : wapt-microsoft-sql-server-2017-express-ebp
version : 14.0.1000.169-11
architecture : all
section : base
priority : optional
name : Microsoft SQL server 2017 express EBP
categories :
maintainer : olaplanche
description : Instance EBP Microsoft SQL server 2017 express
depends :
conflicts :
maturity : PREPROD
locale : fr
target_os : windows
min_wapt_version :
sources : https://go.microsoft.com/fwlink/?linkid=853017
installed_size :
impacted_process :
description_fr :
description_pl :
description_de :
description_es :
description_pt :
description_it :
description_nl :
description_ru :
audit_schedule :
editor : Microsoft
keywords :
licence :
homepage :
package_uuid : 3420d2f4-356b-41fa-a331-28dcbe80deb1
valid_from :
valid_until :
forced_install_on :
changelog :
min_os_version :
max_os_version :
icon_sha256sum :
Code : Tout sélectionner
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
# Defining variables
silent_args = '/IACCEPTPYTHONLICENSETERMS="True" ' \
'/ACTION="Install" ' \
'/ROLE="AllFeatures_WithDefaults" ' \
'/SUPPRESSPRIVACYSTATEMENTNOTICE="True" ' \
'/IACCEPTROPENLICENSETERMS="True" ' \
'/ENU="False" ' \
'/IACCEPTSQLSERVERLICENSETERMS="True" ' \
'/QUIET="True" ' \
'/QUIETSIMPLE="False" ' \
'/UpdateEnabled="False" ' \
'/USEMICROSOFTUPDATE="False" ' \
'/UpdateSource="MU" ' \
'/FEATURES=SQLENGINE,REPLICATION ' \
'/HELP="False" ' \
'/INDICATEPROGRESS="False" ' \
'/X86="False" ' \
'/INSTANCENAME="EBP" ' \
'/INSTALLSHAREDDIR="C:\Program Files\Microsoft SQL Server" ' \
'/INSTALLSHAREDWOWDIR="C:\Program Files (x86)\Microsoft SQL Server" ' \
'/INSTANCEID="EBP" ' \
'/SQLTELSVCACCT="NT Service\SQLTELEMETRY$EBP" ' \
'/SQLTELSVCSTARTUPTYPE="Automatic" ' \
'/INSTANCEDIR="C:\Program Files\Microsoft SQL Server" ' \
'/AGTSVCACCOUNT="AUTORITE NT\SERVICE RÉSEAU" ' \
'/AGTSVCSTARTUPTYPE="Disabled" ' \
'/COMMFABRICPORT="0" ' \
'/COMMFABRICNETWORKLEVEL="0" ' \
'/COMMFABRICENCRYPTION="0" ' \
'/MATRIXCMBRICKCOMMPORT="0" ' \
'/SQLSVCSTARTUPTYPE="Automatic" ' \
'/FILESTREAMLEVEL="0" ' \
'/ENABLERANU="True" ' \
'/SQLCOLLATION="French_CI_AS" ' \
'/SQLSVCACCOUNT="NT Service\MSSQL$EBP" ' \
'/SQLSVCINSTANTFILEINIT="False" ' \
'/SQLSYSADMINACCOUNTS="BUILTIN\Administrators" ' \
'/SECURITYMODE="SQL" ' \
'/SAPWD="@ebp78EBP" ' \
'/SQLTEMPDBFILECOUNT="1" ' \
'/SQLTEMPDBFILESIZE="8" ' \
'/SQLTEMPDBFILEGROWTH="64" ' \
'/SQLTEMPDBLOGFILESIZE="8" ' \
'/SQLTEMPDBLOGFILEGROWTH="64" ' \
'/ADDCURRENTUSERASSQLADMIN="True" ' \
'/TCPENABLED="1" ' \
'/NPENABLED="1" ' \
'/BROWSERSVCSTARTUPTYPE="Automatic"'
def install():
# Initializing variables
package_version = control.version.split("-")[0]
# Installing the package
print('Software %s' % control.package)
install_exe_if_needed('sqlexpress2017r1bin_x64\SETUP.EXE',silentflags=silent_args,min_version=package_version)
def uninstall():
# Initializing variables
silentargs_SQL = '/ACTION="Uninstall" /SUPPRESSPRIVACYSTATEMENTNOTICE="False" /ENU="False" /QUIET="True" /QUIETSIMPLE="False" /FEATURES=SQLENGINE,REPLICATION /HELP="False" /INDICATEPROGRESS="False" /X86="False" /INSTANCENAME="EBP"' # Paramètres pour la désinstallation silencieuse de l'instance SQL EBP
# Uninstalling the package
print('Uninstalling %s' % control.package)
run(r'"%s\Microsoft SQL Server\140\Setup Bootstrap\SQL2017\setup.exe" %s' % (programfiles64,silentargs_SQL),timeout=1200) # Instance SQL EBP
print('Uninstalling Microsoft ODBC Driver 13 for SQL Server')
run('"msiexec.exe" /X{2A35FB4B-FF5D-4C40-BABB-84397E57A8B0} /qn') # Microsoft ODBC Driver 13 for SQL Server
print('Uninstalling Service de langage T-SQL Microsoft SQL Server 2017')
run('"msiexec.exe" /X{7051E3D8-7B59-4E38-A94F-BBA621D98267} /qn') # Service de langage T-SQL Microsoft SQL Server 2017
print('Uninstalling Microsoft SQL Server 2012 Native Client')
run('"msiexec.exe" /X{BD124715-29D5-4A2E-82EE-0F4392D9CFE3} /qn') # Microsoft SQL Server 2012 Native Client