@ECHO OFF CLS ECHO Checking for Firefox... FOR /F "tokens=* skip=4 delims=" %%a in ('reg query "HKLM\Software\Mozilla\Mozilla Firefox" /v CurrentVersion') do SET DATA=%%a IF "%DATA:~31,1%"=="." goto :longVersion SET CVersion=%DATA:~26,5% SET FVersion=%DATA:~26,20% goto :versionCaptured :longVersion SET CVersion=%DATA:~26,7% SET FVersion=%DATA:~26,20% :versionCaptured FOR /F "tokens=* skip=4" %%a in ('reg query "HKLM\Software\Mozilla\Mozilla Firefox\%FVersion%\Main" /v "Install Directory"') do SET DATA=%%a SET IFolder=%DATA:~25% ECHO *%CVersion%* ECHO *%FVersion%* ECHO *%IFolder%* IF "%CVersion%"=="3.5.9" goto :DoNotRemove goto :RemoveFirefox :RemoveFirefox echo The installed version is not approved for use in our environment. TASKKILL /F /IM firefox.exe CALL "%IFolder%\uninstall\helper.exe" /S goto :eof :DoNotRemove echo This version is approved for use in our environment. goto :eof
We like version 3.5.9, so we keep that version, but we need to revert or upgrade any other version. This is part of a bigger process, but...
No comments:
Post a Comment