mirror of
https://git.srhtnin.garden/sarah/SaraSuite.git
synced 2026-10-15 10:33:17 +02:00
SaraSuite.app for macOS, built on Linux; 1.3.0
This commit is contained in:
1 parent
ca04dcd4a7
commit
873a2d9ba0
5 files changed
+246
-18
No files matched your search
+5
-6
@@ -9,8 +9,9 @@ restarts into it. The file keeps its path, so its menu entry keeps working.
|
||||
- Linux: the download is renamed over the running AppImage (allowed).
|
||||
- Windows: a running .exe can't be overwritten but can be renamed, so the
|
||||
old one becomes SaraSuite.old.exe (deleted on the next start).
|
||||
- macOS: SaraSuite.app (a folder) comes zipped; it's unpacked next to the
|
||||
running one, which is renamed aside and deleted once the new one is in place.
|
||||
- macOS: SaraSuite.app (a folder, Packaging/BuildMacApp.py) comes zipped; it's
|
||||
unpacked next to the running one, which is renamed aside and deleted once
|
||||
the new one is in place.
|
||||
"""
|
||||
|
||||
import os
|
||||
@@ -23,7 +24,7 @@ from pathlib import Path
|
||||
from typing import Callable, Optional
|
||||
from urllib.parse import urlsplit
|
||||
|
||||
from Core import AppName, AppVersion, ChildEnvironment, IsFrozen, IsMac, IsWindows, LoadConfig
|
||||
from Core import AppName, AppVersion, ChildEnvironment, IsFrozen, IsMac, IsWindows, LoadConfig, MacApp
|
||||
from Sources import GetBytes, GetJson, SourceError
|
||||
|
||||
AssetName = f"{AppName}.exe" if IsWindows else f"{AppName}-macOS.zip" if IsMac else f"{AppName}-x86_64.AppImage"
|
||||
@@ -42,9 +43,7 @@ def RunningAppImage() -> Optional[Path]:
|
||||
if IsWindows:
|
||||
return Path(sys.executable) if IsFrozen else None
|
||||
if IsMac:
|
||||
# .../SaraSuite.app/Contents/MacOS/SaraSuite
|
||||
Bundle = Path(sys.executable).resolve().parents[2]
|
||||
return Bundle if IsFrozen and Bundle.suffix == ".app" else None
|
||||
return Path(MacApp) if MacApp.endswith(".app") else None
|
||||
Value = os.environ.get("APPIMAGE", "")
|
||||
return Path(Value) if Value else None
|
||||
|
||||
|
||||
Reference in new issue
Block a user