From b3ed22e0cb82121f7f60bf8b09953ccb825dd026 Mon Sep 17 00:00:00 2001 From: Mario Fetka Date: Sat, 22 Feb 2014 11:20:02 +0100 Subject: [PATCH] inplace sed not working with netowrk share so normal pipe --- CLIENT_DATA/MSVC08_x64_Install.cmd | 18 ++++++++---------- CLIENT_DATA/MSVC08_x86_Install.cmd | 18 ++++++++---------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/CLIENT_DATA/MSVC08_x64_Install.cmd b/CLIENT_DATA/MSVC08_x64_Install.cmd index 4c107c1..db6ba26 100644 --- a/CLIENT_DATA/MSVC08_x64_Install.cmd +++ b/CLIENT_DATA/MSVC08_x64_Install.cmd @@ -27,27 +27,25 @@ 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++ 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") +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") 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 +%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" -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 +%GNUPARENTDIR%\GNU\sed.exe -e "s/\s*$//g" %temp%\list1.txt > %temp%\list0.txt 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) +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) echo CleanUp Tempory files -del "%temp%\list.txt" +del "%temp%\list0.txt" del "%temp%\list1.txt" echo Install latest version of Visual C++ 2008 x64 Runtime Redistributables diff --git a/CLIENT_DATA/MSVC08_x86_Install.cmd b/CLIENT_DATA/MSVC08_x86_Install.cmd index f367268..855356a 100644 --- a/CLIENT_DATA/MSVC08_x86_Install.cmd +++ b/CLIENT_DATA/MSVC08_x86_Install.cmd @@ -27,27 +27,25 @@ 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++ 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") +wmic product where "name like 'Microsoft Visual C++ 2008 Redistributable - x86%%'" get name >>"%temp%\list0.txt" +for /f "skip=1 delims=" %%a in ('type "%temp%\list0.txt"') do (echo "%%a") 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 +%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" -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 +%GNUPARENTDIR%\GNU\sed.exe -e "s/\s*$//g" %temp%\list1.txt > %temp%\list0.txt 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) +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) echo CleanUp Tempory files -del "%temp%\list.txt" +del "%temp%\list0.txt" del "%temp%\list1.txt" echo Install latest version of Visual C++ 2008 x86 Runtime Redistributables