Correctly compute dates by using delayed variables

master
Daniel Berteaud 9 years ago
parent 2bed1874e7
commit b124b0cea8
  1. 10
      softwares/FWSUpdates/bin/sync.bat

@ -161,13 +161,13 @@ IF %CHANGES% GTR 0 (
IF ERRORLEVEL 1 ( IF ERRORLEVEL 1 (
reg add "HKLM\Software\FWS\Updates" /v ChangesAvailableSince /t REG_DWORD /d %NOW% /f reg add "HKLM\Software\FWS\Updates" /v ChangesAvailableSince /t REG_DWORD /d %NOW% /f
SET /A SINCE=%NOW% SET /A SINCE=%NOW%
SET /A MAX=%SINCE%+%MAX_REPORT%*86400 SET /A MAX=%NOW%+%MAX_REPORT%*86400
) ELSE ( ) ELSE (
FOR /F %%A IN ('reg query "HKLM\Software\FWS\Updates" /v ChangesAvailableSince') DO SET /A SINCE=%%A FOR /F "tokens=3 delims= " %%A IN ('reg query "HKLM\Software\FWS\Updates" /v ChangesAvailableSince') DO SET /A SINCE=%%A
SET /A MAX=%SINCE%+%MAX_REPORT%*86400 SET /A MAX=!SINCE!+%MAX_REPORT%*86400
IF %NOW% GTR %MAX% add "HKLM\Software\FWS\Updates" /v RunOnShutdown /t REG_DWORD /d 1 /f IF %NOW% GTR !MAX! reg add "HKLM\Software\FWS\Updates" /v RunOnShutdown /t REG_DWORD /d 1 /f
) )
SET /A DELTA=%NOW%-%SINCE% SET /A DELTA=%NOW%-!SINCE!
goto copylogs goto copylogs
) ELSE ( ) ELSE (
reg delete "HKLM\Software\FWS\Updates" /v ChangesAvailableSince /f reg delete "HKLM\Software\FWS\Updates" /v ChangesAvailableSince /f

Loading…
Cancel
Save