Another variant of windows install, using a dynamically created .bat file.
This commit is contained in:
parent
fbcb616086
commit
2b82260927
2 changed files with 21 additions and 3 deletions
|
|
@ -1 +0,0 @@
|
||||||
@"python" "bin\evennia.py" %*
|
|
||||||
23
setup.py
23
setup.py
|
|
@ -1,8 +1,11 @@
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||||
|
|
||||||
|
VERSION_PATH = os.path.join('evennia', 'VERSION.txt')
|
||||||
|
|
||||||
|
|
||||||
def get_requirements():
|
def get_requirements():
|
||||||
"""
|
"""
|
||||||
|
|
@ -17,7 +20,23 @@ def get_requirements():
|
||||||
reqs.append(line)
|
reqs.append(line)
|
||||||
return reqs
|
return reqs
|
||||||
|
|
||||||
VERSION_PATH = os.path.join('evennia', 'VERSION.txt')
|
|
||||||
|
def get_scripts():
|
||||||
|
"""
|
||||||
|
Determine which executable scripts should be added. For Windows,
|
||||||
|
this means creating a .bat file.
|
||||||
|
"""
|
||||||
|
execlist = []
|
||||||
|
if os.name == "nt":
|
||||||
|
# Windows
|
||||||
|
with open(os.path("bin", "evennia.bat"), "w") as bat_file:
|
||||||
|
bat_file.write("@\"%s\" \"%s\" %%*" % (sys.executable, os.path.join("bin/python.py")))
|
||||||
|
execlist.append("bin/evennia.bat")
|
||||||
|
else:
|
||||||
|
# Linux, Mac
|
||||||
|
execlist.append("bin/evennia")
|
||||||
|
execlist.append("bin/evennia_runner.py")
|
||||||
|
return execlist
|
||||||
|
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
|
|
@ -49,7 +68,7 @@ setup(
|
||||||
version=get_version(),
|
version=get_version(),
|
||||||
description='A full-featured MUD building toolkit.',
|
description='A full-featured MUD building toolkit.',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
scripts=['bin/evennia', 'bin/evennia.bat', 'bin/evennia_runner.py'],
|
scripts=get_scripts(),
|
||||||
install_requires=get_requirements(),
|
install_requires=get_requirements(),
|
||||||
package_data={'': package_data()},
|
package_data={'': package_data()},
|
||||||
zip_safe=False
|
zip_safe=False
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue