@echo off REM Hitachi SVP REM VC++Runtime Install tool for Hitachi SVP REM All Rights Reserved, Copyright (C) 2019,Hitachi, Ltd. REM REM History :Version :DATE : Coder : Patch No REM Hitachi SVP REM :01-00 :2019.08.20 : J.Okuno : #82714 (Apache2.4.39 is supported) REM REM Document REM VC++ Runtime v14.16.27027.1 UnInstaller REM REM REM **************** Variable settings **************** REM Folder for log files. set LOGFILE_FOLDER="C:\vc_runtime_log" REM Full path of log file. set LOGFILE="%LOGFILE_FOLDER%\vc_runtime_log.txt" REM Log file path for VC++Runtime exe. set LOGFILE_RUNTIME_INST="%LOGFILE_FOLDER%\vc_runtime_exe_uninstalllog.txt" REM Name of VC++Runtime uninstall batch. set NAME_UNINST_BAT="uninstall_vc_runtime.bat" REM Registry key version in VC++Runtime v14.16.27027.1. REM VC++Runtime v14.16.27027.1 is defined as v14.16.27024.01 on the registry key. REM Therefore, the value is defined by v14.16.27024.01. set RUNTIME_VERSION_V1416270271=v14.16.27024.01 REM Path of VC++Runtime v14.16.27027.1. set RUNTIME_FOLDER_V1416270271=%~dp0v14.16.27027.1 REM VC++Runtime registry key address for 64bit CPU, Because HM700/RAID700/RAID800 is only 64bit CPU. set RUNTIME_REGKEY="HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\14.0\VC\Runtimes\X64" REM VC++Runtime registry key version value name. set RUNTIME_REGNAME="Version" REM **************** Variable settings **************** REM Make the folder for the log file. if not exist "%LOGFILE_FOLDER%" ( mkdir %LOGFILE_FOLDER% echo [%date% %time%]Make the folder for the log file. >> %LOGFILE% 2>>&1 ) echo [%date% %time%]%NAME_UNINST_BAT% Start. >> %LOGFILE% 2>>&1 REM Check the registry key. REG QUERY %RUNTIME_REGKEY% /v %RUNTIME_REGNAME% >nul 2>>&1 if %ERRORLEVEL%==0 ( REM VC++Runtime Version Check. FOR /F "TOKENS=3" %%I IN ('REG QUERY %RUNTIME_REGKEY% /v %RUNTIME_REGNAME%') DO SET VERSION=%%I echo [%date% %time%]VC++Runtime is installed. >> %LOGFILE% 2>>&1 echo [%date% %time%]Get the VC++Runtime registry key. >> %LOGFILE% 2>>&1 ) else ( set VERSION="" echo [%date% %time%]VC++Runtime is not installed. >> %LOGFILE% 2>>&1 ) REM Uninstall VC++Runtime. REM Uninstall with the same version of the exe as the version of the VC++Runtime registry key. REM If the VC++Runtime version is updated, increase it with the else if statement. if %RUNTIME_VERSION_V1416270271%==%VERSION% ( REM Uninstall VC ++ Runtime v14.16.27027.1 silently. @start /wait /d"%RUNTIME_FOLDER_V1416270271%" vc_redist.x64.exe /norestart /quiet /uninstall /log %LOGFILE_RUNTIME_INST% 2>>&1 echo [%date% %time%]Uninstalled the VC++Runtime v14.16.27027.1. >> %LOGFILE% 2>>&1 ) else if ""==%VERSION% ( REM The VC++Runtime is not installed. goto :NormalEnd ) else ( REM VC++Runtime is not the expected version. echo [%date% %time%]VC++Runtime is not the expected version. >> %LOGFILE% 2>>&1 goto :Error ) REM Uninstall result. if not %ERRORLEVEL%==0 ( goto :Error ) :NormalEnd REM Operation successful. echo [%date% %time%]%NAME_UNINST_BAT% Successful. >> %LOGFILE% 2>>&1 exit /b 0 :Error REM Error occured. echo [%date% %time%]%NAME_UNINST_BAT% Error. >> %LOGFILE% 2>>&1 echo [%date% %time%]ERRORLEVEL:%ERRORLEVEL% >> %LOGFILE% 2>>&1 echo [%date% %time%]Error occured. >> %LOGFILE% 2>>&1 exit /b %ERRORLEVEL%