Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local files = {
- [1] = {
- "/System/Images/boot",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/System/Images/boot"
- },
- [2] = {
- "startup",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/startup"
- },
- [3] = {
- "/Programs/LuaIDE/program",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/Programs/LuaIDE/program"
- },
- [4] = {
- "/Programs/Sketch/program",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/Programs/Sketch/program"
- },
- [5] = {
- "/Desktop/LuaIDE",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/Desktop/LuaIDE"
- },
- [6] = {
- "/Desktop/Sketch",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/Desktop/Sketch"
- },
- [7] = {
- "/System/Images/desktop",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/System/Images/desktop"
- },
- [8] = {
- "/System/settings",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/System/settings"
- },
- [9] = {
- "/System/autoupdater",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/System/autoupdater"
- },
- [10] = {
- "/System/.version",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/System/.version"
- },
- [11] = {
- "/os",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/os"
- },
- [12] = {
- "/System/APIs/crasher",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/System/APIs/crasher"
- },
- [13] = {
- "/System/APIs/sha256",
- "https://raw.githubusercontent.com/Carbon-OS/CarbonOS/beta/System/APIs/sha256"
- }
- }
- if term.isColor() == false then
- print("Sorry, But you need an Advanced PC to run this OS!")
- else
- term.setBackgroundColor(colors.gray)
- term.clear()
- term.setCursorPos(16,8)
- print("Welcome to Carbon!")
- term.setCursorPos(11,10)
- print("A Fast, Simple, and Secure OS")
- term.setCursorPos(21,16)
- term.setBackgroundColor(colors.lightGray)
- print("Install")
- while true do
- local event, side, x, y = os.pullEvent("mouse_click")
- if x >= 21 and x < 28 and y == 16 then
- term.clear()
- shell.run("mkdir", "System")
- term.setCursorPos(1,1)
- textutils.slowPrint("Installing Carbon...")
- local req
- local code
- local file
- for k,v in pairs(files) do
- print("Downloading ", v[2], "...")
- req = http.get(v[2])
- if req ~= nil then
- code = req.readAll()
- req.close()
- else
- print("Failed!")
- end
- file = fs.open(v[1], "w")
- file.write(code)
- file.close()
- end
- file = fs.open("/System/.firstuse", "w")
- file.write("true")
- file.close()
- print("Done!")
- print("Rebooting...")
- os.sleep(1)
- os.reboot()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement