width 80,25 screen 0 color 15,1 cls Title "DJGPP Installer v1.0" print print "This installer will install the folowing items on your computer:" print Bullet "The DJGPP Basic Development kit","" Bullet "RHIDE Integrated Development Environment","" Bullet "GNU Assembler/Linker","" Bullet "GCC C Compiler","" Bullet "GNU Makefile Processor","" Bullet "GNU Info file viewer","" Bullet "Allegro 3.12","" print print "Do you wish to continue ?" waitforinput: select case input$(1) case "y","Y" case "n","N" color 7,0 cls end case else goto waitforinput end select cls djDir$="C:\DJGPP" getpath: print "Current Installation path: ";djDir$ input "New Installation path: ", iDir$ if lcase$(right$(idIr$,3))="dev" OR lcase$(right$(idIr$,4))="dev\" then print "Cannot use \DEV path." print goto getpath end if if left$(iDir$,1)="\" then iDir$=curDrive$+iDir$ if iDir$="" then djDir$=djDir$ else djDir$=iDir$ end if if LEN(dir$(djDir$,16)) then else mkdir djDir$ end if print "Installing DJGPP..." open "install.lst" for input as #1 DO UNTIL EOF(1) sk: ON ERROR goto dn line input #1, mf$ if left$(mf$,1)="#" then cls print right$(mf$,(LEN(mf$)-1)) sleep 1 goto sk: end if if left$(mf$,1)=";" then goto sk if mf$<>"" then shell "unzip32 "+curdir$+"\"+mf$+" -d "+djDir$ LOOP dn: close print "Changing AUTOEXEC.BAT. Old version saved as AUTOEXEC.DJ" ON ERROR goto nox NAME "C:\AUTOXEC.BAT" AS "C:\AUTOEXEC.DJ" OPEN "C:\AUTOEXEC.DJ" for INPUT as #2 OPEN "C:\AUTOEXEC.BAT" for OUTPUT as #3 DO UNTIL EOF(2) line input #2,cs$ if left$(lcase$(cs$),4)="path" then if right$(cs$,1)=";" then cs$=cs$+djDir$+"\BIN" else cs$=cs$+";"+djDir$+"\BIN" end if end if if left$(lcase$(cs$),8)="set path" then if right$(cs$,1)=";" then cs$=cs$+djDir$+"\BIN" else cs$=cs$+";"+djDir$+"\BIN" end if end if print #3, cs$ LOOP print #3, "SET DJGPP="+djDir$+"\DJGPP.ENV" close #2 close #3 goto done nox: OPEN "C:\AUTOEXEC.BAT" for OUTPUT as #2 print #2, "@echo off" print #2, "SET PATH="+djDir$+"\BIN" print #2, "SET DJGPP="+djDir$+"\DJGPP.ENV" CLOSE done: print print "Done." print print "Don't forget to build Allegro." SUB Title (text$) locate 1,1 color 14,4 print space$(2);text$;space$(pbvScrnCols-(LEN(text$)+2)); color 15,1 END SUB SUB Center (text$) if right$(text$,1)=";" then text$=left$(text$,(LEN(text$)-1)) lineskip=0 else lineskip=1 end if middle%=INT((pbvScrnCols/2)-(LEN(text$)/2)) locate CSRLIN, middle% if lineskip=1 then print text$ else print text$; END SUB SUB Bullet (text$, bulletChar$) if bulletChar$="" then bulletChar$=chr$(254) bulletChar$=" "+bulletChar$+" " if right$(text$,1)=";" then text$=left$(text$,(LEN(text$)-1)) lineskip=0 else lineskip=1 end if if lineskip=1 then print bulletChar$+text$ else print bulletChar$+text$; END SUB FUNCTION curDrive$ FUNCTION=left$(curdir$,2) END FUNCTION