Vladg24

OpenOS KuMir Installer

Dec 3rd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. local filesystem = require("filesystem")
  2. local component = require("component")
  3. local colors = require("colors")
  4. local gpu = component.gpu;
  5. local term = require("term");
  6.  
  7. if filesystem.get("bin/edit.lua") == nil or filesystem.get("bin/edit.lua").isReadOnly() then
  8.     error("Найдена дискетная файловая система: напишите \"install\" в командной строке и установить OpenOS на ваш Жёсткий Диск. После этого запустите установщик КуМир\'а для OpenOS снова или перейдите на https://github.com/Vladg24YT/OC-KuMir/tree/master/src и выберите другую ОС");
  9. else
  10.     gpu.setBackground(0x0000CC);
  11.     gpu.setForeground(0xFFFF33);
  12.     term.write("Загружаю установщик КуМир для OpenOS...");
  13.    
  14.     local installerPath = "/KuMir/installer.lua";
  15.     if filesystem.exists(installerPath) then
  16.         filesystem.remove(installerPath);
  17.     else
  18.         filesystem.makeDirectory(filesystem.path(installerPath));
  19.     end
  20.     loadfile("/bin/wget.lua")("https://raw.githubusercontent.com/Vladg24YT/OC-KuMir/master/src/OpenOS/installer.lua", installerPath, "-fQ");
  21.     term.write("\n\nУспешно!");
  22.     gpu.setBackground(0x000000);
  23.     gpu.setForeground(0xFFFFFF);
  24.     term.write("\n");
  25.     dofile(installerPath, ...);
  26. end
Add Comment
Please, Sign In to add comment