uninstall.py

changeset 6214
89a53d80e729
parent 6188
5a6ae3be31e6
child 6303
ec9ebaf206fb
--- a/uninstall.py	Wed Apr 04 17:21:51 2018 +0200
+++ b/uninstall.py	Wed Apr 04 19:48:25 2018 +0200
@@ -122,21 +122,54 @@
     global pyModDir
     
     # Remove the menu entry for Linux systems
-    if sys.platform.startswith("linux") and os.getuid() == 0:
-        if includePythonVariant:
-            marker = PythonMarkers[sys.version_info.major]
-        else:
-            marker = ""
-        for name in ["/usr/share/applications/eric6" + marker + ".desktop",
-                     "/usr/share/appdata/eric6" + marker + ".appdata.xml",
-                     "/usr/share/applications/eric6_webbrowser" + marker +
-                     ".desktop",
-                     "/usr/share/applications/eric6_browser" + marker +
-                     ".desktop",
-                     "/usr/share/pixmaps/eric" + marker + ".png",
-                     "/usr/share/pixmaps/ericWeb" + marker + ".png"]:
-            if os.path.exists(name):
-                os.remove(name)
+    if sys.platform.startswith("linux"):
+        if os.getuid() == 0:
+            for name in ["/usr/share/pixmaps/eric.png",
+                         "/usr/share/pixmaps/ericWeb.png"]:
+                if os.path.exists(name):
+                    os.remove(name)
+            if includePythonVariant:
+                marker = PythonMarkers[sys.version_info.major]
+            else:
+                marker = ""
+            for name in [
+                "/usr/share/applications/eric6" + marker + ".desktop",
+                "/usr/share/appdata/eric6" + marker + ".appdata.xml",
+                "/usr/share/metainfo/eric6" + marker + ".appdata.xml",
+                "/usr/share/applications/eric6_webbrowser" + marker +
+                ".desktop",
+                "/usr/share/applications/eric6_browser" + marker +
+                ".desktop",
+                "/usr/share/pixmaps/eric" + marker + ".png",
+                "/usr/share/pixmaps/ericWeb" + marker + ".png",
+            ]:
+                if os.path.exists(name):
+                    os.remove(name)
+        elif os.getuid() >= 1000:
+            # it is assumed that user ids start at 1000
+            for name in ["~/.local/share/pixmaps/eric.png",
+                         "~/.local/share/pixmaps/ericWeb.png"]:
+                path = os.path.expanduser(name)
+                if os.path.exists(path):
+                    os.remove(path)
+            if includePythonVariant:
+                marker = PythonMarkers[sys.version_info.major]
+            else:
+                marker = ""
+            for name in [
+                "~/.local/share/applications/eric6" + marker + ".desktop",
+                "~/.local/share/appdata/eric6" + marker + ".appdata.xml",
+                "~/.local/share/metainfo/eric6" + marker + ".appdata.xml",
+                "~/.local/share/applications/eric6_webbrowser" + marker +
+                ".desktop",
+                "~/.local/share/applications/eric6_browser" + marker +
+                ".desktop",
+                "~/.local/share/pixmaps/eric" + marker + ".png",
+                "~/.local/share/pixmaps/ericWeb" + marker + ".png",
+            ]:
+                path = os.path.expanduser(name)
+                if os.path.exists(path):
+                    os.remove(path)
     
     # Remove the wrapper scripts
     rem_wnames = [

eric ide

mercurial