uninstall all old msvc of the msvc incarnation before install the new release to work around the another verison of product installed bug

This commit is contained in:
Mario Fetka 2014-02-01 14:36:38 +01:00
parent 575e0e30b4
commit 9fa19eed50
5 changed files with 200 additions and 1 deletions

View File

@ -0,0 +1,41 @@
@Echo off
if exist "%PROGRAMFILES(X86)%" (set arch=x64) ELSE (set arch=x86)
"%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
if exist "%temp%\list.txt" (del "%temp%\list.txt")
echo Uninstalling existing Visual C++ %arch% Runtime Redistributables
echo (please wait as this process may take a few moments)
reg query hklm\software\microsoft\windows\currentversion\uninstall /f "Microsoft Visual C++ 2005 Redistributable" /s >>"%temp%\list.txt"
for /f "delims=\ tokens=7" %%a in ('type "%temp%\list.txt"') do ("%windir%\system32\msiexec.exe" /X%%a /q)
del "%temp%\list.txt"
"%windir%\system32\msiexec.exe" /i vcredist.msi /q transforms=2k5-x64.mst
:eof

View File

@ -0,0 +1,56 @@
@Echo off
if exist "%PROGRAMFILES(X86)%" (set arch=x64) ELSE (set arch=x86)
"%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
if exist "%temp%\list.txt" (del "%temp%\list.txt")
if %arch% neq x64 goto :x64skip
echo Uninstalling existing Visual C++ x86 Runtime Redistributables
echo (please wait as this process may take a few moments)
reg query hklm\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall /f "Microsoft Visual C++ 2005 Redistributable" /s >>"%temp%\list.txt"
for /f "delims=\ tokens=8" %%a in ('type "%temp%\list.txt"') do ("%windir%\system32\msiexec.exe" /X%%a /q)
del "%temp%\list.txt"
goto :install
:x64skip
echo Uninstalling existing Visual C++ %arch% Runtime Redistributables
echo (please wait as this process may take a few moments)
reg query hklm\software\microsoft\windows\currentversion\uninstall /f "Microsoft Visual C++ 2005 Redistributable" /s >>"%temp%\list.txt"
for /f "delims=\ tokens=7" %%a in ('type "%temp%\list.txt"') do ("%windir%\system32\msiexec.exe" /X%%a /q)
del "%temp%\list.txt"
:install
"%windir%\system32\msiexec.exe" /i vcredist.msi /q transforms=2k5-x86.mst
:eof

View File

@ -0,0 +1,41 @@
@Echo off
if exist "%PROGRAMFILES(X86)%" (set arch=x64) ELSE (set arch=x86)
"%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
if exist "%temp%\list.txt" (del "%temp%\list.txt")
echo Uninstalling existing Visual C++ %arch% Runtime Redistributables
echo (please wait as this process may take a few moments)
reg query hklm\software\microsoft\windows\currentversion\uninstall /f "Microsoft Visual C++ 2008 Redistributable" /s >>"%temp%\list.txt"
for /f "delims=\ tokens=7" %%a in ('type "%temp%\list.txt"') do ("%windir%\system32\msiexec.exe" /X%%a /q)
del "%temp%\list.txt"
"%windir%\system32\msiexec.exe" /i vc_red.msi /q transforms=2k8-x64.mst
:eof

View File

@ -0,0 +1,56 @@
@Echo off
if exist "%PROGRAMFILES(X86)%" (set arch=x64) ELSE (set arch=x86)
"%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
if exist "%temp%\list.txt" (del "%temp%\list.txt")
if %arch% neq x64 goto :x64skip
echo Uninstalling existing Visual C++ x86 Runtime Redistributables
echo (please wait as this process may take a few moments)
reg query hklm\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall /f "Microsoft Visual C++ 2008 Redistributable" /s >>"%temp%\list.txt"
for /f "delims=\ tokens=8" %%a in ('type "%temp%\list.txt"') do ("%windir%\system32\msiexec.exe" /X%%a /q)
del "%temp%\list.txt"
goto :install
:x64skip
echo Uninstalling existing Visual C++ %arch% Runtime Redistributables
echo (please wait as this process may take a few moments)
reg query hklm\software\microsoft\windows\currentversion\uninstall /f "Microsoft Visual C++ 2008 Redistributable" /s >>"%temp%\list.txt"
for /f "delims=\ tokens=7" %%a in ('type "%temp%\list.txt"') do ("%windir%\system32\msiexec.exe" /X%%a /q)
del "%temp%\list.txt"
:install
"%windir%\system32\msiexec.exe" /i vc_red.msi /q transforms=2k8-x86.mst
:eof

View File

@ -239,7 +239,12 @@ function create() {
rm -rf $INST_DIR/CLIENT_DATA/Install/Packages/MSVC
mv -v $INST_DIR/CLIENT_DATA/X86/MSVC $INST_DIR/CLIENT_DATA/Install/Packages/MSVC
else
sed "s!mst!mst REINSTALL=ALL REINSTALLMODE=dmus!" -i $INST_DIR/CLIENT_DATA/Install/Packages/MSVC/package.xml
sed -e "s!vcredist.msi!Install.cmd!" -i $INST_DIR/CLIENT_DATA/Install/Packages/MSVC/package.xml
mv -v $INST_DIR/CLIENT_DATA/MSVC05_x64_Install.cmd $INST_DIR/CLIENT_DATA/Install/Packages/MSVC/x64/msvc_05/Install.cmd
mv -v $INST_DIR/CLIENT_DATA/MSVC05_x86_Install.cmd $INST_DIR/CLIENT_DATA/Install/Packages/MSVC/x86/msvc_05/Install.cmd
sed -e "s!vc_red.msi!Install.cmd!" -i $INST_DIR/CLIENT_DATA/Install/Packages/MSVC/package.xml
mv -v $INST_DIR/CLIENT_DATA/MSVC08_x64_Install.cmd $INST_DIR/CLIENT_DATA/Install/Packages/MSVC/x64/msvc_08/Install.cmd
mv -v $INST_DIR/CLIENT_DATA/MSVC08_x86_Install.cmd $INST_DIR/CLIENT_DATA/Install/Packages/MSVC/x86/msvc_08/Install.cmd
fi
# ==========================================================================================================