FreeCAD / FreeCAD-Bundle

Stand-alone repo to Build and Deploy installable FreeCAD images. Do not open general FreeCAD issues here.
https://freecad.org
GNU Lesser General Public License v2.1
312 stars 63 forks source link

Packaging: Fix the launcher icon of the stable version of the Freecad for AppImages #183

Closed leoheck closed 1 year ago

leoheck commented 1 year ago

As described here, https://github.com/FreeCAD/FreeCAD-Bundle/issues/182

luzpaz commented 1 year ago

@adrianinsaval haven't tested this. Can you take a look ?

adrianinsaval commented 1 year ago

Shouldn't this be changed in the main repo instead? I don't think we should be creating a separate desktop file and icons only to be used here.

yorikvanhavre commented 1 year ago

Main repo uses the correct icon already... This would be specific to the appimage, no?

leoheck commented 1 year ago

@yorikvanhavre yes

luzpaz commented 1 year ago

Just a clarification, we've already tweeked the fc logo for conda builds (outside the FC core repo) in https://github.com/FreeCAD/FreeCAD-Bundle/issues/99 right ?

leoheck commented 1 year ago

I am not sure if I understood the question. Are you talking about the image of the weekly build?

This issue is about the missing the launcher image of the stable version.

leoheck commented 1 year ago

Shouldn't this be changed in the main repo instead? I don't think we should be creating a separate desktop file and icons only to be used here.

@adrianinsaval this isn't the main repo?

I thought this was the main repo.

adrianinsaval commented 1 year ago

No this repo is just for packaging. The actual source code is at github.com/FreCAD/FreeCAD

leoheck commented 1 year ago

But this fix is in the Packaging.

adrianinsaval commented 1 year ago

But I think it's overwriting stuff that comes from the source, freecad normally installs a desktop file and icons, and you are copying over a different desktop file and the same icon on top of those. IMO it would be best to check if we can just make the normal install already use the correct desktop file and icons. I need to look at this better

leoheck commented 1 year ago

I am just adjusting something that is needed for the AppImage launcher to work properly. These settings were missing for the AppImage of the stable version. If there is an icon, I can set the right path and then make a PR in the source code, but I could not find this icon. I understand that this is an issue with the packaging. Do you know the icon path so I can check if there is this icon to just reuse it instead?

luzpaz commented 1 year ago

Since @yorikvanhavre has proposed https://github.com/FreeCAD/FreeCAD/pull/9876 to add AppImage script to FreeCAD core and it is accepted - then we should make the icon changes reflect there. To re-iterate, FreeCAD-Bundle repo (https://github.com/FreeCAD/FreeCAD-Bundle/ we are discussing this issue in) is a packaging repo.

As for the icon changes by the AppImage, I think it makes sense to distinguish FreeCAD AppImage (from say the Snap or Flatpak) through the icon. We already do it for the nightly AppImage thanks to @leoheck in #97 and #98.

leoheck commented 1 year ago

As a user I actually I don't care of from where Freecad comes. But I really want to distinguish the weekly build from the stable version. Because otherwise I will never know which one is which. Gnome launcher doesn't have too much space for text. If it is Freecad or Freecad Weekly, it may show just a substring of it that may not b enough to differentiate both. So having different icons would help. I updated the icon for the weekly build... I didn't want to fight this useless conda symbol thing. And this was ok for me since weekly has at least an icon now after so many years.

Now, the question is, when will we have the same working launcher icon for the stable version, because for instance, now it is just using a generic unknown icon.

Again, I believe this is an easy fix for this repo here since it is repacking it. If it is good for you guys, I can also replicate the useless conda symbol on both stable and weekly build, and then add an extra symbol to the weekly build to make it a bit different, so it is easy to understand which one is which.

I just want to have meaningful and working icons on Freecad AppImages otherwise it will always look that my system is broken. And I, and other users, deserve a good looking interface.

leoheck commented 1 year ago

I use the Weekly version mostly, but when it is broken, I have a bkp that is the stable version (that I can download, eventually) since we don't have a way to download the last working weekly.

yorikvanhavre commented 1 year ago

I'm in favour of merging this too. PR https://github.com/FreeCAD/FreeCAD/pull/9876 is likely going to change, probably will become more a "recipe" than an actual script, so this one will remain the main system to produce appimages. So it makes sense to differentiate weekly images than release ones.

About the duplication of data from the main repo, we're mainly talking about the logo here, and it's anyway already duplicated a thousand times in different places... I wouldn't worry too much about it at this point

leoheck commented 1 year ago

@chennes is there a way to donwload the build bundle of appimage above so I can check If my changes worked?

adrianinsaval commented 1 year ago

This PR still doesn't make sense to me, the icons where already bundled, and a desktop file too. What was wrong with them? This is overwriting the icon from the package and adding an additional desktop file.

leoheck commented 1 year ago

This PR is for fixing the AppImage of the sable version that was not working fine. The png icon can be reused of course, if It is somewhere (I could not find it). Also, It has to have the right size which ia 64x04 the one for the weekly build was 60x60, for instance. I could not check the size since I could not find the image. Since the icon image was missing I added one.

adrianinsaval commented 1 year ago

I'm looking into this, the icon is not required since it's already in the package. The desktop file would be somewhat needed as the Exec line is different from the one coming from the package. It might be better to patch the file from the package here so that we inherit any other changes on the original desktop file, for example recently several mime types where added that are not present in the desktop file here. I will work on this tomorrow

leoheck commented 1 year ago

Thanks, guys, for the first time I could use a Freecad that has a working icon. Both of them (stable and weekly) are working. image

leoheck commented 1 year ago

Oooops, there is something wrong, still.

There is this (5) in the launcher name. And it is launching the wrong AppImage image

leoheck commented 1 year ago

Hm, I haven't realized a new version was released or it is about to be released. That makes sense.

leoheck commented 1 year ago

Ah, but the name of the launcher should be improved. From this image To maybe.. Freecad or Freecad 0.21

chennes commented 1 year ago

I don't know anything about how the appimage launcher name is set up -- do you know where the (5) is coming from?

adrianinsaval commented 1 year ago

my guess would be that you have multiple appimages and your system is adding the numbers. The desktop file has FreeCAD as name

leoheck commented 1 year ago

My computer was doing something nasty. I had 2 .desktop for the same file. But not 5. After restarting the computer it started to show Freecad (1) instead of Freecad (5) Then I saw my AppImages were weird. Reinstalling them, fixed this thing for me. image

@adrianinsaval your guess was right. Sorry to botter you guys.

leoheck commented 1 year ago

Damm, today the icons are like this. I have no clue how this works too, haha image

leoheck commented 1 year ago

I think there is an issue in the latest versions of both stable and weekly that does not allow me to update with appimageupdatetool-x86_64.AppImage since the downloaded files are not functional. But I have to investigate further. And this may be causing the issue the name of the launchers too.

adrianinsaval commented 1 year ago

I had no issue updating the 0.20.2 appimage to 0.21.0 stable but note that using appimagetool normally means both the old and the new appimage will be in the directory, which could cause problem for your automatic appimage integration tool. Or at the very least the new appimage will have a different name, which will be problematic for the auto integration too (this is why I got rid of the automated thing and did it manually on my system). A restart or log out and log back in is likely necessary for these things to show up properly in your app menu after an update/install

adrianinsaval commented 1 year ago

@leoheck can you check how this: https://github.com/adrianinsaval/FreeCAD-Bundle/releases/download/0.21.0/FreeCAD_0.21.0-2023-08-03-conda-Linux-x86_64-py310.AppImage and this: https://github.com/adrianinsaval/FreeCAD-Bundle/releases/download/weekly-builds/FreeCAD_weekly-builds-33679-2023-08-03-conda-Linux-x86_64-py310.AppImage look in your system? Please log out and back in or restart your computer after installing the appimages so that residual stuff from previous installs don't cause bugs in how they are displayed.

I'm trying a cleaner method of doing what you did here. See https://github.com/adrianinsaval/FreeCAD-Bundle/commit/8b7b97da67d62dd37eb6d1c961b7bb5e5ac9e806

I think one problem with this PR is that there are multiple desktop files and icons in the root directory of the appimage which can be confusing for teh software as it is supposed to have only one.

leoheck commented 1 year ago

For some reason, I had these 3 things.

FreeCAD_0.21.0-2023-08-02-conda-Linux-aarch64-py310.AppImage
FreeCAD_0.21.0-2023-08-02-conda-Linux-x86_64-py310_11515bae47b30ca86ec764ca3f3781b7.AppImage
FreeCAD_weekly-builds-33674-2023-08-02-conda-Linux-aarch64-py310.AppImage

Something inside the AppImage is telling the appimageupdatetool-x86_64.AppImage to do something different than usual. I use to use this script a bunch of times a day. Yes, I am a bit crazy but I configured this command to run with the normal package manager updates. I never have problems with this command.

The way I use this tool is this this

appimageupdatetool-x86_64.AppImage \
    --remove-old target.AppImage

With the weekly builds, it would be like this:

appimageupdatetool-x86_64.AppImage \
    --remove-old FreeCAD_weekly-builds-33674-2023-08-02-conda-Linux-aarch64-py310.AppImage

So, in the end, I will have just a single AppImage for the weekly and another one for the stable version. The detail is that the stable version has never been updated after I started to update this way. So the latest issues may have been caused by this latest upgrade of the stable version.

================================

@adrianinsaval I am reporting this without login out, which I will address in the next comment. I am checking your Appimages. I started by removing mine.. then after a while, the .desktop files are removed automatically. With that being said, the results here will be related to your AppImages only.

After installing both of your Appimages I am seeing this. The weekly has a slightly different logo than the one that is currently being used in this repo. The second one is the normal stable version, and for some reason, it is showing this (1) in its name. So maybe both .desktop files have some variables/strings that are equal which makes this (1) appear. image

As you can see, I just have 2 FreeCAD*.desktop files in the .local/share/applications. And both were updated right now, after installing the AppImages you shared.

Here is the comparison of the important part inside of these .desktop files image

leoheck commented 1 year ago

After login out, the icons are still the same. Login out and back in does not change this for me. image

What I reported this morning, was due to the fact that I ran the appimageupdatetool before turning it off yesterday.

leoheck commented 1 year ago

Here I will revert my Appimages, these two

./FreeCAD_0.21.0-2023-08-02-conda-Linux-aarch64-py310.AppImage
./FreeCAD_weekly-builds-33674-2023-08-02-conda-Linux-aarch64-py310.AppImage

Then I will install them... oh, I realized that I downloaded them for the wrong architecture, yesterday. Downloading them again.

FreeCAD_0.21.0-2023-08-02-conda-Linux-x86_64-py310_11515bae47b30ca86ec764ca3f3781b7.AppImage
FreeCAD_weekly-builds-33679-2023-08-02-conda-Linux-x86_64-py310_db61078fc021bc04fb14fc2607d18e65.AppImage

Now, the latest weekly is not right anymore. :/

They both have the same image and name. image

➜ find -name "*FreeCAD*"
./appimagekit_4fc84f7fad358ff1001bffed487da239-FreeCAD.desktop
./appimagekit_31bac628f393411efb193d41d2e47af7-FreeCAD.desktop

➜ ls -lrt ./appimagekit_4fc84f7fad358ff1001bffed487da239-FreeCAD.desktop ./appimagekit_31bac628f393411efb193d41d2e47af7-FreeCAD.desktop
-rwxrwxr-x 1 lheck lheck 2114 Aug  2 23:42 ./appimagekit_31bac628f393411efb193d41d2e47af7-FreeCAD.desktop
-rwxrwxr-x 1 lheck lheck 2170 Aug  2 23:43 ./appimagekit_4fc84f7fad358ff1001bffed487da239-FreeCAD.desktop

image

adrianinsaval commented 1 year ago

I think the way you are running the updates combined with the automatic integration is messing things up. Why is there a (1) in the name of the appimage? The (1) looks like it's being added by your system probably as a way to differentiate from a previously existing appimage. If you check the desktop file that is bundled with the appimge there is no (1) in it.

Can you try this:

leoheck commented 1 year ago

This is the output when I use my script to update the AppImages using the appimageupdatetool.

Updating AppImages...

> Updating FreeCAD_0.21.0-2023-08-02-conda-Linux-x86_64-py310_11515bae47b30ca86ec764ca3f3781b7.AppImage
Checking for updates...
Fetching latest release information from GitHub API
Fetching latest release information from GitHub API
zsync2: Using CA bundle found on system: /etc/ssl/certs/ca-certificates.crt
... done!
Update not required, exiting.

> Updating FreeCAD_weekly-builds-33679-2023-08-02-conda-Linux-x86_64-py310_db61078fc021bc04fb14fc2607d18e65.AppImage
Checking for updates...
Fetching release information for tag "weekly-builds" from GitHub API.
Fetching release information for tag "weekly-builds" from GitHub API.
zsync2: Using CA bundle found on system: /etc/ssl/certs/ca-certificates.crt
... done!
Update not required, exiting.

Since I am using the latest versions... nothing was updated and then nothing weird happened.