Possibility to display available updates

master
Daniel Berteaud 9 years ago
parent f864703d60
commit c51deff386
  1. 20
      softwares/FWSUpdates/bin/chkupd.bat
  2. 21
      softwares/FWSUpdates/bin/sync.bat
  3. 7
      softwares/FWSUpdates/bin/wpkg_feedback.bat
  4. 2
      softwares/FWSUpdates/lang/040C_utf8.bat
  5. 2
      softwares/FWSUpdates/lang/en_utf8.bat

@ -71,7 +71,7 @@ IF %CHANGES% LSS 1 IF %ADMIN% NEQ 1 (
SET /A NOW=%DATE:~-4%%DATE:~3,2%%DATE:~0,2%
SET /A SINCE=%NOW%
reg query "HKLM\Software\FWS\Updates" /v ChangesAvailableSince 1>NUL 2>NUL
IF %ERRORLEVEL% EQU 0 OR /F "tokens=3 delims= " %%A IN ('reg query "HKLM\Software\FWS\Updates" /v ChangesAvailableSince') DO SET /A SINCE=%%A
IF %ERRORLEVEL% EQU 0 FOR /F "tokens=3 delims= " %%A IN ('reg query "HKLM\Software\FWS\Updates" /v ChangesAvailableSince') DO SET /A SINCE=%%A
REM Some wording changes if there's only 1 single change to apply
IF %CHANGES% EQU 1 (
@ -108,13 +108,13 @@ IF %CHANGES% LSS 1 IF %ADMIN% EQU 1 (
ELSE (
IF %CAN_REPORT% EQU 1 (
SET watext=%INTRO% %L_FOR_YOUR_SYSTEM%.~~%L_YOU_CAN_SCHEDULE%.~~%L_INSTALL_FORCED_IN% %REMAINING% %L_DAYS%
SET wainput= %L_SCHEDULE_ON_SHUTDOWN%; %L_REPORT%
SET wainput= %L_SCHEDULE_ON_SHUTDOWN%; %L_REPORT%; %L_DISPLAY_AVAILABLE_UPDATES%
IF %ADMIN% EQU 1 (
IF %RUN_ON_SHUTDOWN% NEQ 1 (
SET wainput= %L_SCHEDULE_ON_SHUTDOWN%; %L_REPORT%; %L_INSTALL_NOW%; %L_CHECK_ONLINE_FOR_UPDATES%
SET wainput= %L_SCHEDULE_ON_SHUTDOWN%; %L_REPORT%; %L_DISPLAY_AVAILABLE_UPDATES%; %L_INSTALL_NOW%; %L_CHECK_ONLINE_FOR_UPDATES%
) ELSE (
SET watext=%INTRO% %L_FOR_YOUR_SYSTEM%.~~%L_ALREADY_SCHEDULED_ON_SHUTDOWN%.~~%L_INSTALL_FORCED_IN% %REMAINING% %L_DAYS%
SET wainput= %L_MAINTAIN_ON_SHUTDOWN%; %L_CANCEL_SCHEDULE_ON_SHUTDOWN%; %L_INSTALL_NOW%; %L_CHECK_ONLINE_FOR_UPDATES%
SET wainput= %L_MAINTAIN_ON_SHUTDOWN%; %L_CANCEL_SCHEDULE_ON_SHUTDOWN%; %L_DISPLAY_AVAILABLE_UPDATES%; %L_INSTALL_NOW%; %L_CHECK_ONLINE_FOR_UPDATES%
)
)
@ -126,8 +126,9 @@ ELSE (
CALL %wabat%
IF !waoutnum! EQU 0 goto shutdown
IF !waoutnum! EQU 1 goto later
IF !waoutnum! EQU 2 goto now
IF !waoutnum! EQU 3 goto check
IF !waoutnum! EQU 2 goto display
IF !waoutnum! EQU 3 goto now
IF !waoutnum! EQU 4 goto check
) ELSE (
SET watext=%INTRO% %L_FOR_YOUR_SYSTEM%.~~%AVAILABLE_SINCE% %L_SINCE% %AGE% %L_DAYS%.~~%L_CANT_REPORT_ANYMORE%
start /w %SystemDrive%\FWSUpdates\bin\wizapp.exe FINISH TB
@ -154,6 +155,13 @@ start /w %SystemDrive%\FWSUpdates\bin\wizapp.exe FINISH NOBACK TB
SET /A WAIT=WAIT+10800
goto loop
:display
SET watext=%L_THESE_UPDATES_ARE_PENDING%
FOR /F "tokens=3 delims= " %%A IN ('reg query "HKLM\Software\FWS\Updates" /v PendingChangesList') DO SET LIST=%%A
SET wainput=%LIST:,=~%
start /w %SystemDrive%\FWSUpdates\bin\wizapp.exe NOBACK FT
goto begin
:shutdown
reg add "HKLM\Software\FWS\Updates\User" /v RunOnShutdown /t REG_DWORD /d 1 /f
SET watext=%L_UPDATES_SCHEDULED%

@ -139,20 +139,35 @@ goto cleanup
:postcopy
echo %DATE% %TIME% - Copy finished successfuly, now checking if changes must be applied >> %SystemDrive%\FWSUpdates\status\sync_log.txt
FOR /F %%A IN ('cscript %SystemDrive%\FWSUpdates\repository\wpkg.js /query:m ^| find /V "productkey" ^| find /C "ID:"') DO SET /A CHANGES=%%A
REM FOR /F %%A IN ('cscript %SystemDrive%\FWSUpdates\repository\wpkg.js /query:m ^| find /V "productkey" ^| find /C "ID:"') DO SET /A CHANGES=%%A
SET /A CHANGES=0
SET LIST=
FOR /F "tokens=2 delims= " %%A IN ('cscript %SystemDrive%\FWSUpdates\repository\wpkg.js /query:m ^| find /V "productkey" ^| find "ID:"') DO (
IF !CHANGES! EQU 0 (
SET LIST=%%A
) ELSE (
SET LIST=!LIST!,%%A
)
SET /A CHANGES=!CHANGES!+1
)
echo %DATE% %TIME% - Found %CHANGES% changes >> %SystemDrive%\FWSUpdates\status\sync_log.txt
SET NOW=%DATE:~-4%%DATE:~3,2%%DATE:~0,2%
SET /A MAX=%SINCE%+%MAX_REPORT%
SET /A DELTA=%NOW%-%SINCE%
reg add "HKLM\Software\FWS\Updates" /v PendingChanges /t REG_DWORD /d %CHANGES% /f
reg add "HKLM\Software\FWS\Updates" /v PendingChangesList /t REG_SZ /d "%LIST%" /f
IF %CHANGES% GTR 0 (
reg query "HKLM\Software\FWS\Updates" /v ChangesAvailableSince 1>NUL 2>NUL
IF ERRORLEVEL 1 (
reg add "HKLM\Software\FWS\Updates" /v ChangesAvailableSince /t REG_DWORD /d %NOW% /f
SET /A SINCE=%NOW%
SET /A MAX=%SINCE%+%MAX_REPORT%
) ELSE (
FOR /F %%A IN ('reg query "HKLM\Software\FWS\Updates" /v ChangesAvailableSince') DO SET /A SINCE=%%A
SET /A MAX=%SINCE%+%MAX_REPORT%
IF %NOW% GTR %MAX% add "HKLM\Software\FWS\Updates" /v RunOnShutdown /t REG_DWORD /d 1 /f
)
SET /A DELTA=%NOW%-%SINCE%
goto copylogs
) ELSE (
reg delete "HKLM\Software\FWS\Updates" /v ChangesAvailableSince /f

@ -62,7 +62,12 @@ start /w %SystemDrive%\FWSUpdates\bin\wizapp.exe PB UPDATE 90
goto :finish
:finish
FOR /F %%A IN ('cscript %SystemDrive%\FWSUpdates\repository\wpkg.js /nonotify /quiet:true /query:m /logAppend:true ^| find /V "productkey" ^| find /C "ID:"') DO SET /A CHANGES=%%A
SET /A CHANGES=0
SET LIST=
FOR /F "tokens=2 delims= " %%A IN ('cscript %SystemDrive%\FWSUpdates\repository\wpkg.js /query:m ^| find /V "productkey" ^| find "ID:"') DO (
SET /A CHANGES=!CHANGES!+1
SET LIST=!LIST! %%A
)
reg add "HKLM\Software\FWS\Updates" /v PendingChanges /t REG_DWORD /d %CHANGES% /f
reg delete "HKLM\Software\FWS\Updates\User" /v RunOnShutdown /f 1>NUL 2>NUL
reg delete "HKLM\Software\FWS\Updates" /v RunOnShutdown /f 1>NUL 2>NUL

@ -35,3 +35,5 @@ SET L_CANCELLING_UPDATES=Annulation des mises à jour en cours
SET L_INSTALL_FORCED_IN=L'installation des mises à jour sera forcée dans
SET L_MAINTAIN_ON_SHUTDOWN=Maintenir la programmation
SET L_CANCEL_SCHEDULE_ON_SHUTDOWN=Annuler la programmation
SET L_THESE_UPDATES_ARE_PENDING=Les changements en attente concernent les logiciels suivants
SET L_DISPLAY_AVAILABLE_UPDATES=Afficher les mises à jour disponibles

@ -35,3 +35,5 @@ SET L_CANCELLING_UPDATES=Cancelling updates
SET L_INSTALL_FORCED_IN=Installation will be enforced in
SET L_MAINTAIN_ON_SHUTDOWN=Keep schedule
SET L_CANCEL_SCHEDULE_ON_SHUTDOWN=Cancel schedule
SET L_THESE_UPDATES_ARE_PENDING=Pending changes affect the following softwares
SET L_DISPLAY_AVAILABLE_UPDATES=Display the available updates

Loading…
Cancel
Save