picoDeploy icon indicating copy to clipboard operation
picoDeploy copied to clipboard

AppImage support

Open probonopd opened this issue 7 years ago • 9 comments

Can picoDeploy produce AppImage files for Linux? electron-builder has native support built in.

probonopd avatar Apr 18 '18 05:04 probonopd

Hello!

Yes I played around with this for a while, but one thing picoDeploy does for greenworks (steam support), is copy the steam ID in a text file, to the correct location for steam to know that the game is currently being played.

AppImage has write protection for this, so it cannot be done, thus I left it out of the project.

However, I think adding AppImage suppport is as simple as adding another field to the package.json if I remember correctly, should be somewhere in the electron-builder docs.

Let me know if you would like me to find it for you / give you some steps if you need any help 😄

torch2424 avatar Apr 18 '18 07:04 torch2424

Where does the ID need to be copied? While the contents of the AppImage are not writeable at runtime, the software inside the AppImage can write e.g., to $HOME without restrictions. I think it would be nice if picoDeploy could produce AppImages "out of the box" ;-)

probonopd avatar Apr 18 '18 16:04 probonopd

@probonopd Yeah that is the thing, it needs to be written into the contents of the AppImage sadly.

See here: https://github.com/greenheartgames/greenworks/blob/master/docs/build-instructions-electron.md you can CTRL+F for steam_appid.txt

Since implementing greenworks is already confusing/hard enough I left out App Image.

However, I'd be open to adding support for AppImage, and we can add a blurb about how it won't work for Greenworks? If you would be so kind, you can totally open up a PR for this :)

torch2424 avatar Apr 18 '18 17:04 torch2424

Is it the same steam_appid.txt for every user?

probonopd avatar Apr 18 '18 17:04 probonopd

It is not, it is something that is added by the user. But the thing is, it has to be copied next to the binary run by steam. So for example, on osx, it would be inside the .app itself in a specific directory electron-builder does not have an option for building files to.

torch2424 avatar Apr 18 '18 18:04 torch2424

You could try to place a symlink there inside the AppImage that would point to some location inside $HOME. If worst comes to worst, I think this could be worked around by a tiny LD_PRELOAD library.

probonopd avatar Apr 19 '18 05:04 probonopd

Ohhh that's not a bad Idea, though, are you sure you could do symlinks inside an appImage? We'd also need to know the context of the code being run in App Images.

And if you don't mind enlightening mean, what is a LD_PRELOAD library? I googled it, but I am not 100% sure of the implications :)

torch2424 avatar Apr 19 '18 05:04 torch2424

are you sure you could do symlinks inside an appImage

Yes.

We'd also need to know the context of the code being run in App Images.

An AppImage is just a self-mounting filesystem that executes the AppRun file or symlink contained therein. There is really not much difference to a process outside of the AppImage. You can inspect the process context as usual at /dev/proc/....

what is a LD_PRELOAD library

It is a library that can override native OS functions. For example, you could write (pseudo-code):

if(applications_wants(fopen('/foo/bar')){
  fopen('/foo/baz');
}

More info: https://rafalcieslak.wordpress.com/2013/04/02/dynamic-linker-tricks-using-ld_preload-to-cheat-inject-features-and-investigate-programs/

probonopd avatar Apr 19 '18 06:04 probonopd

Dude, so I just clicked your Github Profile, I didn't know you were part of the AppImage org haha! :')

Cool, I'll just go ahead and add App image support, and update the "Integrating Greenworks" Docs when I get the time, about symlinking the steam app id text file 😄

torch2424 avatar Apr 19 '18 17:04 torch2424