Browse Source

Find nsis in any installed SDK

rdb 15 năm trước cách đây
mục cha
commit
d87550fd5a
1 tập tin đã thay đổi với 10 bổ sung3 xóa
  1. 10 3
      direct/src/p3d/DeploymentTools.py

+ 10 - 3
direct/src/p3d/DeploymentTools.py

@@ -784,9 +784,16 @@ class Installer:
         # Check if we have makensis first
         # Check if we have makensis first
         makensis = None
         makensis = None
         if (sys.platform.startswith("win")):
         if (sys.platform.startswith("win")):
-            for p in os.defpath.split(";") + os.environ["PATH"].split(";"):
-                if os.path.isfile(os.path.join(p, "makensis.exe")):
-                    makensis = os.path.join(p, "makensis.exe")
+            syspath = os.defpath.split(";") + os.environ["PATH"].split(";")
+            for p in set(syspath):
+                p1 = os.path.join(p, "makensis.exe")
+                p2 = os.path.join(os.path.dirname(p), "nsis", "makensis.exe")
+                if os.path.isfile(p1):
+                    makensis = p1
+                    break
+                elif os.path.isfile(p2):
+                    makensis = p2
+                    break
             if not makensis:
             if not makensis:
                 import pandac
                 import pandac
                 makensis = os.path.dirname(os.path.dirname(pandac.__file__))
                 makensis = os.path.dirname(os.path.dirname(pandac.__file__))