Fix Compile Error
All checks were successful
Build and Upload Release (Windows EXE) / Build Windows EXE (release) Successful in 2m29s
All checks were successful
Build and Upload Release (Windows EXE) / Build Windows EXE (release) Successful in 2m29s
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user