Programist135

InstallAssemblerForMineOS.lua

Sep 26th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.50 KB | None | 0 0
  1. local windows = require("windows")
  2. local fs = require("filesystem")
  3. local cmp = require("component")
  4. local sh = require("shell")
  5.  
  6. local function wget(link, saveTo)
  7.     sh.execute("wget -q "..link.." "..saveTo)
  8. end
  9.  
  10. if not cmp.isAvailable("internet") then
  11.     windows.universalWindow("auto", "auto", 20, 0xFFFFFF, true, {"EmptyLine"}, {"CenterText", 0x000000, "Для загрузки файлов необходима интернет-карта!"}, {"EmptyLine"}, {"Button", {0xFF0000, 0x000000, "Выход"}})
  12.     os.exit()
  13. end
  14.  
  15. windows.universalWindow("auto", "auto", 20, 0xFFFFFF, true, {"EmptyLine"}, {"CenterText", 0x000000, "Установка программы AppAssembler"}, {"EmptyLine"}, {"Switch", 0x00FF00, 0x636363, 0x000000, "Установить браузер Амиго", true}, {"EmptyLine"}, {"Button", {0x00FF00, 0x000000, "Установить"}})
  16. fs.makeDirectory("Assembler.app")
  17. fs.makeDirectory("Assembler.app/Resources")
  18. local lnk = io.open("/System/OS/Desktop/Assembler.lnk", "w")
  19. lnk:write("return \"Assembler.app\"")
  20. lnk:close()
  21. wget("https://preview.c9.io/programist135/mineosprogramfiles/Assembler/Assembler.lua", "/Assembler.app/Assembler.lua")
  22. wget("https://preview.c9.io/programist135/mineosprogramfiles/Assembler/Icon", "/Assembler.app/Resources/Icon.png")
  23. windows.universalWindow("auto", "auto", 20, 0xFFFFFF, true, {"EmptyLine"}, {"CenterText", 0x000000, "Установка успешно завершена!"}, {"EmptyLine"}, {"Button", {0x00FF00, 0x000000, "ОК"}})
Advertisement
Add Comment
Please, Sign In to add comment