Advertisement
Marlingaming

HeimBriech Tablet OS - UpdateManager

Sep 8th, 2021 (edited)
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. local oldPull = os.pullEvent
  2. os.pullEvent = os.pullEventRaw
  3. --this program for my OS is for the Finding of updates, and the Gathering of information of said update, it also acts as an Installer for first-time start up
  4. Temp_UpdateID = nil
  5. local Temp_State = "Start"
  6. Temp_V = ""
  7. local MenuLoc = nil
  8. local UpdateHandlerLoc = nil
  9. start()
  10.  
  11. function start()
  12. if settings.get("SystemState") == "firstStart" then
  13. InstallSystem()
  14. else
  15. NormalOperations()
  16. end
  17. end
  18.  
  19. function InstallSystem()
  20. local h = fs.open(".SystemDefiner","r")
  21. resp = http.get("pastebin","get","kyxapAuY",h.readLine(2)) --BootLoader
  22. resp = http.get("pastebin","get","1MXN4GWi",h.readLine(6)) --Menu
  23. resp = http.get("pastebin","get","",h.readLine(12)) --Security
  24. resp = http.get("pastebin","get","v1F8pTVs","start") --Starting File
  25. resp = http.get("pastebin","get","stV5TiqN",".Enc_TypeA") --Encryption Type A
  26. h.close()
  27. shell.run(".SystemFileManager","FirstTime","n")
  28. end
  29.  
  30. function NormalOperations()
  31. resp = http.get("pastebin","get","PxasuGsy","Temp_LatestVersion_OS") --Used to compare OS version to latest Version
  32. h = fs.open(".SystemDefiner","r")
  33. UpdateHandlerLoc = h.readLine(10)
  34. MenuLoc = h.readLine(6)
  35. h.close()
  36. local h = fs.open("Temp_LatestVersion_OS","r")
  37. Temp_V = settings.get("OS_Version")
  38. local LatVersion = h.readLine(2)
  39. h.close()
  40. if LatVersion ~= Temp_V then
  41. shell.run(UpdateHandlerLoc)
  42. else
  43. fs.delete("Temp_LatestVersion_OS")
  44. shell.run(MenuLoc)
  45. end
  46. end
  47. os.pullEvent = oldPull
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement