v1.8.90: fix update script — remove $ErrorActionPreference=Stop, launch via cmd start
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -272,24 +272,23 @@ class UpdateChecker:
|
|||||||
exe_dir = os.path.dirname(current_exe)
|
exe_dir = os.path.dirname(current_exe)
|
||||||
|
|
||||||
ps_content = f"""
|
ps_content = f"""
|
||||||
$ErrorActionPreference = 'Stop'
|
|
||||||
$pid = {pid}
|
$pid = {pid}
|
||||||
$src = '{new_exe}'
|
$src = '{new_exe}'
|
||||||
$dst = '{current_exe}'
|
$dst = '{current_exe}'
|
||||||
$mei = '{mei_dir}'
|
|
||||||
$exeDir = '{exe_dir}'
|
|
||||||
$tempDir = '{tmp_dir}'
|
$tempDir = '{tmp_dir}'
|
||||||
|
|
||||||
# Wait for old process to exit
|
# Wait for old process to exit
|
||||||
while (Get-Process -Id $pid -ErrorAction SilentlyContinue) {{
|
while (Get-Process -Id $pid -ErrorAction SilentlyContinue) {{
|
||||||
Start-Sleep -Seconds 1
|
Start-Sleep -Seconds 1
|
||||||
}}
|
}}
|
||||||
Start-Sleep -Seconds 2
|
Start-Sleep -Seconds 3
|
||||||
|
|
||||||
# Clean ALL stale _MEI directories (PyInstaller temp dirs)
|
# Clean ALL stale _MEI directories (best-effort, skip locked)
|
||||||
|
try {{
|
||||||
Get-ChildItem -Path $tempDir -Directory -Filter '_MEI*' -ErrorAction SilentlyContinue | ForEach-Object {{
|
Get-ChildItem -Path $tempDir -Directory -Filter '_MEI*' -ErrorAction SilentlyContinue | ForEach-Object {{
|
||||||
Remove-Item -Path $_.FullName -Recurse -Force -ErrorAction SilentlyContinue
|
Remove-Item -Path $_.FullName -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
}}
|
}}
|
||||||
|
}} catch {{}}
|
||||||
Start-Sleep -Seconds 1
|
Start-Sleep -Seconds 1
|
||||||
|
|
||||||
# Copy with retry
|
# Copy with retry
|
||||||
@@ -311,8 +310,8 @@ if (-not $copied) {{ exit 1 }}
|
|||||||
|
|
||||||
Start-Sleep -Seconds 2
|
Start-Sleep -Seconds 2
|
||||||
|
|
||||||
# Launch new exe via explorer.exe (mimics user double-click, clean environment)
|
# Launch new exe via cmd start (clean environment, proper path handling)
|
||||||
Start-Process explorer.exe $dst
|
Start-Process cmd.exe -ArgumentList '/c', 'start', '""', ('"{0}"' -f $dst) -WindowStyle Hidden
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
Start-Sleep -Seconds 3
|
Start-Sleep -Seconds 3
|
||||||
|
|||||||
BIN
releases/ServerManager-v1.8.90-win-x64.exe
Normal file
BIN
releases/ServerManager-v1.8.90-win-x64.exe
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
"""Version info for ServerManager."""
|
"""Version info for ServerManager."""
|
||||||
|
|
||||||
__version__ = "1.8.89"
|
__version__ = "1.8.90"
|
||||||
__app_name__ = "ServerManager"
|
__app_name__ = "ServerManager"
|
||||||
__author__ = "aibot777"
|
__author__ = "aibot777"
|
||||||
__description__ = "Desktop GUI for managing remote servers"
|
__description__ = "Desktop GUI for managing remote servers"
|
||||||
|
|||||||
Reference in New Issue
Block a user