Advertisement
theinsekt

updateinstaller

Mar 6th, 2015
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.22 KB | None | 0 0
  1. --pastebin run fjSV9kHj
  2. --pastebin get fjSV9kHj updateinstaller
  3. --will download installer programs, and updateinstaller program
  4.  
  5. --downloads the given file and then returns 2
  6. function pastebin(shellObj, path,code,overwrite)
  7.   if overwrite then
  8.    fs.delete(path)
  9.   end
  10.   shellObj.run("pastebin","get", code, path)
  11.   return 2
  12. end
  13.  
  14.  
  15.  
  16. --updates installer and self
  17. function updateInstaller(shellObj)
  18.   print("Updating...")
  19.  
  20.   --table with installed files
  21.   local installed={}
  22.  
  23.   --download latest installer
  24.   local code="2WLg1AWL"
  25.   local path="theinsektAPIs/installerAPI"
  26.   print("downloading installerAPI...")
  27.   pastebin(shellObj,path,code,true)
  28.  
  29.   --load installerAPI
  30.   print("loading installerAPI...")
  31.   os.loadAPI("theinsektAPIs/installerAPI")
  32.  
  33.   --mark installerAPI as installed
  34.   print("marking installerAPI as installed...")
  35.   installerAPI.markAsInstalled(installed, path,code)
  36.  
  37.   --use installerAPI to install additional installer programs,should also update self
  38.   print("downloading additional installer programs...")
  39.   local resCode=installerAPI.standardInstall(shellObj,installed,"E2yS26wy")
  40.  
  41.   print("Result: "..installerAPI.getRescodeMeaning(resCode))
  42. end
  43.  
  44. --do the update
  45. updateInstaller(shell)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement