Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local version = "1.3.0"
- local BootItems = {{"boot/Scripts/Base","rbK07i0v"},{"boot/Scripts/Scan","sf5duqYm"}}
- local ReqItems = {"os/System/Programs/Desktop_1","os/System/Programs/OsManager","os/System/Scripts/PowerOff","os/System/Programs/SecurityHandler","os/System/Programs/InstallManager","startup"}
- 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"}}
- 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"}}
- local ClientInstall = "os/System/Programs/InstallHandler"
- local ScriptsLoc = "os/System/Scripts"
- local Images = {}
- local Paster = "os/System/Scripts/SilentPaster"
- local w, h = term.getSize()
- local Title
- function Text(Sub,Pro)
- os.sleep(1)
- Clear()
- CenterText(4,Title)
- CenterText(5,Sub)
- Bar(Pro)
- end
- function Clear()
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1,1)
- end
- function CenterText(y,text)
- local x = math.floor((w - string.len(text)) /2)
- term.setCursorPos(x,y)
- term.clearLine()
- term.write(text)
- end
- function Bar(Pro)
- local MW = w - 2
- local Am = ((w-4) / 10)
- local Loc = Am * Pro
- paintutils.drawFilledBox(2,6,Loc , 6, colors.green)
- end
- local function Agreement()
- term.setBackgroundColor(colors.black)
- Clear()
- 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?")
- print("y/n")
- local event, key
- repeat
- event, key = os.pullEvent("key")
- until key == keys.y or key == keys.n
- if key == keys.y then
- Setup_1()
- else
- os.reboot()
- end
- end
- function Setup_1()
- Clear()
- Title = "Cleaning Files"
- Text("settings",1)
- settings.load(".settings")
- settings.clear()
- settings.save(".settings")
- Text("Programs",2)
- if fs.exists("Protected") then fs.delete("Protected") end
- if fs.exists("os/System/Client/Files/.UserFile") then
- fs.makeDir("Protected")
- fs.copy("os/System/Client/Files/.UserFile","Protected/.User")
- end
- local Items = fs.list("rom/")
- for i=1, #Items do
- if Items[i] ~= "Protected" then
- Text(Items[i],i)
- fs.delete(Items[i])
- end
- end
- if fs.exists("os") then fs.delete("os") end
- Text("Complete!",10)
- os.sleep(1)
- Setup_2()
- end
- function Setup_2()
- Clear()
- Title = "Creating Dictionaries"
- Text("System folders",2)
- fs.makeDir("os/External")
- fs.makeDir("os/System/Defaults/Images")
- fs.makeDir("os/System/Programs")
- fs.makeDir("os/System/Scripts")
- fs.makeDir("os/System/TempFiles")
- fs.makeDir("os/System/Files")
- Text("Save Folders",4)
- fs.makeDir("os/System/Saved/Shortcuts")
- fs.makeDir("os/System/Saved/Images")
- fs.makeDir("os/System/Saved/Audio")
- Text("Security System",5)
- fs.makeDir("os/System/Security/Scripts")
- fs.makeDir("os/System/Security/Programs")
- fs.makeDir("os/System/Security/Files")
- Text("Client Folders",6)
- fs.makeDir("os/System/Client/Apps")
- fs.makeDir("os/System/Client/Files")
- fs.makeDir("os/System/Client/Files/AppStore")
- Text("Boot Folders",8)
- fs.makeDir("boot/Files")
- fs.makeDir("boot/Scripts")
- fs.makeDir("boot/Images")
- Text("Complete!",10)
- os.sleep(1)
- Setup_3()
- end
- function Setup_3()
- Clear()
- Title = "Installing Files"
- Text("Paster",2)
- shell.run("pastebin","get","7rHH9pXK",Paster)
- Clear()
- Text("Boot files",4)
- for i = 1, #BootItems do
- shell.run(Paster,"get",BootItems[i][2],BootItems[i][1])
- end
- Text("Os files",6)
- for i = 1, #OsPrograms do
- shell.run(Paster,"get",OsPrograms[i][2],OsPrograms[i][1])
- end
- Text("Images",8)
- for i = 1, #Images do
- shell.run(Paster,"get",Images[i][2],Images[i][1])
- end
- shell.run(Paster,"run","AS3LHb16")--Downloads Icons from Online
- Text("Complete!",10)
- os.sleep(1)
- Setup_4()
- end
- function Setup_4()
- Title = "Creating Settings"
- Text("Clearing old Settings",1)
- settings.load(".settings")
- settings.clear()
- Text("Writing Client System",2)
- settings.define("ClientApps_Names")
- settings.set("ClientApps_Names",{})
- settings.define("ClientApps_Paths")
- settings.set("ClientApps_Paths",{})
- settings.define("ClientVersion")
- settings.set("ClientVersion",version)
- Text("Setting Network access",3)
- settings.define("NetworkAccess",{default = false})
- settings.set("NetworkAccess",false)
- Text("Defining Paths",8)
- settings.define("ClientAppInstaller",{default = ClientInstall})
- settings.set("ClientAppInstaller",ClientInstall)
- settings.define("os_DesktopLoc",{default = "os/System/Programs/Desktop_1"})
- settings.set("os_DesktopLoc","os/System/Programs/Desktop_2")
- settings.define("ClientAppFolder",{default = "os/System/Client/Apps"})
- settings.set("ClientAppFolder","os/System/Client/Apps")
- settings.define("os_SecurityHandler",{default = "os/System/Programs/SecurityHandler"})
- settings.set("os_SecurityHandler","os/System/Programs/SecurityHandler")
- settings.define("osPaster",{default = Paster})
- settings.set("osPaster",Paster)
- settings.define("os_Version")
- settings.set("os_Version","CCSPS - Iron")
- settings.define("AdminKey")
- settings.set("AdminKey","00000")
- settings.save(".settings")
- Text("Complete!",10)
- Setup_5()
- end
- function Setup_5()
- Clear()
- Title = "Installing Base Apps"
- local Tide = 10 / #ClientApps
- local Lev = Tide
- local Opt = {}
- for i = 1, #ClientApps do
- Text(ClientApps[i][1],Lev)
- local T = {ClientApps[i][2],ClientApps[i][3],ClientApps[i][1],true,ClientApps[i][5],ClientApps[i][4]}
- shell.run(ClientInstall,T)
- os.sleep(2)
- Lev = Lev + Tide
- end
- Text("Complete!",10)
- Setup_6()
- end
- function Setup_6()
- Title = "writing files"
- Text("Backgrounds",2)
- local Back = fs.open("os/System/Files/osBackgrounds","w")
- local Contents = {{"start","os/System/Saved/Images/CCSPSIron_Start_Background2"},{"Desktop","n"}}
- Back.write(textutils.serialize(Contents))
- Back.close()
- Text("SecurityFiles",3)
- local SecFile = fs.open("os/System/Security/Files/ReqFiles","w")
- SecFile.write(textutils.serialize(ReqItems))
- SecFile.close()
- Text("Permissions",5)
- local Set = fs.open("os/System/Files/SettingsMenu_Options","w")
- local Options = {"NetworkAccess","os_DesktopLoc","AdminKey","ClientAppFolder","reinstall"}
- Set.write(textutils.serialize(Options))
- Set.close()
- Text("startup",8)
- shell.run(Paster,"get","SuW7hBYP","startup")
- Text("Certificate",9)
- local file = fs.open("os/System/Files/os_Certificate","w")
- file.writeLine("Accepted on")
- file.writeLine(os.date())
- file.close()
- Text("Complete!",10)
- if fs.exists("Protected/.User") then
- Text("User file detected",10)
- fs.copy("Protected/.User","os/System/Client/Files/.UserFile")
- fs.delete("Protected")
- end
- os.sleep(4)
- os.reboot()
- end
- Agreement()
Add Comment
Please, Sign In to add comment