Advertisement
theinsekt

standard installer

Nov 21st, 2014
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.80 KB | None | 0 0
  1. --get this program with: pastebin run fjSV9kHj
  2. --Can download and perform the commands in an "installfile"
  3. --this makes it easier to install a program that has multiple files, or which uses other programs
  4.  
  5.  
  6. --example: install pastebin 9d5ATSSz
  7. os.loadAPI("theinsektAPIs/installerAPI")
  8. local args={...}
  9.  
  10. function main(shellObj)
  11.  if #args==0 then
  12.   print("Get this program like this:")
  13.   print("do: pastebin run fjSV9kHj")
  14.   print("Usage: installer installfile <code>")
  15.   return
  16.  end
  17.  
  18.  local installed={}
  19.  
  20.  local resCode = installerAPI.doInstallWords(shellObj,installed,args)
  21.  
  22.  if resCode < 0 then
  23.   error("Error: resCode "..tostring(resCode).." ("..installerAPI.getRescodeMeaning(resCode)..")")
  24.  end
  25.  
  26.  print("Result: ",installerAPI.getRescodeMeaning(resCode))
  27.  
  28.  return 0
  29.  
  30. end
  31.  
  32. main(shell)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement