From 60c8348f8f6b04521b2e12cdf81b8984755b0bf1 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sun, 23 Feb 2014 12:32:32 +0100 Subject: [PATCH] also add workaroiund for msvc 2k5 --- CLIENT_DATA/MSVC05_x64_Install.cmd | 32 +++++++++++++++++---------- CLIENT_DATA/MSVC05_x86_Install.cmd | 35 ++++++++++++++++++++---------- builder-targets-cb.sh | 8 +++---- 3 files changed, 47 insertions(+), 28 deletions(-) diff --git a/CLIENT_DATA/MSVC05_x64_Install.cmd b/CLIENT_DATA/MSVC05_x64_Install.cmd index d4321f3..e1f008b 100644 --- a/CLIENT_DATA/MSVC05_x64_Install.cmd +++ b/CLIENT_DATA/MSVC05_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 @@ -29,19 +27,29 @@ goto :eof :checkok -if exist "%temp%\list.txt" (del "%temp%\list.txt") +if exist "%temp%\list0.txt" (del "%temp%\list0.txt") +if exist "%temp%\list1.txt" (del "%temp%\list1.txt") -echo Uninstalling existing Visual C++ %arch% Runtime Redistributables +echo Uninstalling existing Visual C++ 2005 x64 Runtime Redistributables echo (please wait as this process may take a few moments) +wmic product where "name like 'Microsoft Visual C++ 2005 Redistributable (x64)%%'" get name >>"%temp%\list0.txt" +for /f "skip=1 delims=" %%a in ('type "%temp%\list0.txt"') do (echo "%%a") -wmic product where "name like 'Microsoft Visual C++ 2005 Redistributable%%'" get name >>"%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%\list0.txt > %temp%\list1.txt +echo CleanUp some errors in the list file +%GNUPARENTDIR%\GNU\sed.exe -e "s/\s*$//g" %temp%\list1.txt > %temp%\list0.txt -%SEDPARENTDIR%\gnu\sed.exe -e 's/[ \t]*$//' -i "%temp%\list.txt" +echo start uninstalling old versions of product +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) -for /f "usebackq skip=1 delims=" %%a in ('type "%temp%\list.txt"') do (wmic product where name='%%a' call uninstall /nointeractive) +echo CleanUp Tempory files +del "%temp%\list0.txt" +del "%temp%\list1.txt" -del "%temp%\list.txt" - -"%windir%\system32\msiexec.exe" /i %VCDIR%\vcredist.msi /q %VCDIR%\transforms=2k5-x64.mst +echo Install latest version of Visual C++ 2005 x64 Runtime Redistributables +echo (please wait as this process may take a few moments) +"%windir%\system32\msiexec.exe" /i "%VCDIR%\vcredist.msi" /q transforms="%VCDIR%\2k5-x64.mst" :eof diff --git a/CLIENT_DATA/MSVC05_x86_Install.cmd b/CLIENT_DATA/MSVC05_x86_Install.cmd index 68391f1..4d68d70 100644 --- a/CLIENT_DATA/MSVC05_x86_Install.cmd +++ b/CLIENT_DATA/MSVC05_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 @@ -29,19 +27,32 @@ goto :eof :checkok -if exist "%temp%\list.txt" (del "%temp%\list.txt") +if exist "%temp%\list0.txt" (del "%temp%\list0.txt") +if exist "%temp%\list1.txt" (del "%temp%\list1.txt") +if exist "%temp%\list2.txt" (del "%temp%\list2.txt") -echo Uninstalling existing Visual C++ x86 Runtime Redistributables +echo Uninstalling existing Visual C++ 2005 x86 Runtime Redistributables echo (please wait as this process may take a few moments) +wmic product where "name like 'Microsoft Visual C++ 2005 Redistributable%%'" get name >>"%temp%\list0.txt" +for /f "skip=1 delims=" %%a in ('type "%temp%\list0.txt"') do (echo "%%a") -wmic product where "name like 'Microsoft Visual C++ 2005 Redistributable - x86%%'" get name >>"%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%\list0.txt > %temp%\list1.txt +echo CleanUp some errors in the list file +%GNUPARENTDIR%\GNU\sed.exe -e "s/\s*$//g" %temp%\list1.txt > %temp%\list2.txt +%GNUPARENTDIR%\GNU\sed.exe -e "s/x64/d" %temp%\list2.txt > %temp%\list0.txt -%SEDPARENTDIR%\gnu\sed.exe -e 's/[ \t]*$//' -i "%temp%\list.txt" +echo start uninstalling old versions of product +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) -for /f "skip=1 delims=" %%a in ('type "%temp%\list.txt"') do (wmic product where "name like '%%a%'" call uninstall /nointeractive) +echo CleanUp Tempory files +del "%temp%\list0.txt" +del "%temp%\list1.txt" +del "%temp%\list2.txt" -del "%temp%\list.txt" - -"%windir%\system32\msiexec.exe" /i %VCDIR%\vcredist.msi /q %VCDIR%\transforms=2k5-x86.mst +echo Install latest version of Visual C++ 2005 x86 Runtime Redistributables +echo (please wait as this process may take a few moments) +"%windir%\system32\msiexec.exe" /i "%VCDIR%\vcredist.msi" /q transforms="%VCDIR%\2k5-x86.mst" :eof diff --git a/builder-targets-cb.sh b/builder-targets-cb.sh index fc2ad9e..6a8517f 100644 --- a/builder-targets-cb.sh +++ b/builder-targets-cb.sh @@ -245,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 -# 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!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