Bonjour,
J'ai fait un paquet pour le logiciel Dia, ce dernier s'installe
très bien. Par contre lors de la suppression du programme il me reste
dans "Program Files", le dossier "Dia" et tous ces sous-dossiers vides.
Effectivement lorsque l'on supprime "Dia" par Windows, le programme
demande si l'on veut supprimer l'ensemble des dossiers du programme.
Malheureusement il n'y a pas dans la fonction de désinstallation
automatique d'options concernant ce point.
J'ai donc rajouté à mon code une fonction remove_tree() mais celle ci ne
supprime pas le dossier "Dia" et je ne comprends pas pourquoi. Par
contre elle supprime tous les sous dossiers à l'intérieur.
J'ai testé avec la fonction os.path.exists ou IsDir avec un print pour
me dire si il trouvait le dossier et il indique que "oui"
Voici mon code :
*# -*- coding: utf-8 -*-
from setuphelpers import *
uninstallkey = ['Dia']
import os
def install():
print('Installation du logiciel Dia')
#Arreter le processus Dia avant la suppression
killalltasks('diaw.exe')
#Lancement de l installation
run('"Dia.exe" /S')
def uninstall():
print('Suppression du logiciel Dia')
#Arreter le processus Dia avant la suppression
killalltasks('diaw.exe')
#Suppression du dossier residuel dans Program Files
#La suppression ne fonctionne pas pour le moment
DirDia = (programfiles32 + r'\Dia')
if os.path.exists(DirDia):
remove_tree(DirDia)
*Mon contexte de test est le suivant : Je code avec PyScripter selon les
préco WAPT et je suis sur un Windows 7-64Bits
J'ai toujours le même résultat et du coup je ne comprends pas.
Pouvez vous m'aider ?
PS: Une deuxième petite question annexe :
Lors de la désinstallation d'un programme installé de la façon suivante :
Install_exe_if_needed('AdobeAIRInstaller.exe',silentflags='-silent
-eulaAccepted',key='{25A60C59-0FDC-4D73-81F4-D4A6D4E0CB92}',min_version=versionpaquet,killbefore=['iexplorer.exe','firefox.exe'])
Est ce que le Killbefore de l'installeur est exécuté avant de lancer la
suppression ?
--
OGOR Bruno
Daip de Brest