- Add support for adding the base folder to PATH. - Only display one pop up window at a time in order to avoid confusion. - Add automatic updates feature: - Windows and Linux versions will be shipped with an updater program used to update both Artemis and the updater itself. - MacOs versions will not have the updater. Instead the user will be asked to download the new software version (if present) via browser.
34 lines
845 B
Python
34 lines
845 B
Python
import sys
|
|
from shutil import which
|
|
import os
|
|
import os.path
|
|
|
|
|
|
def _is_executable_version():
|
|
"""Return whether the binary version is running."""
|
|
return hasattr(sys, "_MEIPASS")
|
|
|
|
|
|
IS_BINARY = _is_executable_version()
|
|
|
|
|
|
def get_executable_path():
|
|
"""Check whether the executable is in the PATH folder.
|
|
|
|
Return the full path or just an ampty string if it is not found
|
|
in the PATH folder."""
|
|
path = which("Artemis")
|
|
if path is not None:
|
|
return os.path.dirname(path)
|
|
else: # Assume that the executable is in the cwd.
|
|
return os.curdir
|
|
|
|
|
|
def resource_path(relative_path):
|
|
"""Get absolute path to resource, works for dev and for PyInstaller."""
|
|
try:
|
|
base_path = sys._MEIPASS
|
|
except Exception:
|
|
base_path = os.path.abspath(".")
|
|
return os.path.join(base_path, relative_path)
|