uninstall.py

branch
maintenance
changeset 6273
0daf79d65080
parent 6214
89a53d80e729
child 6303
ec9ebaf206fb
diff -r 0a74c1efab70 -r 0daf79d65080 uninstall.py
--- a/uninstall.py	Mon Apr 02 12:04:56 2018 +0200
+++ b/uninstall.py	Tue May 01 12:03:52 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