Here is the code:
function run(path) --path must be a dir
if fs.isDir(path) then
if fs.exists(path.."/info.ini") then
hRead = fs.open(path.."/info.ini", "r")
if hRead.readLine() == "icon = {" then
icon = {}
for i = 1, 4, 1 do
local a = hRead.readLine()
table.insert(icon, a)
end
local b = hRead.readLine()
if string.sub(b, 1, 7) == "name = " then
name = string.sub(b, 8)
else
name = fs.getName(path)
end
local c = hRead.readLine()
if string.sub(c, 1, 9) == "author = " then
author = string.sub(c, 10)
else
author = "Please write an author in info.ini"
end
end
hRead.close()
end
gui.splash(icon, name, author)
shell.run(path.."/"..fs.getName(path)) --Here is the error
end
end
I still getting the error even if I write shell.run("ProgramFiles/TestProgram/TestProgram"). If I run manually the program in CraftOS it works well, so the program works itselft, but I can't run it with shell.run().
I call the function with file.run("ProgramFiles/TestProgram") and in TestProgram folder there are 2 files: "TestProgram" and "info.ini". The 2 files works well themselves.
What is the problem?
Sorry for my bad english