QuickMuffin8783

[ComputerCraft] Custom installer for other users!

Jul 2nd, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- CREDIT: Jummit for the installer of Opus OS! I am using it as a customizable installer for everyone.
  2.  
  3. -- Customize your title and stuff here!
  4. install = {
  5.   title = 'TerrariCCa',
  6.   version = '1.1',
  7.   author = 'Jummit',
  8.   description = [[
  9. A Terraria Clone, made in ComputerCraft
  10. ]],
  11.   license = [[
  12. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
  13.  
  14. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  15.  
  16. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  17.  
  18. ---===--- CREDITS ---===---
  19. Kelper for their amazing Github downloader!
  20. Use this as you wish to get this done]], -- Remove credits if needed.
  21.   copyrightYear = 2018, -- Copyright year (change if you want to)
  22.   copyrightHolders = 'Kepler', -- If you want it to be assigned to your username, change it if needed.
  23.   diskspace = 380000,
  24.   rebootAfter = false, -- Whether you are installing a operating system
  25.   gitRepo = 'Jummit/TerrariCCa', -- Repo
  26.   gitBranch = 'master', -- Branch to be selected that you want the others to install or not (you can add other branches to have a version to upgrade or downgrade.
  27.   branches = { -- Default.
  28.     { branch = 'master', description = 'Current Version' },
  29.   },
  30.   preCopy = function(mode)
  31.     if mode == 'update' then
  32.       fs.delete('sys')
  33.     end
  34.   end,
  35.   steps = { -- DON'T CHANGES THESE OR IT WILL BE BROKEN!!!!
  36.     install = {
  37.       'splash',
  38.       'license',
  39.       'branch',
  40.       'files',
  41.       'review',
  42.       'install',
  43.     },
  44.     update = {
  45.       'branch',
  46.       'review',
  47.       'install',
  48.     },
  49.     automatic = {
  50.       'install',
  51.     },
  52.     uninstall = {
  53.       'review',
  54.       'uninstall',
  55.     },
  56.   },
  57. }
  58.  
  59. print('Downloading Installer...')
  60.  
  61. local url ='https://raw.githubusercontent.com/QuickMuffin8782/Custom-Installer-with-MIT-license-/master/sys/apps/Installer.lua'
  62. local h = _G.http.get(url)
  63. if not h then
  64.   error('Failed to download installer (No such url)')
  65. end
  66.  
  67. local contents = h.readAll()
  68. if not contents then
  69.   error('Failed to download installer (Could not read file)')
  70. end
  71.  
  72. local fn, msg = load(contents, 'Installer.lua', nil, _ENV)
  73. if not fn then
  74.   _G.printError(msg)
  75. else
  76.   local args = { ... }
  77.   fn(args[1])
  78. end
Add Comment
Please, Sign In to add comment