-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds support for .AppImage and implements parsing for .desktop #10
base: main
Are you sure you want to change the base?
Conversation
Thanks @xaoseric. |
Ideally the Exec= which we parse in .desktop files would point to the correct executable. Looking for Name= and X-AppImage-Version= in .desktop could be a good option if it has a "-" in it, the goal was to get it working with Discord.AppImage for the moment so we can go back and add to it later. The best solution would be a multi platform app store that could download .AppImage, .app and .AppDir files automatically and keep them updated in /Applications, /System and /Library. One small bug I did find is that if we do launch PyCharm CE it says that it can't find PyCharm. We need to do launch "PyCharm CE" for it to find that .app directory. |
This is not how AppImage works. What do you mean by "the correct executable"? The "correct executable" is the AppImage itself.
Why do you want to do that? This key has no useful information for how the AppImage should be launched. Only the path to the AppImage is needed for that. |
I think this is not what we should be checking for. Instead, we should be checking whether Example:
should check if we have But to check this, we would need to have a way to peek inside the AppImage to read the desktiop file, wouldn't we? |
Exec= points to the executble which allows none .app, .AppDir and .AppImage files to work ex: for Firefox it points to /usr/local/bin/firefox and it was what was in the todo notes before since we already check for the .AppImage extension before checking if a .desktop is a candidate.
Yes, we should also check that Name= also matches if the .desktop matches which at this point in parsing .desktop files, we are just parsing those directly so no need to look inside of any file. As far as looking inside the AppImage, we could use libappimage to do that or we implement our own way of doing that which I think would probably be further down the line once we get the core functionality of it working we can go back and add in additional features like that. https://docs.appimage.org/api/libappimage/ As it is on Linux, as long as it is executable, we don’t have to do anything on our end unless we want to check the .desktop file in the .AppImage. For FreeBSD however, that is another matter: |
I think you don't understand how AppImages work. To launch an AppImage, you need to use the path to the AppImage, whereas the So, to launch an AppImage from the outside world, all you need to know is the path to the AppImage. My objective is to do away with
So thinking about it again maybe we could do something much simpler which would cover at least >80% of cases:
Result:
But it would fail on
But it would fail on
|
A .AppImage is an executable on Linux. Quoting the faq from the docs. https://docs.appimage.org/user-guide/faq.html#question-how-do-i-run-an-appimage
So what we would need to do is check if we are running on BSD or Linux, if it is running on a BSD based system we can than implement any compatibility that needs to be done to make it work. According the AppImage spec repo, there is an https://github.com/AppImage/AppImageSpec/blob/master/draft.md#type-2-image-format
Yes, that is a good idea, that can be a feature enhancement further on down the line now that we know we have something that is working. |
Opened an issue referencing the improvements for the AppImage handling so we can get this merged in and discuss how we want to improve it in that issue. |
Yes, that is being discussed at AppImage/AppImageKit#98. Let's make this issue here only about finding and launching the correct AppImage.
Do you think you can make it part of this PR? |
Yes, certainly will try. |
Detects new version if more than one file exists
@probonopd the PR now supports the changes as requested. |
Thank you very much. Looks promising.
Then ran:
Possibly it doesn't know what to do when some candidates have a version and some don't. In those situations, it should use the one with the highest version number, in this example |
Awesome, so it is getting closer to being on the right track then, once we get it working, the same concept should work for .app and .AppDir files. You could probably merge the stuff into a develop branch so that way the changes don't affect the stable main branch, and once there is enough changes to warrant a new release, we can merge into the master. Next thing we probably will want to do is create some type of database for keeping track of the available apps so doing say "launch --scan" would scan the system for available apps and add them to a database. |
Why does it not find them? |
@probonopd reverted back to old if statement, should be fixed now. |
Hello @xaoseric, it now identifies the candidates correctly but segfaults while trying to decide which one to use:
Note that in my case
The expected behavior would be that it recognizes that 3.0 is the highest version number among the three candidates and hence selects that candidate. |
Odd, it correctly identifies the new version on my linux setup, could it be a difference between BSD and Linux in the way that Qt handles things? |
Possible. Any way you could download a helloSystem ISO and test it there? |
I'll be setting up a test system with helloSystem this weekend. |
Hello @xaoseric how did your tests go? |
Adds support for .AppImage files and parses .desktop files with QSettings