Commit aac318d593

aac318d59384e8f258e2ab7af0024eac57729e65

parent: 170016346f

Unsigned

Rushikesh Gaikwad <81632222+Wraient@users.noreply.github.com> · 2026-03-31 21:03 UTC

Fix Windows updater rollback on swap failure

Layout: unified · split

internal/update.go +5
@@ -244,6 +244,11 @@ if not errorlevel 1 (
244if exist "%%OLD%%" del /F /Q "%%OLD%%" >NUL 2>NUL 244if exist "%%OLD%%" del /F /Q "%%OLD%%" >NUL 2>NUL
245if exist "%%TARGET%%" move /Y "%%TARGET%%" "%%OLD%%" >NUL 245if exist "%%TARGET%%" move /Y "%%TARGET%%" "%%OLD%%" >NUL
246move /Y "%%SOURCE%%" "%%TARGET%%" >NUL 246move /Y "%%SOURCE%%" "%%TARGET%%" >NUL
247if errorlevel 1 (
248 if exist "%%OLD%%" move /Y "%%OLD%%" "%%TARGET%%" >NUL 2>NUL
249 del /F /Q "%%~f0" >NUL 2>NUL
250 exit /B 1
251)
247if exist "%%OLD%%" del /F /Q "%%OLD%%" >NUL 2>NUL 252if exist "%%OLD%%" del /F /Q "%%OLD%%" >NUL 2>NUL
248del /F /Q "%%~f0" >NUL 2>NUL 253del /F /Q "%%~f0" >NUL 2>NUL
249`, executablePath, tmpPath, executablePath, os.Getpid(), os.Getpid()) 254`, executablePath, tmpPath, executablePath, os.Getpid(), os.Getpid())