From 2fe2aa6db7d402fe7afe9cc98ad9f4b0398b5ed0 Mon Sep 17 00:00:00 2001 From: Griatch Date: Mon, 2 Feb 2015 20:54:26 +0100 Subject: [PATCH] Made .bat file dynamically created again since it requires an absolute path. --- bin/unix/evennia | 3 +++ bin/windows/evennia.bat | 1 - bin/windows/evennia.py | 5 +++-- setup.py | 5 ++++- 4 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 bin/windows/evennia.bat diff --git a/bin/unix/evennia b/bin/unix/evennia index 7d24ac9e13..a4a86b143d 100755 --- a/bin/unix/evennia +++ b/bin/unix/evennia @@ -1,6 +1,9 @@ #! /usr/bin/python2.7 """ Linux launcher + +This is copied directly into the python bin directory and makes the +'evennia' program available on $PATH. """ import os, sys diff --git a/bin/windows/evennia.bat b/bin/windows/evennia.bat deleted file mode 100644 index 769d046059..0000000000 --- a/bin/windows/evennia.bat +++ /dev/null @@ -1 +0,0 @@ -@"python" "evennia.py" %* diff --git a/bin/windows/evennia.py b/bin/windows/evennia.py index 7d24ac9e13..653ea2eec6 100755 --- a/bin/windows/evennia.py +++ b/bin/windows/evennia.py @@ -1,6 +1,7 @@ -#! /usr/bin/python2.7 """ -Linux launcher +Windows launcher. This is called by a dynamically created .bat file in +the python bin directory and makes the 'evennia' program available on +the command %path%. """ import os, sys diff --git a/setup.py b/setup.py index 24d0c1b122..79971729dc 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,10 @@ def get_scripts(): this means creating a .bat file. """ if os.name == "nt": - return [os.path.join("bin", "windows", "evennia.bat"), os.path.join("bin", "windows", "evennia.py")] + batpath = os.path.join("bin", "windows", "evennia.bat") + with open(batpath, "w") as batfile: + batfile.write("@\"%s\" \"%s\" %%*" % (sys.executable, batpath)) + return [batpath] else: return [os.path.join("bin", "unix", "evennia")]