diff --git a/lib/core/updater/installers/update_install_utils.dart b/lib/core/updater/installers/update_install_utils.dart index decfe319..70264f64 100644 --- a/lib/core/updater/installers/update_install_utils.dart +++ b/lib/core/updater/installers/update_install_utils.dart @@ -212,7 +212,11 @@ if %ERRORLEVEL%==0 ( timeout /t 1 /nobreak >NUL goto wait ) -xcopy /E /Y /I "%SRC%\\*" "%DST%\\" +robocopy "%SRC%" "%DST%" /MIR /XD "QueryaData" /XF ".portable" /R:2 /W:1 +if %ERRORLEVEL% GEQ 8 ( + echo Update failed with error %ERRORLEVEL% + exit /b %ERRORLEVEL% +) start "" "%EXE%" del "%~f0" '''; diff --git a/test/core/updater/update_platform_installer_test.dart b/test/core/updater/update_platform_installer_test.dart index e0d22f6a..686000f6 100644 --- a/test/core/updater/update_platform_installer_test.dart +++ b/test/core/updater/update_platform_installer_test.dart @@ -110,7 +110,7 @@ void main() { ); }); - test('windows batch script waits for pid', () { + test('windows batch script waits for pid and uses robocopy mirror with exclusions', () { final batch = buildWindowsReplaceBatch( pid: 99, sourceDir: 'C:\\tmp\\new', @@ -119,6 +119,8 @@ void main() { ); expect(batch, contains('set PID=99')); expect(batch, contains('querya_desktop.exe')); + expect(batch, contains('robocopy "%SRC%" "%DST%" /MIR /XD "QueryaData" /XF ".portable" /R:2 /W:1')); + expect(batch, contains('if %ERRORLEVEL% GEQ 8')); }); });