Advertisement
joebodo

web.install.example.lua

Dec 27th, 2016
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.08 KB | None | 0 0
  1. install = {
  2.   title       = 'Example Program',
  3.   version     = '1.0',
  4.   author      = 'yourname',
  5.   description = [[
  6. Provide a description
  7.  
  8. Can be multiline, word wrapping will occur on smaller screens
  9. ]],
  10.   license = [[
  11. 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:
  12.  
  13. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  14.  
  15. 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.]],
  16.   copyrightYear = 2016,
  17.   copyrightHolders = 'yourname',
  18.  
  19.   -- either list files
  20.   files = {
  21.     [ 'dir1/somefile1' ] = 'http://pastebin.com/raw/Cmnq3tgk',
  22.     [ 'dir1/somefile2' ] = 'http://pastebin.com/raw/Cmnq3tgk',
  23.     [ 'dir2/somefile3' ] = 'http://pastebin.com/raw/Cmnq3tgk',
  24.     [ 'dir2/somefile4' ] = 'http://pastebin.com/raw/Cmnq3tgk',
  25.     [ 'somefile5' ] = 'http://pastebin.com/raw/Cmnq3tgk',
  26.     [ 'somefile6' ] = 'http://pastebin.com/raw/Cmnq3tgk',
  27.     [ 'somefile7' ] = 'http://pastebin.com/raw/Cmnq3tgk',
  28.   },
  29.  
  30.   -- or supply git repo info
  31.   --gitUser   = 'user',
  32.   --gitRepo   = 'repo',
  33.   --gitBranch = 'branch',
  34.  
  35.   steps = {  -- the screens that will be displayed during install
  36.     install = { -- configure entries as desired
  37.       'splash',
  38.       'license',
  39.       'files',
  40.       'review',
  41.       'install', -- must be last
  42.     },
  43.     update = {
  44.       'review',
  45.       'install', -- must be last
  46.     },
  47.     automatic = {    -- no user interaction - can only contain 1 entry
  48.       'install',
  49.     },
  50.     uninstall = {
  51.       'review',
  52.       'uninstall', -- must be last
  53.     },
  54.   },
  55.  
  56.   -- all following are optional
  57.   directory   = 'test',    -- install into specific directory
  58.   rebootAfter = false,     -- If a reboot is required after installation
  59.   diskspace   = 40000,     -- approximate disk space required
  60.   preInstall  = function() -- called before install screen is displayed
  61.   end,
  62.   postInstall = function() -- called after the install is complete
  63.   end,
  64. }
  65.  
  66. print('Downloading Installer...')
  67.  
  68. local h = http.get('http://pastebin.com/raw/598YVLuc')
  69. if not h then
  70.   error('Failed to download installer')
  71. end
  72. local contents = h.readAll()
  73. if not contents then
  74.   error('Failed to download installer')
  75. end
  76. local fn, msg = load(contents, 'Installer.lua', nil, getfenv(1))
  77. if fn then
  78.   fn(...)
  79. else
  80.   error(msg)
  81. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement