Add Windows build script and update README with build instructions
This commit is contained in:
@@ -9,6 +9,16 @@ PATCH_CONFIG_FILE_NAME = "gcode_patches.ini"
|
||||
|
||||
|
||||
def program_root() -> Path:
|
||||
compiled = globals().get("__compiled__")
|
||||
if compiled is not None and getattr(compiled, "onefile", False):
|
||||
containing_dir = getattr(compiled, "containing_dir", None)
|
||||
if containing_dir:
|
||||
return Path(containing_dir).resolve()
|
||||
|
||||
original_argv0 = getattr(compiled, "original_argv0", None)
|
||||
if original_argv0:
|
||||
return Path(original_argv0).resolve().parent
|
||||
|
||||
if getattr(sys, "frozen", False):
|
||||
return Path(sys.executable).resolve().parent
|
||||
return Path(__file__).resolve().parents[1]
|
||||
|
||||
Reference in New Issue
Block a user