Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- totalFiles = 0
- type = "generic"
- w, h = term.getSize()
- if not term.isColor() then
- term.clear()
- term.setCursorPos(1,1)
- print("Installation failed: Must have an advanced computer")
- return
- end
- function install(addr, fn)
- term.clear()
- writeText("Installing "..type.." files...", 0)
- term.setCursorPos(1,19)
- write("Total Files: "..totalFiles)
- term.setCursorPos(1,1)
- print("Installing..."..fn)
- stuff = http.get(addr).readAll()
- f = fs.open(fn, "w")
- f.write(stuff)
- f.close()
- totalFiles = totalFiles + 1
- end
- function centerText(txt, offset)
- term.setCursorPos(w / 2 - math.floor(string.len(txt) / 2), h / 2 + offset)
- print(txt)
- end
- function topText(txt)
- term.setCursorPos(w / 2 - math.floor(string.len(txt) / 2), 1)
- print(txt)
- end
- function writeText(txt, offset)
- w, h = term.getSize()
- term.setCursorPos(w / 2 - math.floor(string.len(txt) / 2), h / 2 + offset)
- write(txt)
- end
- function installAll()
- fs.makeDir("rSettings")
- fs.makeDir("rOS")
- fs.makeDir("rPrograms")
- fs.makeDir("rPaints")
- fs.makeDir("rPrograms/userPrograms")
- fs.makeDir("rApis")
- fs.makeDir("rPaints/icons")
- fs.copy("temp", "rSettings/username")
- un = fs.open("rSettings/username", "w")
- un.writeLine(username)
- un.close()
- fs.copy("temp", "rSettings/password")
- pass = fs.open("rSettings/password", "w")
- pass.writeLine(password)
- pass.close()
- type = "OS"
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/startup", "startup")
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rOS/desktop", "rOS/desktop")
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rOS/login", "rOS/login")
- type = "API"
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/apis/check", "rApis/check")
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/apis/text", "rApis/text")
- type = "settings"
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rSettings/useAdmin", "rSettings/useAdmin")
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rSettings/system", "rSettings/system")
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rSettings/startMenu", "rSettings/startMenu")
- type = "image"
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rPaints/startMenu", "rPaints/startMenu")
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rPaints/icon", "rPaints/icon")
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rPaints/icons/consoleIcon", "rPaints/icons/consoleIcon")
- type = "program"
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rPrograms/console", "rPrograms/console")
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rPrograms/installer", "rPrograms/installer")
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rPrograms/settings", "rPrograms/settings")
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rPrograms/settingsLogin", "rPrograms/settingsLogin")
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/rPrograms/settingsSystem", "rPrograms/settingsSystem")
- shell.run("set shell.allow_disk_startup false")
- os.reboot()
- end
- print("Are you sure you want to install RavenOS? (Y/n)")
- while true do
- write("> ")
- option = read()
- if string.lower(option) == "yes" then
- break
- elseif string.lower(option) == "y" then
- break
- elseif string.lower(option) == "ya" then
- break
- elseif string.lower(option) == "yep" then
- break
- elseif string.lower(option) == "no" then
- print("Installation cancelled!")
- return
- elseif string.lower(option) == "n" then
- print("Installation cancelled!")
- return
- elseif string.lower(option) == "nah" then
- print("Installation cancelled!")
- return
- elseif string.lower(option) == "nope" then
- print("Installation cancelled!")
- return
- else
- print("Invalid Command")
- end
- end
- install("https://raw.githubusercontent.com/Raven0S/RavenOS-2.0/master/temp", "temp")
- term.setTextColor(colors.white)
- term.setBackgroundColor(colors.cyan)
- term.clear()
- term.setCursorPos(1,1)
- topText("===[ RavenOS Installer ]===")
- centerText("Create Account", 0)
- centerText("Skip", 2)
- while true do
- event, button, x, y = os.pullEvent("mouse_click")
- if button == 1 then
- if y == 9 then
- term.clear()
- topText("===[ RavenOS Installer ]===")
- centerText("Username: ", -1)
- centerText("Password: ", 1)
- term.setCursorPos(24, 8)
- username = read()
- term.setCursorPos(24, 10)
- password = read()
- installAll()
- elseif y == 11 then
- fs.copy("temp", "rSettings/doNotLogin")
- installAll()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement