Advertisement
Spaceboy_Ross

CC-DOS Installer (V1.0)

Mar 26th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.28 KB | None | 0 0
  1. -- Variables
  2.  
  3. local build = {}
  4.  
  5. build.dosver = "1.0"
  6. build.gitrepo = "https://github.com/SpaceboyRoss01/cc-dos/raw/master/"
  7.  
  8. -- Functions
  9.  
  10. local function progress(p)
  11.     local prog = p/100
  12.     local w,h = term.getSize()
  13.     local per = "[ "..p.."% ]"
  14.     term.setCursorPos(math.floor(w-string.len(per)),math.floor(h-1)/2)
  15.     term.write(per)
  16. end
  17.  
  18. term.clear()
  19. term.setCursorPos(1,1)
  20. print("CC-DOS Version "..build.dosver.." Installer")
  21.  
  22. progress(0)
  23.  
  24. os.setComputerLabel("CC-DOS")
  25. fs.makeDir("/DOS")
  26. progress(25)
  27.  
  28. local startup_http = http.get(build.gitrepo.."src/Disk/startup.lua")
  29. local startup = fs.open("/startup","wb")
  30. startup.write(startup_http.readAll())
  31. startup_http.close()
  32. startup.close()
  33. progress(50)
  34.  
  35. local dos_http = http.get(build.gitrepo.."src/Disk/DOS/dos")
  36. local dos = fs.open("/DOS/dos","wb")
  37. dos.write(dos_http.readAll())
  38. dos_http.close()
  39. dos.close()
  40. progress(60)
  41.  
  42. local cfg_http = http.get(build.gitrepo.."src/Disk/config.sys")
  43. local cfg = fs.open("/config.sys","wb")
  44. cfg.write(cfg_http.readAll())
  45. cfg_http.close()
  46. cfg.close()
  47. progress(75)
  48.  
  49. local cmd_http = http.get(build.gitrepo.."src/Disk/command.lua")
  50. local cmd = fs.open("/command.lua","wb")
  51. cmd.write(cmd_http.readAll())
  52. cmd_http.close()
  53. cmd.close()
  54. progress(100)
  55.  
  56. os.reboot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement