Advertisement
MC403

SJNOS-DevInstaller

May 22nd, 2015
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.68 KB | None | 0 0
  1. --SJNOS by MC403. dev_installer.exe (wfj0Htpa)
  2.  
  3. term.setCursorPos(1,1)
  4. term.setBackgroundColor(colors.gray)
  5. term.setTextColor(colors.orange)
  6. term.clear()
  7.  
  8. print("SJNOS DEV-Installer. Please reboot before using!\n\n")
  9. print("NORMAL = ENTER\nREALFAST = BACKSPACE\nEXIT = CTRL-T (5sec)\n\n")
  10. print("Normal AND Realfast will delete SJNOS!")
  11.  
  12. local realfast = false
  13.  
  14. while true do
  15.     local event, btn = os.pullEvent()
  16.     if (btn == 14) then
  17.         realfast = true
  18.         break
  19.     elseif (btn == 28) then
  20.         break
  21.     end
  22. end
  23.  
  24.  
  25. fs.delete("SJNOS")
  26.  
  27.  
  28. function import(path,code)
  29.     shell.run("pastebin","get",code,path)
  30. end
  31. function makeDir(path)
  32.     fs.makeDir(path)
  33. end
  34. function makeFile(path, content)
  35.     h = fs.open(path,"w")
  36.     for i=1, #content do
  37.         h.writeLine(content[i])
  38.     end
  39.     h.close()
  40. end
  41.  
  42. makeDir("SJNOS")
  43. makeDir("SJNOS/system")
  44.     makeDir("SJNOS/system/about")
  45.         makeFile("SJNOS/system/about/ver.txt",{"ver=1.4.3","status=Alpha"})
  46.         makeFile("SJNOS/system/about/changelog.txt",{"-Better Graphics","-New SJNOS Core","-New SJNOS System","-More Programs","-Games","-Part-Installer","-MUCH MORE!!!"})
  47.         makeFile("SJNOS/system/about/SJN.txt",{"SJN","SJN is awesome!!!"})
  48.     makeDir("SJNOS/system/boot")
  49.         import("SJNOS/system/boot/setup.sys","--------")
  50.     makeDir("SJNOS/system/SJNOS")
  51.         import("SJNOS/system/SJNOS/desktop.sys","qK1cVg8R")
  52.         import("SJNOS/system/SJNOS/login.sys","ztDHMfrm")
  53.         import("SJNOS/system/SJNOS/logout.sys","--------")
  54.         import("SJNOS/system/SJNOS/games.sys","--------")
  55.         import("SJNOS/system/SJNOS/programs.sys","--------")
  56.         import("SJNOS/system/SJNOS/plugins.sys","--------")
  57.         import("SJNOS/system/SJNOS/settings.sys","--------")
  58.         import("SJNOS/system/SJNOS/network.sys","vpwucSht")
  59.         import("SJNOS/system/SJNOS/help.sys","--------")
  60.         import("SJNOS/system/SJNOS/deinstall.sys","i8DykZUj")
  61.         import("SJNOS/system/SJNOS/applications.sys","gNEADRX9")
  62.         import("SJNOS/system/SJNOS/rednet.sys","pQbhxiMi")
  63.         import("SJNOS/system/SJNOS/peripherals.sys","46bGWX3t")
  64.         import("SJNOS/system/SJNOS/sjn","Ab5cy6F2")
  65. makeDir("SJNOS/net")
  66.     makeDir("SJNOS/net/web")
  67.         import("SJNOS/net/web/sweb","Bex5SsgL")
  68. makeDir("SJNOS/data")
  69.     makeDir("SJNOS/data/icons")
  70.         makeFile("SJNOS/data/icons/sjn.img",{"9999 9999 9  9 1111 1111","9       9 99 9 1  1 1   ","9999    9 9 99 1  1 1111","   9    9 9  9 1  1    1","9999 9999 9  9 1111 1111"})
  71.         makeDir("SJNOS/data/icons/desktop")
  72.             makeFile("SJNOS/data/icons/desktop/desktop.img",{"00000000","ffffffff","f999999f","f999999f","ffffffff","000ff000","0ffffff0"})
  73.             makeFile("SJNOS/data/icons/desktop/apps.img",{"77777777","77999177","79777917","79777917","79999917","79777917","77777777"})
  74.             makeFile("SJNOS/data/icons/desktop/files.img",{"88888888","87777778","88888888","87777778","88888888","87777778","88888888"})
  75.             makeFile("SJNOS/data/icons/desktop/plugins.img",{"44444444","44444444","4ff44f44","ff44efff","4ff44f44","44444444","44444444"})
  76.             makeFile("SJNOS/data/icons/desktop/settings.img",{"aaaaaaaa","aaa0aaaa","aa000aaa","a00a00aa","aa000aaa","aaa0aaaa","aaaaaaaa"})
  77.             makeFile("SJNOS/data/icons/desktop/peripheral.img",{"ffffffff","f777777f","f788888f","f777777f","f777777f","f7775e7f","ffffffff"})
  78.             makeFile("SJNOS/data/icons/desktop/network.img",{"88888888","88788788","87888878","87877878","87888878","88788788","88888888"})
  79.             makeFile("SJNOS/data/icons/desktop/help.img",{"11111111","11777111","17111711","11111711","11177111","11111111","11171111"})
  80.         makeDir("SJNOS/data/icons/users")
  81.             makeFile("SJNOS/data/icons/users/img.cfg",{"files=9","cc.img=ComputerCraft","football.img=Football","flower.img=Flower","tree.img=Tree","book.img=Book","money.img=Money","cactus.img=Cactus","spider.img=Spider","boat.img=Boat"})
  82.             makeFile("SJNOS/data/icons/users/cc.img",{"fffffffffffff","f77777777777f","f7f0fffffff7f","f7ff0ff00ff8f","f8f0fffffff8f","f88888888888f","f888888885e8f","fffffffffffff"})
  83.             makeFile("SJNOS/data/icons/users/football.img",{"   7777777","  70ffff007"," 70000000007"," 700000fff07"," 7fff00fff07"," 7fff0000007","  7ff00fff7","   7777777"})
  84.             makeFile("SJNOS/data/icons/users/flower.img",{"4443333333333","4443344433333","3333411143333","3333344433333","3333535353333","3333355533333","3333335333333","ddddddddddddd"})
  85.             makeFile("SJNOS/data/icons/users/tree.img",{"3333333333444","3333555553444","3333555553333","3333555553555","555333c333555","555333c3333d3","3c3333c3333c3","ddddddddddddd"})
  86.             makeFile("SJNOS/data/icons/users/book.img",{"ccccccccccccc","cccfffffffccc","cccf33433fccc","cccf34143fccc","cccf33533fccc","cccfdddddfccc","cccfffffffccc","ccccccccccccc"})
  87.             makeFile("SJNOS/data/icons/users/money.img",{"","    11111","   1474471","  147747471","  174747471","   1474471","    11111",""})
  88.             makeFile("SJNOS/data/icons/users/cactus.img",{"4433333333333","443ddd3333333","333d8d3ddd333","333ddd3ddd333","333ddddd8d333","33333d8ddd333","33333ddd33333","4444444444444"})
  89.             makeFile("SJNOS/data/icons/users/spider.img",{"ccccccccccccc","ccfccfffccfcc","cffcfffffcffc","ffcfffffffcff","fccfefffefccf","fcccfffffcccf","ccccccccccccc","ccccccccccccc"})
  90.             makeFile("SJNOS/data/icons/users/boat.img",{"3333000033444","3330000003444","3300000000333","333333c333333","3888888888883","bb888888888bb","bbbb88888bbbb","bbbbbbbbbbbbb"})
  91.         makeDir("SJNOS/data/icons/system")
  92.             makeFile("SJNOS/data/icons/system/boot.img",{"  11111111"," 999999991","0000000091","000000009","00000000"})
  93.     makeDir("SJNOS/data/programs")
  94.         import("SJNOS/data/programs/terminal.exe","GdZsddz6")
  95.         import("SJNOS/data/programs/filemgr.exe","3FEeWeG8")
  96.         import("SJNOS/data/programs/stext.exe","--------")
  97.         import("SJNOS/data/programs/spaint.exe","--------")
  98.         import("SJNOS/data/programs/sedit.exe","--------")
  99.         import("SJNOS/data/programs/taskmgr.exe","--------")
  100.     makeDir("SJNOS/data/games")
  101.         import("SJNOS/data/games/jumper.exe")
  102. makeDir("SJNOS/settings")
  103.     makeFile("SJNOS/settings/settings.set",{"/|/|/|/|"})
  104.  
  105. makeDir("SJNOS/users")
  106. makeDir("SJNOS/plugins")
  107. makeDir("SJNOS/help")
  108.     import("SJNOS/help/help.exe","--------")
  109. import("SJNOS/start.exe","XBSAvvxB")
  110. makeFile("SJNOS/firstrun",{"true"})
  111.  
  112. term.setCursorPos(1,1)
  113. term.setBackgroundColor(colors.gray)
  114. term.setTextColor(colors.orange)
  115. term.clear()
  116.  
  117. local pcname = "DEV_PC"
  118. if (not realfast) then
  119.     write("PC_NAME: ")
  120.     pcname = read()
  121. end
  122. f = fs.open("SJNOS/settings/name.set","w")
  123. f.writeLine("pcname="..pcname)
  124. f.close()
  125. os.setComputerLabel(pcname)
  126.  
  127. local dns = 0
  128. if (not realfast) then
  129.     write("DNS: ")
  130.     dns = read()
  131. end
  132. local f = fs.open("SJNOS/settings/net.set","w")
  133. f.writeLine("dns="..dns)
  134. f.close()
  135.  
  136. local username = "Developer"
  137. local password = "a"..math.random(50)
  138. if (not realfast) then
  139.     write("Username: ")
  140.     username = read()
  141.     write("Password: ")
  142.     password = read("*")
  143. end
  144. local f = fs.open("SJNOS/settings/net.set","w")
  145. f.writeLine("dns="..dns)
  146. f.close()
  147.  
  148. local function makeLocDir(path)
  149.     makeDir("SJNOS/users/"..username.."/"..path)
  150. end
  151. local function makeLocFile(path,content)
  152.     local h = fs.open("SJNOS/users/"..username.."/"..path, "w")
  153.     for i=1, #content do
  154.         h.writeLine(content[i])
  155.     end
  156.     h.close()
  157. end
  158.  
  159. makeLocDir("")
  160. makeLocDir("config")
  161. makeLocDir("home")
  162. makeLocFile("config/.config", {"d1="..username, "d2="..password, "d3=SJNOS/data/icons/users/cc.img", "d4=a"})
  163. makeLocDir("home/apps")
  164. makeLocDir("home/apps/appdata")
  165. makeLocDir("home/files")
  166. makeLocDir("home/programs")
  167.  
  168.  
  169. term.setCursorPos(1,1)
  170. term.setBackgroundColor(colors.gray)
  171. term.setTextColor(colors.orange)
  172. term.clear()
  173.  
  174. if (realfast) then
  175.     print("Your password is: "..password..".\n")
  176. end
  177.  
  178. print("RUN = ENTER\nEXIT = BACKSPACE")
  179.  
  180. while true do
  181.     local event, btn = os.pullEvent()
  182.     if (btn == 28) then
  183.         shell.run("SJNOS/start.exe")
  184.         break
  185.     elseif (btn == 14) then
  186.         break
  187.     end
  188. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement