Advertisement
SuperRavenSn1per

ReactorOS Installer

Sep 6th, 2021 (edited)
544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.07 KB | None | 0 0
  1. --ReactorOS made by SuperRavenSn1per
  2.  
  3. repo = "https://raw.githubusercontent.com/SuperRavenSn1per/ReactorOS/"
  4. branch = "main"
  5.  
  6. directories = {"apis"}
  7. files = {"startup.lua", "apis/xText.lua", "interface.lua"}
  8.  
  9. function install(file, fileName)
  10.     if fs.exists(fileName) then
  11.         fs.delete(fileName)
  12.     end
  13.     dat = http.get(repo..branch.."/"..file).readAll()
  14.     f = fs.open(fileName, "w")
  15.     f.write(dat)
  16.     f.close()
  17. end
  18.  
  19. function installAll()
  20.     for i,dir in pairs(directories) do
  21.         fs.makeDir(dir)
  22.     end
  23.     for i,file in pairs(files) do
  24.         term.clear()
  25.         term.setCursorPos(1,1)
  26.         print("Installing..."..file)
  27.         install(file, file)
  28.     end
  29.     os.reboot()
  30. end
  31.  
  32. term.clear()
  33. term.setCursorPos(1,1)
  34. term.setTextColor(colors.yellow)
  35. print("ReactorOS Installer")
  36. term.setTextColor(colors.white)
  37. print("Are you sure you want to install ReactorOS? Loss of current files is possible. (Y/n)")
  38. while true do
  39.     input = string.lower(read())
  40.     if input == "y" then
  41.         installAll()
  42.     elseif input == "n" then
  43.         print("Install aborted!")
  44.         break
  45.     else
  46.         print("Please input 'Y or N'")
  47.     end
  48. end
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement