ndfjay

NDFInstaller

Dec 15th, 2012
1,729
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. if not http then
  2. error("This requires the HTTP API to be enabled, please enable it.", 2)
  3. end
  4.  
  5. if not term.isColor and not term.isColor() then
  6. if os.getVersion() == "CraftOS 1.3" then
  7. error("Sorry this OS can only run on Computers with CraftOS 1.4 and above.", 2)
  8. end
  9.  
  10. error("Sorry this OS can only run on Advanced Computers", 2)
  11. end
  12.  
  13. if fs.exists(".var/install") then
  14. fs.delete(".var/install")
  15. end
  16.  
  17. if not fs.exists (".var/") then
  18. fs.makeDir(".var/")
  19. end
  20.  
  21. function upWrite(path, text)
  22. local file = assert(io.open(path, "w"))
  23. file:write(text)
  24. file:close()
  25. end
  26.  
  27. local osEVer = http.get("http://cc.ndfjay.co.uk/NDFOS/.var/install")
  28. upWrite(".var/install", osEVer.readAll())
  29. osEVer.close()
  30.  
  31. shell.run(".var/install")
Advertisement
Add Comment
Please, Sign In to add comment