Fix a bug in the *.spec files and also apply the following major changes:
- 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.
This commit is contained in:
33
src/executable_utilities.py
Normal file
33
src/executable_utilities.py
Normal file
@@ -0,0 +1,33 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user