Marlingaming

CC Tweaked CCSPS Iron - System Installer

Jan 24th, 2022 (edited)
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.72 KB | None | 0 0
  1. local version = "1.3.0"
  2.  
  3. local BootItems = {{"boot/Scripts/Base","rbK07i0v"},{"boot/Scripts/Scan","sf5duqYm"}}
  4. local ReqItems = {"os/System/Programs/Desktop_1","os/System/Programs/OsManager","os/System/Scripts/PowerOff","os/System/Programs/SecurityHandler","os/System/Programs/InstallManager","startup"}
  5. local OsPrograms = {{"os/System/Programs/Desktop_1","r5pLDFHu"},{"os/System/Programs/Desktop_2","FE0NVyu3"},{"os/System/Programs/OsManager","Diup5LY2"},{"os/System/Programs/SecurityHandler","2Aw0EFgE"},{"os/System/Scripts/ShortcutWriter","T4KikQv1"},{"os/System/Scripts/PowerOff","DBcaibHm"},{"os/System/Scripts/AccountSetup","bzmZQVyG"},{"os/System/Programs/InstallManager","rdFwqf4x"},{"os/System/Programs/BankingSystem-banking_public2","yvjTgmKx"},{"os/System/Programs/TextEditor","tVxPQRYL"},{"os/System/Programs/ProfileEditor","sSz8GzBX"},{"os/System/Programs/InstallHandler","EAkvbjqD"}}
  6.  
  7. local ClientApps = {{"Account","os/System/Client/Apps/UserAccount","FXT5QKny","n","Desktop"},{"MusicPlayer","os/System/Client/Apps/MusicPlayer_1","ptbDeZpf","n","Desktop"},{"FileExplorer","os/System/Programs/FileSystemNavigator","H4pZiweM","os/System/Saved/Images/Desktop_FileExplorer","Taskbar"},{"AppStore","os/System/Client/Apps/AppStore","xAGs0bci","os/System/Saved/Images/Desktop_AppStore","Taskbar"},{"Ex install","os/System/Client/Apps/ExInstall","BkGvhc2g","n","Desktop"},{"Help","os/System/Client/Apps/InstructionManual","f0vUBCJB","n","Desktop"},{"Bank","os/System/Client/Apps/BankingClient_bankin_public_2","3J06NExu","n","Desktop"},{"WebBrowser","os/System/Client/Apps/ImperialWebBrowser","2NVqG6bt","os/System/Saved/Images/Desktop_WebBrowser","Taskbar"},{"Settings","os/System/Programs/SettingsMenu","Zr6AWBhW","n","Popup"}}
  8.  
  9. local ClientInstall = "os/System/Programs/InstallHandler"
  10. local ScriptsLoc = "os/System/Scripts"
  11. local Images = {}
  12.  
  13. local Paster = "os/System/Scripts/SilentPaster"
  14.  
  15. local w, h = term.getSize()
  16.  
  17. local Title
  18.  
  19. function Text(Sub,Pro)
  20. os.sleep(1)
  21. Clear()
  22. CenterText(4,Title)
  23. CenterText(5,Sub)
  24. Bar(Pro)
  25. end
  26.  
  27. function Clear()
  28. term.setBackgroundColor(colors.black)
  29. term.clear()
  30. term.setCursorPos(1,1)
  31. end
  32.  
  33. function CenterText(y,text)
  34.     local x = math.floor((w - string.len(text)) /2)
  35.     term.setCursorPos(x,y)
  36.     term.clearLine()
  37.     term.write(text)
  38. end
  39.  
  40. function Bar(Pro)
  41. local MW = w - 2
  42. local Am = ((w-4) / 10)
  43. local Loc = Am * Pro
  44. paintutils.drawFilledBox(2,6,Loc , 6, colors.green)
  45. end
  46.  
  47. local function Agreement()
  48. term.setBackgroundColor(colors.black)
  49. Clear()
  50. print("do you agree to not edit/Harm/Destroy files of this Os, and understand doing so is considering a Crime punishable by appropriate Organizations?")
  51. print("y/n")
  52. local event, key
  53. repeat
  54.     event, key = os.pullEvent("key")
  55. until key == keys.y or key == keys.n
  56. if key == keys.y then
  57.     Setup_1()
  58. else
  59.     os.reboot()
  60. end
  61. end
  62.  
  63. function Setup_1()
  64. Clear()
  65. Title = "Cleaning Files"
  66. Text("settings",1)
  67. settings.load(".settings")
  68. settings.clear()
  69. settings.save(".settings")
  70. Text("Programs",2)
  71. if fs.exists("Protected") then fs.delete("Protected") end
  72. if fs.exists("os/System/Client/Files/.UserFile") then
  73.     fs.makeDir("Protected")
  74.     fs.copy("os/System/Client/Files/.UserFile","Protected/.User")
  75. end
  76. local Items = fs.list("rom/")
  77. for i=1, #Items do
  78.     if Items[i] ~= "Protected" then
  79.         Text(Items[i],i)
  80.         fs.delete(Items[i])
  81.     end
  82. end
  83. if fs.exists("os") then fs.delete("os") end
  84. Text("Complete!",10)
  85. os.sleep(1)
  86. Setup_2()
  87. end
  88.  
  89. function Setup_2()
  90. Clear()
  91. Title = "Creating Dictionaries"
  92. Text("System folders",2)
  93. fs.makeDir("os/External")
  94. fs.makeDir("os/System/Defaults/Images")
  95. fs.makeDir("os/System/Programs")
  96. fs.makeDir("os/System/Scripts")
  97. fs.makeDir("os/System/TempFiles")
  98. fs.makeDir("os/System/Files")
  99. Text("Save Folders",4)
  100. fs.makeDir("os/System/Saved/Shortcuts")
  101. fs.makeDir("os/System/Saved/Images")
  102. fs.makeDir("os/System/Saved/Audio")
  103. Text("Security System",5)
  104. fs.makeDir("os/System/Security/Scripts")
  105. fs.makeDir("os/System/Security/Programs")
  106. fs.makeDir("os/System/Security/Files")
  107. Text("Client Folders",6)
  108. fs.makeDir("os/System/Client/Apps")
  109. fs.makeDir("os/System/Client/Files")
  110. fs.makeDir("os/System/Client/Files/AppStore")
  111. Text("Boot Folders",8)
  112. fs.makeDir("boot/Files")
  113. fs.makeDir("boot/Scripts")
  114. fs.makeDir("boot/Images")
  115. Text("Complete!",10)
  116. os.sleep(1)
  117. Setup_3()
  118. end
  119.  
  120. function Setup_3()
  121. Clear()
  122. Title = "Installing Files"
  123. Text("Paster",2)
  124. shell.run("pastebin","get","7rHH9pXK",Paster)
  125. Clear()
  126. Text("Boot files",4)
  127. for i = 1, #BootItems do
  128.     shell.run(Paster,"get",BootItems[i][2],BootItems[i][1])
  129. end
  130. Text("Os files",6)
  131. for i = 1, #OsPrograms do
  132.     shell.run(Paster,"get",OsPrograms[i][2],OsPrograms[i][1])
  133. end
  134. Text("Images",8)
  135. for i = 1, #Images do
  136.     shell.run(Paster,"get",Images[i][2],Images[i][1])
  137. end
  138. shell.run(Paster,"run","AS3LHb16")--Downloads Icons from Online
  139. Text("Complete!",10)
  140. os.sleep(1)
  141. Setup_4()
  142. end
  143.  
  144. function Setup_4()
  145. Title = "Creating Settings"
  146. Text("Clearing old Settings",1)
  147.  
  148. settings.load(".settings")
  149. settings.clear()
  150. Text("Writing Client System",2)
  151. settings.define("ClientApps_Names")
  152. settings.set("ClientApps_Names",{})
  153. settings.define("ClientApps_Paths")
  154.  
  155. settings.set("ClientApps_Paths",{})
  156. settings.define("ClientVersion")
  157. settings.set("ClientVersion",version)
  158. Text("Setting Network access",3)
  159.  
  160. settings.define("NetworkAccess",{default = false})
  161. settings.set("NetworkAccess",false)
  162. Text("Defining Paths",8)
  163. settings.define("ClientAppInstaller",{default = ClientInstall})
  164. settings.set("ClientAppInstaller",ClientInstall)
  165. settings.define("os_DesktopLoc",{default = "os/System/Programs/Desktop_1"})
  166. settings.set("os_DesktopLoc","os/System/Programs/Desktop_2")
  167. settings.define("ClientAppFolder",{default = "os/System/Client/Apps"})
  168. settings.set("ClientAppFolder","os/System/Client/Apps")
  169. settings.define("os_SecurityHandler",{default = "os/System/Programs/SecurityHandler"})
  170. settings.set("os_SecurityHandler","os/System/Programs/SecurityHandler")
  171.  
  172. settings.define("osPaster",{default = Paster})
  173. settings.set("osPaster",Paster)
  174. settings.define("os_Version")
  175. settings.set("os_Version","CCSPS - Iron")
  176. settings.define("AdminKey")
  177. settings.set("AdminKey","00000")
  178. settings.save(".settings")
  179. Text("Complete!",10)
  180. Setup_5()
  181. end
  182.  
  183. function Setup_5()
  184. Clear()
  185. Title = "Installing Base Apps"
  186. local Tide = 10 / #ClientApps
  187. local Lev = Tide
  188. local Opt = {}
  189. for i = 1, #ClientApps do
  190.     Text(ClientApps[i][1],Lev)
  191.     local T = {ClientApps[i][2],ClientApps[i][3],ClientApps[i][1],true,ClientApps[i][5],ClientApps[i][4]}
  192.     shell.run(ClientInstall,T)
  193.     os.sleep(2)
  194.     Lev = Lev + Tide
  195. end
  196. Text("Complete!",10)
  197. Setup_6()
  198. end
  199.  
  200. function Setup_6()
  201. Title = "writing files"
  202. Text("Backgrounds",2)
  203. local Back = fs.open("os/System/Files/osBackgrounds","w")
  204. local Contents = {{"start","os/System/Saved/Images/CCSPSIron_Start_Background2"},{"Desktop","n"}}
  205. Back.write(textutils.serialize(Contents))
  206. Back.close()
  207. Text("SecurityFiles",3)
  208. local SecFile = fs.open("os/System/Security/Files/ReqFiles","w")
  209. SecFile.write(textutils.serialize(ReqItems))
  210. SecFile.close()
  211. Text("Permissions",5)
  212. local Set = fs.open("os/System/Files/SettingsMenu_Options","w")
  213. local Options = {"NetworkAccess","os_DesktopLoc","AdminKey","ClientAppFolder","reinstall"}
  214. Set.write(textutils.serialize(Options))
  215. Set.close()
  216. Text("startup",8)
  217. shell.run(Paster,"get","SuW7hBYP","startup")
  218. Text("Certificate",9)
  219. local file = fs.open("os/System/Files/os_Certificate","w")
  220. file.writeLine("Accepted on")
  221. file.writeLine(os.date())
  222. file.close()
  223. Text("Complete!",10)
  224. if fs.exists("Protected/.User") then
  225.     Text("User file detected",10)
  226.     fs.copy("Protected/.User","os/System/Client/Files/.UserFile")
  227.     fs.delete("Protected")
  228. end
  229. os.sleep(4)
  230. os.reboot()
  231. end
  232.  
  233. Agreement()
  234.  
Add Comment
Please, Sign In to add comment