eric6/UI/UserInterface.py

changeset 7809
f5a61d073100
parent 7808
da107cd00f63
child 7813
5d0dbec7b815
--- a/eric6/UI/UserInterface.py	Thu Oct 22 17:59:54 2020 +0200
+++ b/eric6/UI/UserInterface.py	Thu Oct 22 19:42:29 2020 +0200
@@ -1466,7 +1466,6 @@
         """
         Public method to process the file containing installation information.
         """
-        # TODO: merge new data into info file stored in .eric
         import Globals
         
         installInfoFile = Globals.getInstallInfoFilePath()
@@ -1496,7 +1495,6 @@
                         installInfo["installed"] = True
                         installInfo["installed_on"] = installDateTime.strftime(
                             "%Y-%m-%d %H:%M:%S")
-                        installInfo["remarks"] = ""
                         installInfo["sudo"] = not os.access(
                             installInfo["eric"], os.W_OK)
                         with open(installInfoFile, "w") as infoFile:
@@ -1504,6 +1502,25 @@
                     except EnvironmentError:
                         # ignore this
                         pass
+        else:
+            changed = False
+            with open(installInfoFile, "r") as infoFile:
+                installInfo = json.load(infoFile)
+            
+            # 1. adapt stored file to latest format
+            if "install_cwd" not in installInfo:
+                installInfo["install_cwd"] = ""
+                installInfo["install_cwd_edited"] = False
+                changed = True
+            if "installed_on" not in installInfo:
+                installInfo["installed_on"] = ""
+                changed = True
+            
+            # 2. merge new data into stored file
+            # TODO: merge new data into info file stored in .eric
+            if changed:
+                with open(installInfoFile, "w") as infoFile:
+                    json.dump(installInfo, infoFile, indent=2)
     
     def __createDockWindow(self, name):
         """

eric ide

mercurial