finally correct the msvc2008 install bug

This commit is contained in:
Mario Fetka 2014-02-22 10:27:31 +01:00
parent 3c08ebba28
commit 048a8123e1
4 changed files with 47 additions and 21 deletions

View File

@ -1,9 +1,7 @@
@Echo off
SET VCDIR=%~dp0
cd %VCDIR%\..
SET SEDPARENTDIR=%cd%
if exist "%PROGRAMFILES(X86)%" (set arch=x64) ELSE (set arch=x86)
cd %VCDIR%\..\..\..
SET GNUPARENTDIR=%cd%
"%windir%\system32\reg.exe" query "HKU\S-1-5-19" >nul 2>&1 && (
goto :checkok
@ -30,18 +28,30 @@ goto :eof
:checkok
if exist "%temp%\list.txt" (del "%temp%\list.txt")
if exist "%temp%\list1.txt" (del "%temp%\list1.txt")
echo Uninstalling existing Visual C++ %arch% Runtime Redistributables
echo Uninstalling existing Visual C++ 2008 x64 Runtime Redistributables
echo (please wait as this process may take a few moments)
wmic product where "name like 'Microsoft Visual C++ 2008 Redistributable - x64%%'" get name >>"%temp%\list.txt"
for /f "skip=1 delims=" %%a in ('type "%temp%\list.txt"') do (echo "%%a")
%SEDPARENTDIR%\gnu\sed.exe -e 's/[ \t]*$//' -i "%temp%\list.txt"
echo Converting ucs-2 encoded list of installed products to utf-8
%GNUPARENTDIR%\GNU\iconv.exe -f UCS-2 -t UTF-8 %temp%\list.txt > %temp%\list1.txt
echo CleanUp some errors in the list file
%GNUPARENTDIR%\GNU\sed.exe -e "s/\s*$//g" -i %temp%\list1.txt
echo Converting back utf-8 encoded list of installed products to ucs-2
%GNUPARENTDIR%\GNU\iconv.exe -f UTF-8 -t UCS-2 %temp%\list1.txt > %temp%\list.txt
for /f "usebackq skip=1 delims=" %%a in ('type "%temp%\list.txt"') do (wmic product where name='%%a' call uninstall /nointeractive)
echo start uninstalling old versions of product
for /f "skip=1 delims=" %%a in ('type "%temp%\list1.txt"') do (echo "%%a")
for /f "skip=1 delims=" %%a in ('type "%temp%\list1.txt"') do (wmic product where "name like '%%a%'" call uninstall /nointeractive)
echo CleanUp Tempory files
del "%temp%\list.txt"
del "%temp%\list1.txt"
"%windir%\system32\msiexec.exe" /i %VCDIR%\vc_red.msi /q %VCDIR%\transforms=2k8-x64.mst
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"
:eof

View File

@ -1,9 +1,7 @@
@Echo off
SET VCDIR=%~dp0
cd %VCDIR%\..
SET SEDPARENTDIR=%cd%
if exist "%PROGRAMFILES(X86)%" (set arch=x64) ELSE (set arch=x86)
cd %VCDIR%\..\..\..
SET GNUPARENTDIR=%cd%
"%windir%\system32\reg.exe" query "HKU\S-1-5-19" >nul 2>&1 && (
goto :checkok
@ -30,18 +28,30 @@ goto :eof
:checkok
if exist "%temp%\list.txt" (del "%temp%\list.txt")
if exist "%temp%\list1.txt" (del "%temp%\list1.txt")
echo Uninstalling existing Visual C++ x86 Runtime Redistributables
echo Uninstalling existing Visual C++ 2008 x86 Runtime Redistributables
echo (please wait as this process may take a few moments)
wmic product where "name like 'Microsoft Visual C++ 2008 Redistributable - x86%%'" get name >>"%temp%\list.txt"
for /f "skip=1 delims=" %%a in ('type "%temp%\list.txt"') do (echo "%%a")
%SEDPARENTDIR%\gnu\sed.exe -e 's/[ \t]*$//' -i "%temp%\list.txt"
echo Converting ucs-2 encoded list of installed products to utf-8
%GNUPARENTDIR%\GNU\iconv.exe -f UCS-2 -t UTF-8 %temp%\list.txt > %temp%\list1.txt
echo CleanUp some errors in the list file
%GNUPARENTDIR%\GNU\sed.exe -e "s/\s*$//g" -i %temp%\list1.txt
echo Converting back utf-8 encoded list of installed products to ucs-2
%GNUPARENTDIR%\GNU\iconv.exe -f UTF-8 -t UCS-2 %temp%\list1.txt > %temp%\list.txt
for /f "skip=1 delims=" %%a in ('type "%temp%\list.txt"') do (wmic product where "name like '%%a%'" call uninstall /nointeractive)
echo start uninstalling old versions of product
for /f "skip=1 delims=" %%a in ('type "%temp%\list1.txt"') do (echo "%%a")
for /f "skip=1 delims=" %%a in ('type "%temp%\list1.txt"') do (wmic product where "name like '%%a%'" call uninstall /nointeractive)
echo CleanUp Tempory files
del "%temp%\list.txt"
del "%temp%\list1.txt"
"%windir%\system32\msiexec.exe" /i %VCDIR%\vc_red.msi /q %VCDIR%\transforms=2k8-x86.mst
echo Install latest version of Visual C++ 2008 x86 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-x86.mst"
:eof

View File

@ -267,13 +267,13 @@ DL_FILE[5]="sed-4.2.2-bin.zip"
DL_SOURCE[5]="https://gnu-on-windows.googlecode.com/files/sed-4.2.2-bin.zip"
DL_ARCH[5]="X86"
DL_EXTRACT_FORMAT[5]="unzip"
DL_EXTRACT_TO[5]="gnu"
DL_EXTRACT_TO[5]="GNU"
DL_FILE[6]="libiconv-1.14-bin.zip"
DL_SOURCE[6]="https://gnu-on-windows.googlecode.com/files/libiconv-1.14-bin.zip"
DL_ARCH[6]="X86"
DL_EXTRACT_FORMAT[6]="unzip"
DL_EXTRACT_TO[6]="gnu"
DL_EXTRACT_TO[6]="GNU"
##################

View File

@ -79,6 +79,12 @@ function create() {
mkdir -p $INST_DIR/CLIENT_DATA/UnInstall/Packages/{Flash,Shockwave,Silverlight}
7z x -o$INST_DIR/CLIENT_DATA/Install $INST_DIR/CLIENT_DATA/X86/sereby/svcpack/aio-runtimes.exe
# ==========================================================================================================
# Place some tools for later use into the packages dir
# ==========================================================================================================
mv -v $INST_DIR/CLIENT_DATA/X86/GNU $INST_DIR/CLIENT_DATA/Install/Packages/GNU
# ==========================================================================================================
# sed everything to disabled
# ==========================================================================================================
@ -239,10 +245,10 @@ 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
mv -v $INST_DIR/CLIENT_DATA/X86/gnu $INST_DIR/CLIENT_DATA/Install/Packages/MSVC/gnu
# 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
rm $INST_DIR/CLIENT_DATA/MSVC05_x86_Install.cmd $INST_DIR/CLIENT_DATA/MSVC05_x64_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