diff options
author | Tor Lillqvist <tlillqvist@novell.com> | 2011-01-24 16:23:07 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@novell.com> | 2011-01-24 16:27:09 +0200 |
commit | d4e3aab53f89be8f1c5210428e17ccb09185344e (patch) | |
tree | 91acaeaa3950198f12ea8d13435afb26151855d0 /download | |
parent | ea7ed84b499b953dd5407e49feeb4edb040932d6 (diff) |
Improve the Windows download code
Mark dbghinst.EXE as executable (from Cygwin's point of view) if
necessary.
Warn that running the security fix installer containing gdiplus.dll
might cause a UAC prompt, and instruct the developer what to do. Be
more verbose in abnormal situations after running it.
Drop some pointless messages.
Diffstat (limited to 'download')
-rwxr-xr-x | download | 42 |
1 files changed, 34 insertions, 8 deletions
@@ -73,7 +73,6 @@ for i in wget /usr/bin/wget /usr/local/bin/wget /usr/sfw/bin/wget /opt/sfw/bin/w ret=$? if [ $ret -eq 0 ]; then wget=$i - echo found wget: $wget break fi done @@ -86,7 +85,6 @@ if [ -z "$wget" ]; then # if [ $ret -eq 0 ]; then if [ -x $i ]; then curl=$i - echo found curl: $curl break fi done @@ -94,7 +92,7 @@ fi if [ -z "$wget" -a -z "$curl" ]; then echo "ERROR: neither wget nor curl found!" - exit + exit 1 fi for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/bin/gmd5sum /opt/local/bin/md5sum; do @@ -106,7 +104,6 @@ for i in md5 md5sum /usr/local/bin/md5sum gmd5sum /usr/sfw/bin/md5sum /opt/sfw/b ret=$? if [ $ret -eq 0 ]; then md5sum=$i - echo found md5sum: $md5sum break fi done @@ -207,7 +204,11 @@ fi if [ "$GUI" = "WNT" -a -n "$md5sum" ]; then TMPUNPACK=`cygpath -d $TARFILE_LOCATION/tmp` + chmod a+w $TARFILE_LOCATION/tmp if [ ! -f ./external/dbghelp/dbghelp.dll -a -f $TARFILE_LOCATION/dbghinst.EXE ]; then + if [ ! -x $TARFILE_LOCATION/dbghinst.EXE ]; then + chmod +x $TARFILE_LOCATION/dbghinst.EXE + fi $TARFILE_LOCATION/dbghinst.EXE /T:$TMPUNPACK /C sum=`$md5sum $md5special $TARFILE_LOCATION/tmp/dbghelp.exe | sed "s/ .*//"` if [ "$sum" == "cd3086a91e37965dd761ef5fd5df5b15" ]; then @@ -215,10 +216,35 @@ if [ "$GUI" = "WNT" -a -n "$md5sum" ]; then fi fi if [ ! -f ./external/gdiplus/gdiplus.dll -a -f $TARFILE_LOCATION/WindowsXP-KB975337-x86-ENU.exe ]; then - $TARFILE_LOCATION/WindowsXP-KB975337-x86-ENU.exe /extract:$TMPUNPACK /q - sum=`$md5sum $md5special $TARFILE_LOCATION/tmp/asms/10/msft/windows/gdiplus/gdiplus.dll | sed "s/ .*//"` - if [ "$sum" == "4721ab485e0c29cd1617a5f296b9cc47" ]; then - cp $TARFILE_LOCATION/tmp/asms/10/msft/windows/gdiplus/gdiplus.dll ./external/gdiplus/gdiplus.dll + gdiplus_dll_path=asms/10/msft/windows/gdiplus/gdiplus.dll + + # Run it through cmd so that the UAC prompt is displayed + echo + echo "NOTE: We are running the Microsoft KB975337 security fix installer" + echo "to get gdiplus.dll. You will most probably get a UAC prompt now." + echo "If you trust us, just enter your administrator password." + echo "The security fix is run with the /extract switch to just unpack" + echo "its files." + echo "If you don't trust us, just get gdiplus.dll yourself and put it" + echo "in external/gdiplus/gdiplus.dll." + echo "gdiplus.dll is included in the LibreOffice installer for the benefit of" + echo "Windows 2000 users." + # A few empty lines so that the above is visible even if the taskbar's auto-hide is turned on, + # and the UAC prompt caused it to taise (with a blinking icon for the UAC prompt) + echo + echo + echo + cmd /c "`cygpath -d $TARFILE_LOCATION/WindowsXP-KB975337-x86-ENU.exe` /extract:$TMPUNPACK /q" + if [ -f $TARFILE_LOCATION/tmp/$gdiplus_dll_path ]; then + echo "Extraction succeeded" + sum=`$md5sum $md5special $TARFILE_LOCATION/tmp/$gdiplus_dll_path | sed "s/ .*//"` + if [ "$sum" == "4721ab485e0c29cd1617a5f296b9cc47" ]; then + cp $TARFILE_LOCATION/tmp/$gdiplus_dll_path ./external/gdiplus/gdiplus.dll + else + echo "But unexpected checksum of $gdiplus_dll_path" + fi + else + echo "WindowsXP-KB975337-x86-ENU.exe did not unpack the expected $gdiplus_dll_path" fi fi if [ ! -f ./external/vcredist/vcredist_x86.exe -a -f $TARFILE_LOCATION/vcredist_x86.exe ]; then |