1 Commits
0.0.8 ... 0.0.9

Author SHA1 Message Date
a39184f28a Fix Compile Error
All checks were successful
Build and Upload Release (Windows EXE) / Build Windows EXE (release) Successful in 2m29s
2025-09-17 00:21:20 -04:00

View File

@@ -902,16 +902,19 @@ class SeaLoaderApp(tk.Tk):
# Create updater PowerShell script
ps_path = os.path.join(tmpdir, 'sealoader_updater.ps1')
ps = f"""
pid_val = os.getpid()
target_val = current_exe.replace("'", "''")
source_val = new_exe_path.replace("'", "''")
ps = """
$ErrorActionPreference = 'Stop'
$pidToWait = {os.getpid()}
$target = '{current_exe}'.Replace("'","''")
$source = '{new_exe_path}'.Replace("'","''")
while (Get-Process -Id $pidToWait -ErrorAction SilentlyContinue) { Start-Sleep -Milliseconds 200 }
$pidToWait = {pid}
$target = '{target}'.Replace("'","''")
$source = '{source}'.Replace("'","''")
while (Get-Process -Id $pidToWait -ErrorAction SilentlyContinue) {{ Start-Sleep -Milliseconds 200 }}
Move-Item -Force -LiteralPath $source -Destination $target
Start-Process -FilePath $target
Remove-Item -LiteralPath $PSCommandPath -Force
"""
""".format(pid=pid_val, target=target_val, source=source_val)
with open(ps_path, 'w', encoding='utf-8') as f:
f.write(ps)