FWSUpdates for WPKG on iPasserelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
974 B

@echo off
REM Only run if needed
SET /A USER_RUN=0
SET /A ADMIN_RUN=0
reg query "HKLM\Software\FWS\Updates\User" /v RunOnShutdown 1>NUL 2>NUL
IF %ERRORLEVEL% EQU 0 FOR /F "tokens=3" %%A IN ('reg query "HKLM\Software\FWS\Updates\User" /v RunOnShutdown') DO SET /A USER_RUN=%%A
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 also makes sure we clear the sync flag
reg delete "HKLM\Software\FWS\Updates" /v SyncInProgress /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