Advertisement
Redxone

BlueCheeseOS ManualUpdater

May 8th, 2014
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. print "Checking For Updates..."
  2. shell.run("pastebin", "get", "Y3nhz2VP", "/.verCheck")
  3.  
  4. f = fs.open("/.verCheck", "r")
  5.     verCode = f.readLine()
  6. f.close()
  7.  
  8. if(fs.exists("/.version"))then
  9.     f = fs.open("/.version", "r")
  10.         olVer = f.readLine()
  11.     f.close()
  12.    
  13.     if(olVer == verCode)then
  14.         print "No Update Available"
  15.         fs.delete("/.verCheck")
  16.     else
  17.         print("Update Ver "..verCode.." Available Downloading...")
  18.         shell.run("pastebin", "get", "QPqvC7qu", "newUpdate")
  19.         fs.delete("/.verCheck")
  20.         f = fs.open("/.version", "w")
  21.             f.writeLine(verCode)
  22.         f.close()
  23.         print "Update Downloaded!"
  24.   print "Running Installer"
  25.   shell.run("newUpdate")
  26.   fs.delete("newUpdate")
  27.     end
  28. else
  29.     f = fs.open("/.version", "w")
  30.         f.writeLine("UpdateRequired")
  31.     f.close()
  32.     shell.run(shell.getRunningProgram())
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement