main.py aktualisiert
This commit is contained in:
parent
eafe1d4556
commit
689a2a8427
7
main.py
7
main.py
|
|
@ -6,9 +6,6 @@ import subprocess
|
|||
import shutil
|
||||
|
||||
def resource_path(relative_path: str) -> str:
|
||||
"""
|
||||
Get absolute path to resource, works for dev and for PyInstaller bundle.
|
||||
"""
|
||||
if hasattr(sys, "_MEIPASS"):
|
||||
return os.path.join(sys._MEIPASS, relative_path)
|
||||
return os.path.join(os.path.abspath("."), relative_path)
|
||||
|
|
@ -34,8 +31,7 @@ def extract_and_run():
|
|||
if not os.path.isfile(exe_path):
|
||||
print("app.exe not found inside extracted payload!")
|
||||
return 2
|
||||
|
||||
# Run the extracted executable
|
||||
#run
|
||||
process = subprocess.Popen(
|
||||
[exe_path],
|
||||
cwd=temp_dir,
|
||||
|
|
@ -46,7 +42,6 @@ def extract_and_run():
|
|||
return process.returncode
|
||||
|
||||
finally:
|
||||
# Cleanup after execution
|
||||
try:
|
||||
shutil.rmtree(temp_dir, ignore_errors=True)
|
||||
except Exception:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user