From aae88ed4acab75ec85b420089eef834ca3783f05 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 8 Apr 2016 16:22:09 +0200 Subject: [PATCH] Unconditionaly remove RunOnShutdown keys during shutdown So even an error during wpkg_feedback.bat execution would remove the key and let sync after a reboot --- softwares/FWSUpdates/bin/on_shutdown.bat | 5 +++++ softwares/FWSUpdates/bin/wpkg_feedback.bat | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/softwares/FWSUpdates/bin/on_shutdown.bat b/softwares/FWSUpdates/bin/on_shutdown.bat index 487c539..d411754 100644 --- a/softwares/FWSUpdates/bin/on_shutdown.bat +++ b/softwares/FWSUpdates/bin/on_shutdown.bat @@ -7,6 +7,11 @@ IF %ERRORLEVEL% EQU 0 FOR /F "tokens=3" %%A IN ('reg query "HKLM\Software\FWS\Up reg query "HKLM\Software\FWS\Updates" /v RunOnShutdown 1>NUL 2>NUL IF %ERRORLEVEL% EQU 0 FOR /F "tokens=3" %%A IN ('reg query "HKLM\Software\FWS\Updates" /v RunOnShutdown') DO SET /A ADMIN_RUN=%%A +REM disable exec on shutdown in any case +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 + +REM If neither admin nor user RunOnShutdown is enabled, skip execution IF %USER_RUN% NEQ 1 IF %ADMIN_RUN% NEQ 1 goto :EOF call %SystemDrive%\FWSUpdates\bin\wpkg_feedback.bat diff --git a/softwares/FWSUpdates/bin/wpkg_feedback.bat b/softwares/FWSUpdates/bin/wpkg_feedback.bat index f3a0891..7594e29 100644 --- a/softwares/FWSUpdates/bin/wpkg_feedback.bat +++ b/softwares/FWSUpdates/bin/wpkg_feedback.bat @@ -69,7 +69,5 @@ FOR /F "tokens=2 delims= " %%A IN ('cscript %SystemDrive%\FWSUpdates\repository\ 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 start /w %SystemDrive%\FWSUpdates\bin\wizapp.exe PB CLOSE