Upperm en partant de ton travail (félicitation d'ailleurs) voici une autre proposition qui n'utilise pas les fichier RSP à l'installation et désinstallation. En bonus, plus besoin de manipuler les clés de registre.
sources pour l'absence des fichiers RSP :
http://www.dadbm.com/oracle-database-cl ... onse-file/
Le code s'en trouve largement simplifié.
Reste à tester la désinstallation quand deux clients sont installé.. Est ce que les deux sont supprimé à la sauvage ou pas ??? Tel est la question
Ps : dans l'arborescence du dossier Oracle, j'ai remis le sous-dossier "client" tel qu'existant dans les archives officielle proposée par Oracle. Le code est à adapter en conséquence.
Code : Tout sélectionner
# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = []
ORACLE_BASE = r'C:\Oracle'
ORACLE_HOME = r'C:\Oracle\product\11.2.0\client_1'
def install():
if not isfile(makepath(ORACLE_HOME,'bin\oraclient11.dll')):
# récupérer le chemin du script
currentpath = os.path.dirname(os.path.realpath(__file__))
print("Le chemin du script est : " + currentpath)
print(r'Installation Oracle 11')
run(r'Oracle\Client\setup.exe -silent -force -nowait -waitforcompletion FROM_LOCATION=%s\Oracle\client\stage\products.xml oracle.install.client.installType="Runtime" ORACLE_HOME="%s" ORACLE_BASE="%s" DECLINE_SECURITY_UPDATES=true' % (currentpath, ORACLE_HOME, ORACLE_BASE),shell=False,accept_returncodes=[0,-4])
else:
print(r'Oracle 11 est deja installe')
if isfile(makepath(ORACLE_HOME,'bin\oraclient11.dll')):
print(r'Installation du fichier TnsName')
filecopyto('Oracle\\tnsnames.ora',makepath(ORACLE_HOME,'network\\admin'))
# print (r'Installation des drivers ODBC')
# run_powershell('Add-OdbcDsn -DriverName "Microsoft ODBC for Oracle" -DsnType System -Name MELODIE -Platform 32-bit -SetPropertyValue "Server=arpetcp"')
# run_powershell('Add-OdbcDsn -DriverName "Microsoft ODBC for Oracle" -DsnType System -Name ARPEGE -Platform 32-bit -SetPropertyValue "Server=arpetcp"')
# run_powershell('Add-OdbcDsn -DriverName "Microsoft ODBC for Oracle" -DsnType System -Name REQUIEM -Platform 32-bit -SetPropertyValue "Server=arpetcp"')
# run_powershell('Add-OdbcDsn -DriverName "Microsoft ODBC for Oracle" -DsnType System -Name MAESTRO -Platform 32-bit -SetPropertyValue "Server=arpetcp"')
def uninstall():
if isfile(makepath(ORACLE_HOME,'deinstall','deinstall.bat')):
print(r'Desinstallation Oracle 11')
run(r'%s\deinstall\deinstall.bat -silent' % ORACLE_HOME)