honzapat

CC Windows 8.1 installer

Mar 2nd, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. if(not term.isColor or not term.isColor())then
  2.     print("Windows 8.1 Can only run on advanced computers and turtles!")
  3.     error()
  4. end
  5.  
  6. if(not http)then
  7.     print("Windows 8.1 requires HTTP Api to run!")
  8.     error()
  9. end
  10.  
  11. function downloadFile(path, url)
  12.     print("Downloading: " .. path)
  13.     data = http.get(url).readAll()
  14.     file = assert(io.open(path, "w"))
  15.     file:write(data)
  16.     file:close()
  17. end
  18.  
  19. if(fs.exists("/os"))then
  20.     fs.delete("/os")
  21. end
  22.  
  23. if(fs.exists("startup"))then
  24.     fs.delete("startup")
  25. end
  26.  
  27. fs.makeDir("/os")
  28.  
  29. downloadFile("/installer", "https://raw.githubusercontent.com/NejcraftCCprojects/CC2W8/master/source/installer")
  30.  
  31. shell.run("/installer")
Advertisement
Add Comment
Please, Sign In to add comment