kuiperzone / PupNet-Deploy

PupNet Deploy is a cross-platform deployment utility which packages your .NET project as a ready-to-ship installation file in a single step.
GNU Affero General Public License v3.0
183 stars 6 forks source link

AppImage desktop file broken #23

Closed mysteryx93 closed 5 months ago

mysteryx93 commented 1 year ago

When I build AppImage, there's this file

AppDir/usr/share/applications/converter432hz.desktop

It contains

[Desktop Entry]
Type=Application
Name=432Hz Batch Converter
Icon=converter432hz
Comment=Converts and re-encodes music to 432Hz
Exec=usr/bin/Converter432Hz
TryExec=usr/bin/Converter432Hz
NoDisplay=false
X-AppImage-Integrate=true
Terminal=false
Categories=Audio
MimeType=
Keywords=

Exec should be /usr/bin and not usr/bin, thus the desktop file does not work. It doesn't cause problem with the AppImage per se, but once I try deploying in the AUR, it tries to use the .desktop file and fails.

kuiperzone commented 1 year ago

OK. Thank you. Will take a look next week.

kuiperzone commented 1 year ago

Hopefully fixed in 1.6

mysteryx93 commented 8 months ago

Still not working.

Configured like this.

AppBaseName = YangDownloader
AppFriendlyName = Yang Downloader
AppId = yangdownloader

It generates this

Exec=/usr/bin/YangDownloader
TryExec=/usr/bin/YangDownloader

The problem is... that it's Exec=/usr/bin/yangdownloader and not Exec=/usr/bin/YangDownloader!

kuiperzone commented 8 months ago

I'm not sure I follow you. The original issue is fixed.

Exec=/usr/bin/YangDownloader TryExec=/usr/bin/YangDownloader

It is using what you give it in AppBaseName, which is what it's what it's meant to do.

If this doesn't work for you, you can manually edit the Desktop file yourself and point the configuration at using the DesktopFile parameter.

mysteryx93 commented 8 months ago

Oh my AUR script is the one creating /usr/bin/yangdownloader

build() {
    # Adjust .desktop so it will work outside of AppImage container
    sed -i -E "s|Exec=AppRun|Exec=env DESKTOPINTEGRATION=false /usr/bin/${_pkgname} %u|"\
        "squashfs-root/${_pkgname}.desktop"
    # Fix permissions; .AppImage permissions are 700 for all directories
    chmod -R a-x+rX squashfs-root/usr
}

One solution would be to change that to use AppBaseName instead; but EVERYTHING in /usr/bin/ is lowercase. I think a better approach is for the Desktop file to point to the lowercase appid.

And I think it did in the previous script, because the AUR started breaking after converting to PupNet and worked before.

Actually... where else is this Desktop file used? /usr/bin/appname only exists if created by the AUR or something, it doesn't exist when using the AppImage in itself, so why is that for the AppImage to decide on the path where it will be deployed?

And how can I edit the .desktop file? The stand-alone script gave me more flexibility to customizes it; with this latest tool, I don't know where the build folder is nor how details like that can be customized.

mysteryx93 commented 8 months ago

I just fixed another problem of lacking icon after AUR installation.

If I look into the generated AppImage package, it contains yangdownloader.svg, yangdownloader.desktop, the only place where YangDownloader is used is within squashfs-root/usr/bin/YangDownloader

but once installed it's all in lowercase.

Would just need to fix the Desktop file and it looks like everything would be good.

mysteryx93 commented 8 months ago

For now found a work-around, sed to replace it manually when building the package

prepare() {
    chmod +x "${_appimage}"
    ./"${_appimage}" --appimage-extract
    sed -i "s/\/${AppName}/\/${appid}/g" "${srcdir}/squashfs-root/${appid}.desktop"
}
kuiperzone commented 8 months ago

Thank you. I'll take a look next time I create a new release.