2014-02-01 14:36:38 +01:00
|
|
|
@Echo off
|
2014-02-21 13:35:12 +01:00
|
|
|
SET VCDIR=%~dp0
|
2014-02-22 10:27:31 +01:00
|
|
|
cd %VCDIR%\..\..\..
|
|
|
|
SET GNUPARENTDIR=%cd%
|
2014-02-01 14:36:38 +01:00
|
|
|
|
|
|
|
"%windir%\system32\reg.exe" query "HKU\S-1-5-19" >nul 2>&1 && (
|
|
|
|
goto :checkok
|
|
|
|
) || (
|
|
|
|
echo -------
|
|
|
|
echo *** WARNING ***
|
|
|
|
echo -------
|
|
|
|
echo.
|
|
|
|
echo.
|
|
|
|
echo ADMINISTRATOR PRIVILEGES NOT DETECTED!
|
|
|
|
echo ______________________________________
|
|
|
|
echo.
|
|
|
|
echo This script must be able to run with administrator
|
|
|
|
echo privileges.
|
|
|
|
echo.
|
|
|
|
echo To do so, right click on this script and select 'Run As Administrator'
|
|
|
|
echo.
|
|
|
|
echo.
|
|
|
|
echo Press any key to exit...
|
|
|
|
pause >nul
|
|
|
|
goto :eof
|
|
|
|
)
|
|
|
|
|
|
|
|
:checkok
|
|
|
|
|
2014-02-22 11:20:02 +01:00
|
|
|
if exist "%temp%\list0.txt" (del "%temp%\list0.txt")
|
2014-02-22 10:27:31 +01:00
|
|
|
if exist "%temp%\list1.txt" (del "%temp%\list1.txt")
|
2014-02-01 14:36:38 +01:00
|
|
|
|
2014-02-22 10:27:31 +01:00
|
|
|
echo Uninstalling existing Visual C++ 2008 x64 Runtime Redistributables
|
2014-02-01 14:36:38 +01:00
|
|
|
echo (please wait as this process may take a few moments)
|
2014-02-22 11:20:02 +01:00
|
|
|
wmic product where "name like 'Microsoft Visual C++ 2008 Redistributable - x64%%'" get name >>"%temp%\list0.txt"
|
|
|
|
for /f "skip=1 delims=" %%a in ('type "%temp%\list0.txt"') do (echo "%%a")
|
2014-02-06 11:35:05 +01:00
|
|
|
|
2014-02-22 10:27:31 +01:00
|
|
|
echo Converting ucs-2 encoded list of installed products to utf-8
|
2014-02-22 11:20:02 +01:00
|
|
|
%GNUPARENTDIR%\GNU\iconv.exe -f UCS-2 -t UTF-8 %temp%\list0.txt > %temp%\list1.txt
|
2014-02-22 10:27:31 +01:00
|
|
|
echo CleanUp some errors in the list file
|
2014-02-22 11:20:02 +01:00
|
|
|
%GNUPARENTDIR%\GNU\sed.exe -e "s/\s*$//g" %temp%\list1.txt > %temp%\list0.txt
|
2014-02-01 14:36:38 +01:00
|
|
|
|
2014-02-22 10:27:31 +01:00
|
|
|
echo start uninstalling old versions of product
|
2014-02-22 11:20:02 +01:00
|
|
|
for /f "skip=1 delims=" %%a in ('type "%temp%\list0.txt"') do (echo "%%a")
|
|
|
|
for /f "skip=1 delims=" %%a in ('type "%temp%\list0.txt"') do (wmic product where "name like '%%a%'" call uninstall /nointeractive)
|
2014-02-01 14:36:38 +01:00
|
|
|
|
2014-02-22 10:27:31 +01:00
|
|
|
echo CleanUp Tempory files
|
2014-02-22 11:20:02 +01:00
|
|
|
del "%temp%\list0.txt"
|
2014-02-22 10:27:31 +01:00
|
|
|
del "%temp%\list1.txt"
|
2014-02-01 14:36:38 +01:00
|
|
|
|
2014-02-22 10:27:31 +01:00
|
|
|
echo Install latest version of Visual C++ 2008 x64 Runtime Redistributables
|
|
|
|
echo (please wait as this process may take a few moments)
|
|
|
|
"%windir%\system32\msiexec.exe" /i "%VCDIR%\vc_red.msi" /q transforms="%VCDIR%\2k8-x64.mst"
|
2014-02-01 14:36:38 +01:00
|
|
|
|
|
|
|
:eof
|