Skip to content
This repository has been archived by the owner on Mar 26, 2022. It is now read-only.

AppImage support #30

Open
probonopd opened this issue Apr 18, 2018 · 9 comments
Open

AppImage support #30

probonopd opened this issue Apr 18, 2018 · 9 comments
Assignees

Comments

@probonopd
Copy link

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

@torch2424 torch2424 self-assigned this Apr 18, 2018
@torch2424
Copy link
Owner

torch2424 commented Apr 18, 2018

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 😄

@probonopd
Copy link
Author

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" ;-)

@torch2424
Copy link
Owner

@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 :)

@probonopd
Copy link
Author

Is it the same steam_appid.txt for every user?

@torch2424
Copy link
Owner

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.

@probonopd
Copy link
Author

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.

@torch2424
Copy link
Owner

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 :)

@probonopd
Copy link
Author

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/

@torch2424
Copy link
Owner

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 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants