3 posts
Posted 05 January 2016 - 09:21 AM
i have a program but i idk how to create a auto install this is the code i did
shell.run("copy","disk/clean")
what should install the program clean but it dosen't i also tryed these 2
shell.run("cp","disk/info","info")
also tryed
shell.run(fs.copy","(disk/info","startup)")
none work please tell me how to create one
8543 posts
Posted 05 January 2016 - 03:28 PM
Moved to Ask a Pro.
1852 posts
Location
Sweden
Posted 05 January 2016 - 04:14 PM
You're using fs.copy in shell.run, which will error.
What you want to do is to use fs.copy like this
fs.copy( "<the file you want to copy>", "<the path you want to copy to>" )
So if you're trying to copy the file "info" from the disk to the computer you'd want to do this
fs.copy( "disk/info", "info" )
23 posts
Posted 08 January 2016 - 12:24 AM
Here is my installer (Change the first three lines):
Spoiler
local diskID = 1 --output of disk.getID()
local source = "tstartup"
local destination = "/startup"
local drivePath
local driveSide
fs.delete(destination)
for _, side in ipairs(rs.getSides()) do
if peripheral.isPresent(side) and peripheral.getType(side) == "drive" and disk.getID(side) then
driveSide = side
drivePath = "/"..disk.getMountPath(driveSide)
break
end
end
fs.copy(drivePath.."/"..source, destination)
print("Installation finished")
sleep(1)
disk.eject(driveSide)
os.reboot()
Edited on 07 January 2016 - 11:26 PM