Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --start file
- local InterfaceSystem = nil
- local SystemFolder = nil
- local User = nil
- local function StartSystem()
- shell.run(fs.complete(SystemFolder,"System1.lua"),"start",InterfaceSystem,User)
- end
- local function PrepareUpdate(Folder)
- local version
- local Details = fs.open(fs.complete(Folder,"Details.txt"),"r")
- version = Details.readLine()
- Details.close()
- local Update_Dir = fs.open(fs.complete(Folder,"DirChanges.txt"),"r")
- local Dirs = textutils.unserialize(Update_Dir.readAll())
- for i = 1, #Dirs do
- if fs.exists(Dirs[i]) then else fs.makeDir(Dirs[i]) end
- end
- Update_Dir.close()
- local Update_Files = fs.open(fs.complete(Folder,"FileChanges.txt"),"r")
- local Files = textutils.unserialize(Update_Files.readAll())
- for i = 1, #Files do
- if Files[i][2] == "remove" then fs.delete(Files[i][1]) elseif (Files[i][2] == "replace" or Files[i][2] == "add") then shell.run("pastebin","get",Files[i][3],Files[i][1]) end
- end
- Update_Files.close()
- fs.delete(Folder)
- settings.set("os_version",version)
- settings.save()
- end
- local function SetupCalls(Data)
- settings.load(Data[1][2])
- if Data[2][2] ~= nil then PrepareUpdate(Data[2][2]) os.reboot() end
- StartSystem()
- end
- local function readBoot()
- local BOOT = fs.open("bootresults.sys","r")
- local Results = textutils.unserialize(BOOT.readAll())
- BOOT.close()
- SetupCalls(Results)
- end
- readBoot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement