1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-15 12:59:06 +00:00

Fix qemu binary lookup in frozen OSX application

https://github.com/GNS3/gns3-gui/issues/496
This commit is contained in:
Julien Duponchelle 2015-07-05 21:53:47 +02:00
parent 33d6fbde21
commit dfe95cce63

View File

@ -75,7 +75,8 @@ class Qemu(BaseManager):
paths.update(["/usr/bin", "/usr/local/bin", "/opt/local/bin"])
if hasattr(sys, "frozen"):
try:
paths.add(os.path.abspath(os.path.join(os.getcwd(), "../../../qemu/bin/")))
exec_dir = os.path.dirname(os.path.abspath(sys.executable))
paths.add(os.path.abspath(os.path.join(exec_dir, "../Resources/qemu/bin/")))
# If the user run the server by hand from outside
except FileNotFoundError:
paths.add("/Applications/GNS3.app/Contents/Resources/qemu/bin")