135 posts
Posted 26 October 2013 - 04:20 PM
Heres my api code:
function Install()
shell.run("rom/apis/win/install")
end
Heres what i put to start it
WCE.Install()
And heres the error i get:
WCE:2: attempt to index ? (a nil value)
Please help!
8543 posts
Posted 26 October 2013 - 04:25 PM
Not a bug. Moved to Ask a Pro.
APIs do not have access to the shell "API", as they aren't programs. Try using os.run instead.
758 posts
Location
Budapest, Hungary
Posted 26 October 2013 - 05:15 PM
Or pass the shell API:
-- the API
function Install(shell)
shell.run("rom/apis/win/install")
end
-- the program
WCE.Install(shell)
135 posts
Posted 28 October 2013 - 04:25 PM
ok i will try that thanks also i have another problem
function del(file)
if fs.isDir("RecycleBin") then
else
fs.makeDir("RecycleBin")
end
if fs.exists(file) then
fs.copy(file,"RecycleBin/"..file)
fs.delete(file)
else
error("No Such File")
end
end
Its says Copy Failed
whats the problem with this code?
758 posts
Location
Budapest, Hungary
Posted 28 October 2013 - 04:35 PM
That's because the second argument given to fs.copy is the destination folder, not the full path of the new file. By the way, use fs.move. It's the same as copying and deleting something.