os.pullEvent = os.pullEventRaw
opcje = {}
wybor = 1
opcje[1] = "Installieren "
opcje[2] = "Deintallieren"
opcje[3] = "Abbrechen    "
 
function uruchom(numer)
 if numer == 1 then

 
 if fs.exists("/laby/crash") then
shell.run("/disk/Laby/crash/Exit")
else
shell.run("/disk/Laby/setup2") end

 
 
 
end

 if numer == 2 then

 
 
 if fs.exists("/laby/crash") then
shell.run("/disk/Laby/Deinstall")
else
shell.run("clear")
textutils.slowPrint("Das Betriebsystem befindet sich")
textutils.slowPrint("nicht auf ihrem Rechner.")
sleep(3)
shell.run("/disk/Laby/Setup")
end
 
 
end



 if numer == 3 then

 
 
 shell.run("/disk/startup")
 

 end
end
 
function Taste()
 sleep(0)
 event, argument = os.pullEvent()
 if event == "key" then
  if argument == 28 then
   return uruchom(wybor)
  elseif argument == 200 then
   if wybor == 1 then
   else
    wybor = wybor - 1
   end
  elseif argument == 208 then
   if wybor == table.getn(opcje) then
   else
    wybor = wybor + 1
   end
  else
   return Taste()
  end
 else
  return Taste()
 end
 return menu()
end
 
function menu()
 shell.run("clear")
print("                Willkommen im Setup")
print("---------------------------------------------------")
print("                Geben sie genauere                 ")
print("            angaben zur installation an.           ")
print("---------------------------------------------------")

 for i=1, table.getn(opcje) do
  if wybor == i then
   print(" Auswahl> "..opcje[i].."      :")
  else
   print("          "..opcje[i].."      :")
  end
 end
    print("---------------------------------------------------")
	term.setCursorPos(15,10)
	print("Press Enter to next step")
 return Taste()
end
shell.run("clear")
return menu()