Advertisement
Guest User

installer

a guest
Apr 14th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.53 KB | None | 0 0
  1. if fs.exists("sys/isInstalled") == true then
  2.   print("Os already installed, please eject disk")
  3.   sleep(1)
  4. else
  5.   local newUser
  6.   local newPass
  7.   term.clear()
  8.   term.setCursorPos(1,1)
  9.   print("+=================================================+")
  10.   print(" PsychicOs GUI Beta V5.11 Installer ")
  11.   print("+=================================================+")
  12.   term.setCursorPos(1,5)
  13.   term.write("Create username:_____________________")
  14.   term.setCursorPos(1,7)
  15.   term.write("Create password:_____________________")
  16.   term.setCursorPos(17,5)
  17.   newUser = read()
  18.   term.setCursorPos(17,7)
  19.   newPass = read()
  20.   sleep(1)
  21.   term.setCursorPos(1,9)
  22.   term.write("Confirm username and password? Yes/No : ")
  23.   local confirm = read()
  24.     if confirm == "No" then
  25.       sleep(1)
  26.       os.reboot()
  27.       elseif confirm == "Yes" then
  28.       fs.makeDir("sys")
  29.       local q = fs.open("sys/isInstalled", "w")
  30.       q.writeLine("This Os is installed, this file tells the installer if os data has been written to this computer. If you want to do a fresh install, delete startup and the sys directory")
  31.       q.close()
  32.       local u = fs.open("sys/username", "w")
  33.       u.writeLine(newUser)
  34.       u.close()
  35.       local p = fs.open("sys/password", "w")
  36.       p.writeLine(newPass)
  37.       p.close()
  38.       shell.run("pastebin","get","7QBZYSRW","startup.file")
  39.       fs.copy("disk/startup.file", "startup")
  40.       print("Please remove install disk after reboot")
  41.       sleep(3)
  42.       os.reboot()
  43.       else
  44.       sleep(1)
  45.       os.reboot()
  46.     end
  47.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement