changelog and generalization of updater exe
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
# Version 1.2.2
|
||||||
|
|
||||||
|
- Added 'Update events in snirf file (BLAZES)...' and renamed 'Update events in snirf file...' to 'Update events in snirf file (BORIS)...'
|
||||||
|
- The BLAZES option will assign events that are exported directly from the software [BLAZES](https://git.research.dezeeuw.ca/tyler/blazes)
|
||||||
|
- Moved the updating logic to a seperate file for better reusability and generalization
|
||||||
|
|
||||||
|
|
||||||
# Version 1.2.1
|
# Version 1.2.1
|
||||||
|
|
||||||
- Added a requirements.txt file to ensure compatibility
|
- Added a requirements.txt file to ensure compatibility
|
||||||
|
|||||||
@@ -18,11 +18,12 @@ import subprocess
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
PLATFORM_NAME = platform.system().lower()
|
PLATFORM_NAME = platform.system().lower()
|
||||||
|
APP_NAME = "flares"
|
||||||
|
|
||||||
if PLATFORM_NAME == 'darwin':
|
if PLATFORM_NAME == 'darwin':
|
||||||
LOG_FILE = os.path.join(os.path.dirname(sys.executable), "../../../flares_updater.log")
|
LOG_FILE = os.path.join(os.path.dirname(sys.executable), f"../../../{APP_NAME}_updater.log")
|
||||||
else:
|
else:
|
||||||
LOG_FILE = os.path.join(os.getcwd(), "flares_updater.log")
|
LOG_FILE = os.path.join(os.getcwd(), f"{APP_NAME}_updater.log")
|
||||||
|
|
||||||
|
|
||||||
def log(msg):
|
def log(msg):
|
||||||
@@ -147,7 +148,7 @@ def copy_update_files_darwin(src_folder, dest_folder, updater_name):
|
|||||||
|
|
||||||
def remove_quarantine(app_path):
|
def remove_quarantine(app_path):
|
||||||
script = f'''
|
script = f'''
|
||||||
do shell script "xattr -d -r com.apple.quarantine {shlex.quote(app_path)}" with administrator privileges with prompt "FLARES needs privileges to finish the update. (1/2)"
|
do shell script "xattr -d -r com.apple.quarantine {shlex.quote(app_path)}" with administrator privileges with prompt "{APP_NAME} needs privileges to finish the update. (1/2)"
|
||||||
'''
|
'''
|
||||||
try:
|
try:
|
||||||
subprocess.run(['osascript', '-e', script], check=True)
|
subprocess.run(['osascript', '-e', script], check=True)
|
||||||
@@ -162,7 +163,7 @@ def main():
|
|||||||
log(f"[Updater] sys.argv: {sys.argv}")
|
log(f"[Updater] sys.argv: {sys.argv}")
|
||||||
|
|
||||||
if len(sys.argv) != 3:
|
if len(sys.argv) != 3:
|
||||||
log("Invalid arguments. Usage: flares_updater <update_folder> <main_app_executable>")
|
log(f"Invalid arguments. Usage: {APP_NAME}_updater <update_folder> <main_app_executable>")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
update_folder = sys.argv[1]
|
update_folder = sys.argv[1]
|
||||||
@@ -215,7 +216,7 @@ def main():
|
|||||||
if PLATFORM_NAME == 'darwin':
|
if PLATFORM_NAME == 'darwin':
|
||||||
log(f'Attempting to delete {ppparent_dir}')
|
log(f'Attempting to delete {ppparent_dir}')
|
||||||
delete_path(ppparent_dir)
|
delete_path(ppparent_dir)
|
||||||
update_folder = os.path.join(sys.argv[1], "flares-darwin")
|
update_folder = os.path.join(sys.argv[1], f"{APP_NAME}-darwin")
|
||||||
copy_update_files_darwin(update_folder, pppparent_dir, updater_name)
|
copy_update_files_darwin(update_folder, pppparent_dir, updater_name)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user