From 048a8123e12007fe645a5eb63493598a4baca2c8 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sat, 22 Feb 2014 10:27:31 +0100 Subject: [PATCH] finally correct the msvc2008 install bug --- CLIENT_DATA/MSVC08_x64_Install.cmd | 28 +++++++++++++++++++--------- CLIENT_DATA/MSVC08_x86_Install.cmd | 28 +++++++++++++++++++--------- builder-product.cfg | 4 ++-- builder-targets-cb.sh | 8 +++++++- 4 files changed, 47 insertions(+), 21 deletions(-) diff --git a/CLIENT_DATA/MSVC08_x64_Install.cmd b/CLIENT_DATA/MSVC08_x64_Install.cmd index a03b5da..4c107c1 100644 --- a/CLIENT_DATA/MSVC08_x64_Install.cmd +++ b/CLIENT_DATA/MSVC08_x64_Install.cmd @@ -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 diff --git a/CLIENT_DATA/MSVC08_x86_Install.cmd b/CLIENT_DATA/MSVC08_x86_Install.cmd index 4bfb4fb..f367268 100644 --- a/CLIENT_DATA/MSVC08_x86_Install.cmd +++ b/CLIENT_DATA/MSVC08_x86_Install.cmd @@ -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 diff --git a/builder-product.cfg b/builder-product.cfg index 990c34e..7582ec1 100644 --- a/builder-product.cfg +++ b/builder-product.cfg @@ -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" ################## diff --git a/builder-targets-cb.sh b/builder-targets-cb.sh index 0abfb55..edb8baf 100644 --- a/builder-targets-cb.sh +++ b/builder-targets-cb.sh @@ -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