@echo off rem -- Description: rem -- rem -- Attempts to install useful programs on a Microsoft Windows rem -- computer. The programs are usually oriented to the command line rem -- and a standard on unix, linux machines. rem -- rem -- Notes: rem -- rem -- In rem -- rem -- See Also: rem -- Various older versions of this program are also available rem -- rem -- http://www.geocities.com/matth3wbishop/eg/batch/get-stuff.txt rem -- http://www.geocities.com/matth3wbishop/eg/batch/get-stuff-xp.txt rem -- http://www.geocities.com/matth3wbishop/eg/batch/get-tool-set.txt rem -- This script installs all the tools mentioned below without the rem -- user having to explicitly request each one to be installed. rem -- http://www.geocities.com/matth3wbishop/eg/batch/bumble.txt rem -- Tools for working on bumble.sf.net rem -- rem -- conf-dos.bat rem -- An earlier attempt, which is not working properly. rem -- rem -- rem --rem -- rem -- modified: November 2005, debugging. most functions now work. rem -- 2006 Added TinyC rem -- rem -- rem -- Author: rem -- matth3wbishop@yahoo.com rem -- http://www.geocities.com/matth3wbishop/eg/batch/get-tools.txt rem doskey rem *** set the FIREFTP variable to '-a' when you are behind rem *** a proxy or firewall which is not allowing the normal ftp rem *** operations to work, for example rem FIREFTP=-a set FIREFTP= set DRIVE=c: set BASEDIR=%DRIVE%\m3b set BASENAME=m3b set STARTDIR=%CD% @echo 'get-tools.bat' can install some useful programs on your @echo Microsoft Windows computer. You need an Internet connection @echo for this program to work [This version is for Windows XP,NT,2000] @echo see: http://www.geocities.com/matth3wbishop/eg/batch/ @echo ===================================================== @echo Dependencies are shown in curl braces @echo @echo x: quit without installing anything @echo a: wget - URL getter [http://www.gnu.org/wget/] {b} @echo b: infozip - zip compression / decompression [http://www.info-zip.org/] {} @echo c: putty - an ssh client and friends [http://www.chiark.greenend.org.uk/~sgtatham/putty/] {a} @echo d: unix tools - Unix style programs [http://unxutils.sourceforge.net] @echo e: lynx (download) - Text browser with SSL [http://www.lynx.org] @echo ee: lynx (configure) - configure the lynx browser @echo f: arachne - Graphical dos/winx browser [http://www.arachne.com ?] @echo g: blueJ- A minimalist Java editor [http://www.bluej.org] @echo h: vim - a text editor [http://www.vim.org] - 3MB @echo hh: vim - configuration @echo i: mjb - mirror matth3wbishop [http://www.geocities.com/matth3wbishop] @echo j: geoftp - system to upload to geocities free account {b,a,d,k} @echo k: curl - ssh url getter [http://curl.haxx.se/] {b,a,d} @echo l: java - attempt to get a java JDK @echo m: tutor source - java source for a language tutor program @echo n: tiny c - a small c compiler set /p choice="Which program would you like to install " set PROG= if "%choice%"=="x" set PROG=x if "%choice%"=="a" set PROG=wget if "%choice%"=="b" set PROG=infozip if "%choice%"=="c" set PROG=putty if "%choice%"=="d" set PROG=unixutil if "%choice%"=="e" set PROG=lynx if "%choice%"=="ee" set PROG=lynxconf if "%choice%"=="f" set PROG=arachne if "%choice%"=="g" set PROG=bluej if "%choice%"=="h" set PROG=vim if "%choice%"=="hh" set PROG=vimconf if "%choice%"=="i" set PROG=mjb if "%choice%"=="j" set PROG=geoftp if "%choice%"=="k" set PROG=curl if "%choice%"=="l" set PROG=java if "%choice%"=="m" set PROG=langprog if "%choice%"=="n" set PROG=tinyc echo Program Selected=%PROG% if %PROG%==x goto end if %PROG%== goto end mkdir %BASEDIR% @rem @rem ------------------------------------------------------- if NOT %PROG%==wget goto endifWG @rem *** @rem *** The following code creates an ftp script file which can be used @rem *** with the standard Microsoft Windows command line ftp program @rem *** The purpose of this section is to retrieve the wget program from @rem *** the 'sunsite' ftp server. In the past I have noticed that @rem *** under some versions of MS Windows, when the script file has finished @rem *** the ftp program does not exit (it waits for more commands from the @rem *** command line). This will cause the present script to stop executing. @rem *** One solution to this situation is just to type 'quit' at the @rem *** prompt which looks like this "ftp>" @rem *** @rem *** create the ftp script file @rem *** set WGETSITE=ftp.sunsite.dk set WGETDIR=projects/wget/windows mkdir %BASEDIR%\wget del /Q %BASEDIR%\wget\* cd %BASEDIR%\wget @rem -- Note that I believe that I have noticed that on some versions @rem -- of the MS Windows console it is not possible to change directories @rem -- using the syntax @rem -- cd c:\some\dir @rem -- That is, the drive letter is not allowed in the path. If this is @rem -- true then the line immediately above the current comment block @rem -- will fail. However on Windows 98SE this appears to be working echo user anonymous matthew@macwcwagga.homedns.org > junk.txt echo hash >> junk.txt echo bin >> junk.txt echo cd %WGETDIR% >> junk.txt @rem -- I wonder how portable this construct is to various @rem -- dos and windows batch languages. It works on Windows 98 and @rem -- Windows XP echo get wget-1.9.1b.zip >> junk.txt echo get ssllibs097c.zip >> junk.txt rem -- echo get wget-1.9s.zip >> junk.txt echo quit >> junk.txt @rem *** @rem *** Logon & transfer the file @rem *** ftp %FIREFTP% -n -s:junk.txt %WGETSITE% @rem *** When behind a firewall use the following line @rem *** ftp -n -s:junk.txt -a %WGETSITE% but please NOTE that the @rem *** line above this comment block actually should take care of @rem *** this situation by using the FIREFTP variable. rem del junk.txt %BASEDIR%\infozip\unzip\unzip -o *.zip rem echo %BASEDIR%\wget\wget.exe %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 > \windows\wget.bat copy /y wget.exe \windows\ copy /y *.dll \windows\ move wget.HLP wget-ms.HLP @echo The wget recursive URL retriever may have been installed @echo successfully in the directory %BASEDIR%\wget\. Type @echo wget -h | more @echo to see how it works or look at the file %BASEDIR%\wget\wget-ms.hlp @echo The correct installation of 'wget' is dependent on the 'infozip' @echo programs being installed first. :endifWG @rem -- end of WGET block @rem ------------------------------------------------------- if NOT %PROG%==infozip goto endifIZ set ZIPSITE=ftp.info-zip.org set ZIPDIR=pub/infozip/WIN32 set ZIPDIR2=pub/infozip/MSDOS mkdir %BASEDIR%\infozip mkdir %BASEDIR%\infozip\unzip mkdir %BASEDIR%\infozip\unzip\dos mkdir %BASEDIR%\infozip\zip mkdir %BASEDIR%\infozip\zip\dos mkdir %BASEDIR%\infozip\gui @rem -- remove previous versions del /Q %BASEDIR%\infozip\unzip\* del /Q %BASEDIR%\infozip\zip\* del /Q %BASEDIR%\infozip\gui\* cd %BASEDIR%\infozip\unzip echo user anonymous matth2wbishop@yahoo.com > junk.txt echo hash >> junk.txt echo bin >> junk.txt echo cd %ZIPDIR% >> junk.txt echo lcd %BASEDIR%\infozip\unzip >> junk.txt @rem -- IF EXIST %BASEDIR%\infozip\unzip\unz552xN.exe GOTO endif3 echo get unz552xN.exe >> junk.txt @rem -- :endif3 echo lcd %BASEDIR%\infozip\zip >> junk.txt echo get zip231xN.zip >> junk.txt @rem -- echo lcd %BASEDIR%\infozip\gui >> junk.txt @rem -- echo get wiz503xN.exe >> junk.txt rem -- echo get wget-1.9s.zip >> junk.txt echo quit >> junk.txt @rem *** @rem *** Logon & transfer the file @rem *** ftp %FIREFTP% -n -s:junk.txt %ZIPSITE% rem del junk.txt %BASEDIR%\infozip\unzip\unz552xN.exe cd %BASEDIR%\infozip\zip %BASEDIR%\infozip\unzip\unzip -o zip231xN.zip echo %BASEDIR%\infozip\zip\zip.exe %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 > \windows\zip.bat echo %BASEDIR%\infozip\unzip\unzip.exe %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 > \windows\unzip.bat @rem --- The extraction below triggers a gui process which will @rem --- interrupt the current script @rem --- @rem --- cd %BASEDIR%\infozip\gui @rem --- wiz502xN.exe @echo The infozip compression tools MAY have been installed @echo successfully in the directory %BASEDIR%\infozip\ . Type @echo unzip filename.zip to decompress, @echo zip filename.ext to compress and @echo wiz to use a graphical compression tool @echo type unzip -h ... etc for more help @echo :endifIZ @rem -- end of INFOZIP block @rem ------------------------------------------------------- if NOT %PROG%==unixutil goto endifUU rmdir /s/q %BASEDIR%\unixutil mkdir %BASEDIR%\unixutil @rem path=%path%;%BASEDIR%\unixutil\usr\local\wbin @rem path=%path%;%BASEDIR%\unixutil\bin cd %BASEDIR%\unixutil wget http://unxutils.sourceforge.net/UnxUtils.zip %BASEDIR%\infozip\unzip\unzip -o UnxUtils.zip cd %BASEDIR%\unixutil\usr\local\wbin move find.exe ufind.exe move expand.exe uexpand.exe copy %BASEDIR%\unixutil\usr\usr\local\wbin\gplay.exe \windows\ echo set OLDPATH=%%PATH%% > \windows\sh.bat echo path=%BASEDIR%\unixutil\usr\local\wbin;%%PATH%% >> \windows\sh.bat echo %BASEDIR%\unixutil\bin\sh.exe %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 >> \windows\sh.bat echo path=%%OLDPATH%% >> \windows\sh.bat @echo The ports of the unix utilities were (probably) successfully @echo installed in the directory %BASEDIR%\unixutil\ . @echo Type 'sh' to start a unix style shell, or type @echo the name of a unix utility to use it from within the Microsoft @echo Windows Console Box. @echo NOTE: the Unix 'find' program is called 'ufind' to prevent @echo it from interfering with the Microsoft program of the same @echo name and similarly with the expand program @echo . @echo The installation of the unix utilities required the prior @echo installation of the 'infozip' and 'wget' tools. If you @echo have a problem using the unix tools, run these other @echo installation programs first, and then rerun the unix tools @echo installation program. @echo See http://unxutils.sourceforge.net/ for more information :endifUU if NOT %PROG%==lynx goto endifLB rmdir /q/s %BASEDIR%\lynx mkdir %BASEDIR%\lynx cd %BASEDIR%\lynx set WGETURL=http://www.fredlwm.hpg.ig.com.br/cygwin/lynx/download/MinGW/lynx.piz set WGETREF=http://www.fredlwm.hpg.ig.com.br/cygwin/lynx/ wget --referer=%WGETREF% -Olynx.zip %WGETURL% wget http://lynx.isc.org/current/lynx2-8-5/lynx.cfg %BASEDIR%\infozip\unzip\unzip -o lynx.zip set LYNX_CFG=%BASEDIR%\lynx\Lynx\lynx.cfg set LYNXDIR=%BASEDIR%\lynx\Lynx echo %LYNXDIR%\lynx.exe -cfg=%LYNXDIR%\lynx.cfg %%1 %%2 %%3 %%4 > \windows\lynx.bat @echo ================= @echo The text mode web-browser Lynx may have been installed @echo successfully. You should be able to see how it works by typing @echo lynx @echo now on the command line. @echo @echo The installation of the lynx browser required the prior @echo installation of the 'infozip' and 'wget' tools. If you @echo have a problem using the unix tools, run these other @echo installation programs first, and then rerun the lynx @echo installation script. @echo ================= :endifLB @rem ------------------------------------------------------- if NOT %PROG%==lynxconf goto endifLC mkdir %BASEDIR%\lynx cd %BASEDIR%\lynx set LYNX_CFG=%BASEDIR%\lynx\Lynx\lynx.cfg set LYNXDIR=%BASEDIR%\lynx\Lynx set LYNXURI=file://localhost/C:/%BASENAME%/lynx/Lynx wget http://www.geocities.com/matth3wbishop/eg/batch/lynx_bookmarks.htm copy lynx_bookmarks.htm "%HOMEPATH%" echo INCLUDE:%LYNXDIR%\lynx.cfg.dist >> %LYNXDIR%\lynx.cfg rem -- Set the help to be displayed when the user presses h in lynx rem -- A remote help file is located below but it takes longer to get to. rem -- http://www.subir.com/lynx/lynx_help/lynx_help_main.html echo HELPFILE:%LYNXURI%/lynx_help/lynx_help_main.html.gz >> %LYNX_CFG% rem -- Dont stop to ask the user if they wish to accept rem -- the cookies which the server has sent, just accept them. echo ACCEPT_ALL_COOKIES:TRUE >> %LYNX_CFG% rem -- Make google the default home page for lynx. echo STARTFILE:http://www.google.com >> %LYNX_CFG% rem -- Display the url of the current link at the bottom of the rem -- lynx screen rather than a help message. echo DEFAULT_USER_MODE:ADVANCED >> %LYNX_CFG% rem -- Allow the user to edit local files using the 'vim' rem -- text editor. press e in lynx to edit the active link echo DEFAULT_EDITOR:c:/m3b/vim/vim/vim62/vim.exe >> %LYNX_CFG% rem -- When displaying directories on the local computer, also rem -- display so called 'hidden' files, which on Windows start rem -- with an underscore character. echo NO_DOT_FILES:FALSE >> %LYNX_CFG% rem -- Set up wget as the background file downloader, so that rem -- the user can continue to browser using lynx while the file rem -- is downloading. echo EXTERNAL:http:start wget %%s :TRUE >> %LYNX_CFG% rem -- Attempt to set up playing of soundfiles using a command rem -- line player which is part of the unixutils package (from rem -- sourceforge). Assuming the player is on the path echo VIEWER:audio/mpeg:gplay %%s : >> %LYNX_CFG% rem echo EXTERNAL:http:start wget %s :TRUE >> %LYNX_CFG% @echo ================= @echo The text mode web-browser Lynx may have been configured @echo successfully. You should be able to see how it works by typing @echo lynx @echo now on the command line. @echo @echo The configuration of the lynx browser required the prior @echo installation of the lynx. If you @echo have a problem using the unix tools, run these other @echo installation programs first, @echo ================= :endifLC @rem @rem ------------------------------------------------------- if NOT %PROG%==arachne goto endifAB @rem --- get the dos and windows dos-box browser 'Arachne' @rem --- mkdir %BASEDIR%\arachne path=%path%;%BASEDIR%\arachne cd %BASEDIR%\arachne IF EXIST %BASEDIR%\arachne\a173gplf.zip GOTO endif10 wget http://home.hetnet.nl/~ba8tian/arachne/a173gplf.zip :endif10 %BASEDIR%\infozip\unzip\unzip -o a173gplf.zip @rem -- arachne needs to be setup and configured by running the @rem -- setup program. I am not sure how this can be automated @rem -- currently. Arachne appears to be distributed under the GPL @rem -- although some of the documentation indicates that the core.exe @rem -- code is not open-source ? :endifAB @rem ------------------------------------------------------- if NOT %PROG%==mjb goto endifMM mkdir %BASEDIR%\mjb @rem path=%path%;%BASEDIR%\mjb cd %BASEDIR%\mjb wget -nH -m -Ac,txt,htm,html,js,java,class,css -Imatth3wbishop http://www.geocities.com/matth3wbishop @echo The web-site at http://www.geocities.com/matth3wbishop/ has been @echo mirrored locally at %BASEDIR%\mjb @echo However only the following file extensions were retrieved @echo c,txt,htm,html,js,java,class,css :endifMM @rem ------------------------------------------------------- if NOT %PROG%==vim goto endifVI rmdir /s/q %BASEDIR%\vim mkdir %BASEDIR%\vim @rem -- The line below is very XP/NT specific since it uses @rem -- substitutions in the variable. @rem path=%path:%BASEDIR%\vim\vim\vim62=% cd %BASEDIR%\vim wget -N ftp://ftp.vim.org/pub/vim/pc/vim62w32.zip wget -N ftp://ftp.vim.org/pub/vim/pc/vim62rt.zip %BASEDIR%\infozip\unzip\unzip -o *.zip cd %BASEDIR%\vim\vim\vim62 rem install -create-vimrc -install-popup -add-start-menu -install-icons -create-directories install @echo The text editor vim has (probably) been installed successfully @echo in the directory %BASEDIR%\vim\vim\vim62 @echo Type vim to start it and then type :help to see how it works. @echo Dependencies: wget, unzip @echo In some versions of windows you will have to set your Path @echo variable to the directory above. :endifVI @rem ------------------------------------------------------- if NOT %PROG%==vimconf goto endifVC mkdir %BASEDIR%\vim cd %BASEDIR%\vim\vim\vim62 echo set helpheight=40 >> vimrc_example.vim @echo The text editor vim has (probably) been configured @echo Dependencies: vim :endifVC @rem ------------------------------------------------------- if NOT %PROG%==curl goto endifCU rmdir /s/q %BASEDIR%\curl mkdir %BASEDIR%\curl cd %BASEDIR%\curl wget http://curl.haxx.se/download/openssl-0.9.7e-win32-bin.zip wget http://curl.haxx.se/download/curl-7.15.0-win32-ssl.zip %BASEDIR%\infozip\unzip\unzip -o *.zip copy /y %BASEDIR%\curl\curl-7.15.0\curl.exe \windows\ copy /y %BASEDIR%\curl\*.dll \windows\ @echo Dependencies: wget, unzip @echo Type curl to see what the curl program @echo can do. :endifCU @rem ------------------------------------------------------- if NOT %PROG%==geoftp goto endifGF set URL=http://www.geocities.com/matth3wbishop rmdir /s/q %BASEDIR%\geoftp mkdir %BASEDIR%\geoftp cd %BASEDIR%\geoftp wget -O vimgeo.sh -N %URL%/eg/unix-shell/vimgeo.txt wget -O upload-geocities.sh -N %URL%/eg/unix-shell/upload-geocities.txt wget -O login-geocities-uu.sh -N %URL%/eg/unix-shell/login-geocities-uu.txt copy upload-geocities.bat ug.bat echo sh -i %%BASEDIR%%\geoftp\login-geocities-uu.sh %%1 %%2 > \windows\lg.bat copy \windows\lg.bat \windows\login-geocities.bat @rem @rem -- Make a batch script to start the upload function and put it @rem -- in a directory which should be in the windows path, but @rem -- but may not be. @rem echo set OLDFILE=%%1 > \windows\ug.bat echo set NEWFILE=%%OLDFILE:.bat=.txt%% >> \windows\ug.bat echo set NEWFILE=%%NEWFILE:.sh=.txt%% >> \windows\ug.bat echo copy %%OLDFILE%% %%NEWFILE%% >> \windows\ug.bat echo sh -i %BASEDIR%\geoftp\upload-geocities.sh %%NEWFILE%% %%2 %%3 >> \windows\ug.bat copy \windows\ug.bat \windows\upload-geocities.bat echo ========================================== echo The command line interface to uploading to a geocities free echo account may have been installed successfully in the echo directory %BASEDIR%\geoftp echo Dependencies: wget, curl, unixtools echo Type echo echo echo lg [password] or echo lg [password] [geocities-account-name] and then echo ug [file-to-upload] [target-directory] echo echo The default account name is 'matth3wbishop' echo ========================================== :endifGF @rem ------------------------------------------------------- if NOT %PROG%==putty goto endifPT rmdir /s/q %BASEDIR%\putty mkdir %BASEDIR%\putty cd %BASEDIR%\putty wget "http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe" wget "http://the.earth.li/~sgtatham/putty/latest/x86/psftp.exe" wget "http://the.earth.li/~sgtatham/putty/latest/x86/pscp.exe" wget "http://the.earth.li/~sgtatham/putty/latest/x86/puttygen.exe" @rem -- %BASEDIR%\infozip\unzip\unzip -o *.zip copy /y %BASEDIR%\putty\*.exe \windows\ @echo Dependencies: wget @echo Type putty to see what the putty program @echo can do. :endifPT @rem ------------------------------------------------------- if NOT %PROG%==bluej goto endifBJ set BLUEDIR=%BASEDIR%\bluej set PLUGURL=http://www.cs.appstate.edu/~jrc/remoteFileManager/1.0.4/expanded rmdir /s/q %BLUEDIR% mkdir %BLUEDIR% cd %BLUEDIR% wget "http://www.bluej.org/download/files/bluejsetup-205.exe" wget %PLUGURL%/RemoteFileManager.jar wget %PLUGURL%/RemoteFileManager.properties @rem @rem -- Make a batch script to start the bluej editor and put it @rem -- in a directory which should be in the windows path, @rem -- . @rem echo \bluej\bluej.exe > \windows\bluej.bat echo rem >> \windows\bluej.bat @echo Dependencies: wget @echo click on the bluej executable to install bluej @echo :endifBJ @rem ------------------------------------------------------- if NOT %PROG%==java goto endifJP set JAVADIR="\program files\java\jdk1.5.0_05\bin" rem wget "http://www.bluej.org/download/files/bluejsetup-205.exe" @rem @rem -- Make a batch script to put java on the path @rem -- . @rem echo %JAVADIR%\javac.exe %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 > \windows\javac.bat echo %JAVADIR%\jar.exe %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 > \windows\jar.bat echo %JAVADIR%\javadoc.exe %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 > \windows\javadoc.bat @echo Dependencies: @echo @echo :endifJP @rem ------------------------------------------------------- @rem -- Try to get the java source files for a program that is @rem -- supposed to be a language tutor. I could just download a @rem -- 'jar' file but I am assuming that I do not actually have a @rem -- java development kit installed locally since most of my work @rem -- is done in internet cafes. In this case no 'jar' tool will @rem -- be available and it will be necessary to compile the source @rem -- files on some server computer eg bumble.sf.net @rem @rem if NOT %PROG%==langprog goto endifLP set LANGSITE=http://www.geocities.com/matth3wbishop/eg/java/lang/ mkdir %BASEDIR%\langprog cd %BASEDIR%\langprog wget %LANGSITE% -Ajava,class -r -l1 -nH -nc -nd @rem @rem -- . @rem @echo Dependencies: wget @echo Source files for the language tutor may have been downloaded @echo to %BASEDIR%\langprog @rem ------------------------------------------------------- :endifLP @rem ------------------------------------------------------- if NOT %PROG%==tinyc goto endifTC rmdir /s/q %BASEDIR%\tinyc mkdir %BASEDIR%\tinyc cd %BASEDIR%\tinyc wget http://laurenssimonis.com/tcc/tcc-0.9.23.zip %BASEDIR%\infozip\unzip\unzip -o tcc-0.9.23.zip echo set OLDPATH=%%PATH%% > \windows\tcc.bat echo path=%BASEDIR%\tinyc\tcc-0.9.23\tcc;%%PATH%% >> \windows\tcc.bat echo %BASEDIR%\tinyc\tcc-0.9.23\tcc\tcc.exe -L%BASEDIR%\tinyc\tcc-0.9.23\lib -I%BASEDIR%\tinyc\tcc-0.9.23\include %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 >> \windows\tcc.bat echo path=%%OLDPATH%% >> \windows\tcc.bat @echo The TinyC c language compiler was possibly installed to @echo %BASEDIR%\tinyc\ . @echo Type 'tcc' to use it or look in the doc directory @echo The installation of the compiler required the prior @echo installation of the 'infozip' and 'wget' tools. If you @echo have a problem using the compiler, run these other @echo installation programs first, and then rerun the @echo installation program. :endifTC goto end :error1 @echo Error 1 occurred goto end :error2 @echo Error 2 occurred goto end :end cd %STARTDIR% @rem echo doskey >> \autoexec.bat @rem echo path=%path% >> \autoexec.bat