diff --git a/softwares/FWSUpdates/bin/chkupd.bat b/softwares/FWSUpdates/bin/chkupd.bat index bd643a0..c03489b 100644 --- a/softwares/FWSUpdates/bin/chkupd.bat +++ b/softwares/FWSUpdates/bin/chkupd.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% diff --git a/softwares/FWSUpdates/bin/sync.bat b/softwares/FWSUpdates/bin/sync.bat index 0c3e0ba..b3516f9 100644 --- a/softwares/FWSUpdates/bin/sync.bat +++ b/softwares/FWSUpdates/bin/sync.bat @@ -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 diff --git a/softwares/FWSUpdates/bin/wpkg_feedback.bat b/softwares/FWSUpdates/bin/wpkg_feedback.bat index 9742edb..dea43d6 100644 --- a/softwares/FWSUpdates/bin/wpkg_feedback.bat +++ b/softwares/FWSUpdates/bin/wpkg_feedback.bat @@ -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 diff --git a/softwares/FWSUpdates/lang/040C_utf8.bat b/softwares/FWSUpdates/lang/040C_utf8.bat index 23e0a24..edfb84b 100644 --- a/softwares/FWSUpdates/lang/040C_utf8.bat +++ b/softwares/FWSUpdates/lang/040C_utf8.bat @@ -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 diff --git a/softwares/FWSUpdates/lang/en_utf8.bat b/softwares/FWSUpdates/lang/en_utf8.bat index d94d25a..dc60fbd 100644 --- a/softwares/FWSUpdates/lang/en_utf8.bat +++ b/softwares/FWSUpdates/lang/en_utf8.bat @@ -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