[mojosetup] set the working path for the desktop entry

Nemo Der nemoder at gmail.com
Thu Oct 13 16:18:54 EDT 2011


On Thu, Oct 13, 2011 at 6:45 AM, Kristen Eisenberg <
kristen.eisenberg at yahoo.com> wrote:

> Hello,
>
> When clicking on the icon in the application menu, it uses a default
> working
> path. For my program, I need a specific working path.
> There's "Path" variable in .desktop to setup the working path, it works
> fine
> if i manually put the path but i find no way to specify the path in the
> config.lua.
> Is it possible to add Path in the Setup.DesktopMenuItem?
> I tried to append the Path in the postinstall function but it doesn't work,
> i think the postinstall is called before the creation of the .desktop and
> anyway, it'll require to execute the update of the menu after.
>
> Have you another idea to do that?
>

I worked around this with a bit of a hack:

local function postinst()
    io.output(MojoSetup.destination .. "/gamestart.sh")
    io.write("cd " .. MojoSetup.destination .. "/game/\n")
    io.write("./gamebinary \"$@\"\n")
    os.execute("chmod u+x " .. MojoSetup.destination .. "/gamestart.sh")
end

then for DesktopMenuItem i set:
commandline = "%0/gamestart.sh",
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/mojosetup/attachments/20111013/8930fb3e/attachment.htm>


More information about the mojosetup mailing list