install.py

changeset 2383
e999256385bd
parent 2312
976dcb82c3e9
child 2411
aec0a8a6e548
child 2422
21509a6de6e0
--- a/install.py	Sat Feb 02 16:08:11 2013 +0100
+++ b/install.py	Sat Feb 02 18:34:31 2013 +0100
@@ -322,7 +322,9 @@
     # Remove the menu entry for Linux systems
     if sys.platform.startswith("linux"):
         for name in ["/usr/share/pixmaps/eric.png",
-                     "/usr/share/applications/eric5.desktop"]:
+                     "/usr/share/applications/eric5.desktop",
+                     "/usr/share/pixmaps/ericWeb.png",
+                     "/usr/share/applications/eric5_webbrowser.desktop"]:
             if os.path.exists(name):
                 os.remove(name)
     
@@ -427,6 +429,8 @@
 def installEric():
     """
     Actually perform the installation steps.
+    
+    @return result code (integer)
     """
     global distDir, doCleanup, cfg, progLanguages, sourceDir, configName
     
@@ -520,11 +524,11 @@
         
     except IOError as msg:
         sys.stderr.write('IOError: {0}\nTry install with admin rights.\n'.format(msg))
-        exit(7)
+        return(7)
         
     except OSError as msg:
         sys.stderr.write('OSError: {0}\nTry install with admin rights.\n'.format(msg))
-        exit(7)
+        return(7)
     
     # copy some text files to the doc area
     for name in ["LICENSE.GPL3", "THANKS", "changelog"]:
@@ -579,21 +583,27 @@
             dst = os.path.normpath(os.path.join(distDir, "usr/share/pixmaps"))
             if not os.path.exists(dst):
                 os.makedirs(dst)
-            shutilCopy(os.path.join(sourceDir, "icons", "default", "eric_2.png"),
+            shutilCopy(os.path.join(sourceDir, "icons", "default", "eric.png"),
                        os.path.join(dst, "eric.png"))
             dst = os.path.normpath(os.path.join(distDir, "usr/share/applications"))
             if not os.path.exists(dst):
                 os.makedirs(dst)
             shutilCopy(os.path.join(sourceDir, "eric5.desktop"), dst)
         else:
-            shutilCopy(os.path.join(sourceDir, "icons", "default", "eric_2.png"),
+            shutilCopy(os.path.join(sourceDir, "icons", "default", "eric.png"),
                 "/usr/share/pixmaps/eric.png")
             shutilCopy(os.path.join(sourceDir, "eric5.desktop"),
                 "/usr/share/applications")
+            shutilCopy(os.path.join(sourceDir, "icons", "default", "ericWeb48.png"),
+                "/usr/share/pixmaps/ericWeb.png")
+            shutilCopy(os.path.join(sourceDir, "eric5_webbrowser.desktop"),
+                "/usr/share/applications")
     
     # Create a Mac application bundle
     if sys.platform == "darwin":
         createMacAppBundle(cfg['ericDir'])
+    
+    return 0
 
 
 def createMacAppBundle(pydir):
@@ -1119,7 +1129,7 @@
             py_compile.compile(configName,
                                dfile=os.path.join(modDir, "eric5config.py"))
     print("\nInstalling eric5 ...")
-    installEric()
+    res = installEric()
     
     # do some cleanup
     try:
@@ -1135,7 +1145,7 @@
     print("\nInstallation complete.")
     print()
     
-    exit()
+    exit(res)
     
     
 if __name__ == "__main__":

eric ide

mercurial