Add files via upload

This commit is contained in:
minecartchris
2024-06-25 17:26:07 -05:00
committed by GitHub
parent 3bc18a9fc6
commit d4b94402ed
3 changed files with 55 additions and 0 deletions

29
install.lua.lua Normal file
View File

@@ -0,0 +1,29 @@
--Print API Installer
local diskDir = shell.getRunningProgram():sub(1, -12)
if not PhileOS then
error("Only for PhileOS Computers")
end
fs.copy(diskDir.."Print.lua", "PhileOS/SysPrograms/Print.lua")
fs.copy(diskDir.."icon.phimg", "PhileOS/Icons/Programs/PhileOS/SysPrograms/Print.lua.phimg")
local user = PhileOS.getUsername()
local file = 0
if user == "" then
file = fs.open("/PhileOS/Settings/desktop.set", "r")
else
file = fs.open("/PhileOS/Users/"..user.."/desktop.set", "r")
end
local pins = textutils.unserialise(file.readAll())
file.close()
local name = "Print"
table.insert(pins[1], {name, "PhileOS/SysPrograms/Print.lua"})
local file = 0
if user == "" then
file = fs.open("/PhileOS/Settings/desktop.set", "w")
else
file = fs.open("/PhileOS/Users/"..user.."/desktop.set", "w")
end
file.write(textutils.serialise(pins))
file.close()