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 ?
Bonjour, vous pouvez essayer avec la fonction makepath pour le premier point
pour le deuxième point si je ne trompe pas, la notion de killbefore de la commande Install_exe_if_needed est seulement l'installation la desinstallation se fera par le processus windows coder lors de l'installation si il y en a une de coder ps : certainement dans HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\25A60C59-0FDC-4D73-81F4-D4A6D4E0CB92\QuietUninstallString
Cordialement
GUSTIN Mathieu
Chargé de Projet Service Numérique Educatif / Direction de l'Education Site de Poitiers - Région Nouvelle Aquitaine
m.gustin@nouvelle-aquitaine.fr 06 82 74 29 34
De : Bruno OGOR bogor@ac-rennes.fr A : wapt@lists.tranquil.it Date : 26/04/2017 14:43 Objet : [Wapt] Dossier Dia récalcitrant Envoyé par : "WAPT" wapt-bounces@lists.tranquil.it
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 ?