scripts/install.py

branch
maintenance
changeset 7607
dd1054be15aa
parent 7560
343db73c4842
parent 7584
328d92d8db48
child 7642
72721823d453
diff -r 707442ffadc3 -r dd1054be15aa scripts/install.py
--- a/scripts/install.py	Sat May 02 14:04:18 2020 +0200
+++ b/scripts/install.py	Sun May 31 17:26:14 2020 +0200
@@ -48,6 +48,8 @@
 defaultMacAppBundlePath = "/Applications"
 defaultMacPythonExe = "{0}/Resources/Python.app/Contents/MacOS/Python".format(
     sys.exec_prefix)
+if not os.path.exists(defaultMacPythonExe):
+    defaultMacPythonExe = ""
 macAppBundleName = defaultMacAppBundleName
 macAppBundlePath = defaultMacAppBundlePath
 macPythonExe = defaultMacPythonExe
@@ -1027,11 +1029,12 @@
     
     # 1. create desktop shortcuts
     regName = "Desktop"
-    desktopFolder = os.path.normpath(
-        os.path.expandvars(getWinregEntry(regName, regPath)))
-    for linkName, targetPath, iconPath in windowsDesktopEntries():
-        linkPath = os.path.join(desktopFolder, linkName)
-        createWindowsShortcut(linkPath, targetPath, iconPath)
+    desktopEntry = getWinregEntry(regName, regPath)
+    if desktopEntry:
+        desktopFolder = os.path.normpath(os.path.expandvars(desktopEntry))
+        for linkName, targetPath, iconPath in windowsDesktopEntries():
+            linkPath = os.path.join(desktopFolder, linkName)
+            createWindowsShortcut(linkPath, targetPath, iconPath)
     
     # 2. create start menu entry and shortcuts
     regName = "Programs"
@@ -1073,7 +1076,7 @@
         if not os.path.exists(directory):
             os.makedirs(directory)
     
-    if macPythonExe == defaultMacPythonExe:
+    if macPythonExe == defaultMacPythonExe and macPythonExe:
         starter = os.path.join(directories["exe"], "eric")
         os.symlink(macPythonExe, starter)
     else:

eric ide

mercurial