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
|
# Create updater PowerShell script
|
||||||
ps_path = os.path.join(tmpdir, 'sealoader_updater.ps1')
|
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'
|
$ErrorActionPreference = 'Stop'
|
||||||
$pidToWait = {os.getpid()}
|
$pidToWait = {pid}
|
||||||
$target = '{current_exe}'.Replace("'","''")
|
$target = '{target}'.Replace("'","''")
|
||||||
$source = '{new_exe_path}'.Replace("'","''")
|
$source = '{source}'.Replace("'","''")
|
||||||
while (Get-Process -Id $pidToWait -ErrorAction SilentlyContinue) { Start-Sleep -Milliseconds 200 }
|
while (Get-Process -Id $pidToWait -ErrorAction SilentlyContinue) {{ Start-Sleep -Milliseconds 200 }}
|
||||||
Move-Item -Force -LiteralPath $source -Destination $target
|
Move-Item -Force -LiteralPath $source -Destination $target
|
||||||
Start-Process -FilePath $target
|
Start-Process -FilePath $target
|
||||||
Remove-Item -LiteralPath $PSCommandPath -Force
|
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:
|
with open(ps_path, 'w', encoding='utf-8') as f:
|
||||||
f.write(ps)
|
f.write(ps)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user