1

often run into this issue with documentation where the documentation is trying to be as exhaustive as possible and as such make the simplest use case impossible to unearth.

https://docs.appimage.org/packaging-guide/manual.html#creating-an-appdir-manually

this documentation seems ok enough but I'm pretty sure I don't need 99% of what they claim.

I'm in the use case where I built something from unity. I have a folder that contains my main binary and then ton and tons and tons of other junk.

when you click on the binary it runs perfectly it has an icon and all.

How do I just put that entire folder into an .appimage file including instructions on what's the right binary to run?

seems like all I need to do is create a folder named MyUnityGame.AppDir and inside have my whole folder I mentioned plus a .desktop file that points to the binary and that's it right?

all the rest sounds like it would apply to something that's not self contained / that has dependencies, which isn't my case.

what's next once I have my .desktop?

(and most error-proof) to use a precompiled one from this repository.

where's the precompiled AppRun file?

EDIT : I guess it's this one : https://github.com/AppImage/AppImageKit/blob/master/resources/AppRun

can I just have it as :

#!/bin/sh
exec myunitygame.desktop "$@"

seems like the rest is superfluous in my case

tatsu
  • 3,107
  • Do not go to the above link. As of 7-May-2023, it attempts to download malware. I am unable to get past the scam page(s) and to the underlying "real page." – LiamF May 07 '23 at 07:18
  • @LiamF jsut click on the flag icon and report it for malware url – tatsu May 31 '23 at 16:40

1 Answers1

3

I don't understand what exactly you are looking for. Here is bash script which I have created to make Appimage for Brave browser. This assumes you have already downloaded brave browser deb file. You also need to download appimagetool.

#!/bin/bash -x

set +e APP=Brave patharch=x86_64 package="brave-browser_1.33.100_amd64.deb" URL="https://github.com/brave/brave-browser/releases/" if [ ! -f $package ]; then wget -c $URL$package else echo "$package file exists" fi

mkdir -p ./$APP.AppDir rm -rf ./$APP.AppDir/* cd $APP.AppDir/ find ../ -name *.deb -exec dpkg -x {} . ;

cp opt/brave.com/brave/product_logo_48.png ./Brave.png

find . -name $APP.desktop -exec cp {} . ;

find -name $APP.png -exec cp {} . ;

cat > $APP.desktop <<EOF [Desktop Entry] Type=Application Name=brave-browser Exec=brave-browser %U StartupNotify=true Icon=Brave Categories=Network;WebBrowser; MimeType=text/html;text/xml;application/xhtml_xml;image/webp;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ftp; EOF

mkdir -p usr/bin/ mv ./opt/brave.com/brave/* usr/bin/ ; rm -rf ./opt

AppRun="AppRun"

if [ ! -f ../../$AppRun ]; then wget -c https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${patharch} -O AppRun else cp ../../AppRun . fi chmod a+x AppRun

generate_type2_appimage

cd .. VERSION="" VERSION=$VERSION ../appimagetool -v -n ./$APP.AppDir/

if [ -d "./$APP.AppDir/" ] ; then rm -rf ./$APP.AppDir fi

Hope this helps.

AjayC
  • 398
  • thanks, it actually might, though in the meantime I built my abomination with appimagetool also, testing it now. – tatsu Jan 11 '22 at 15:42
  • @Someone Thanks I have removed the wrong URL link from the script. The Icon is picked from the package only. – AjayC Jan 11 '22 at 15:45
  • "brave-browser_1.33.100_amd64.deb" is this just a variable name or is it a path? Am I supposed to put my binary name in lieu of this variable? – tatsu Jan 11 '22 at 15:49
  • @tatsu. Download the deb file and put the same in the location where this script is stored. Else provide a URL link to the file. Create URL variable for the web path. – AjayC Jan 11 '22 at 15:52
  • in the ned this scitpt is only setup post running appimagetool all of this setup I've already done manually. I don't really see how this script helps me. – tatsu Jan 11 '22 at 15:56
  • since I'm not building for an existing deb but instead a binary I built from unity the only thing I'm struggling with is understanding where the AppImage thinks it is when it actually runs this way I can give it the correct path in EXEC in the desktop file. right now it's not finding my binary – tatsu Jan 11 '22 at 16:01
  • I'm close. it's in 'usr/bin' within the Dirr with that I was able to create a .sh to cd one folder further down and then run the binary but I'm still butting up against an non clear issue : ./Sanctuary_Map_Editor-x86_64.AppImage /tmp/.mount_SanctuVaZcb3/usr/bin//run.sh: line 3: cd: sanctuarymapeditor: No such file or directory /tmp/.mount_SanctuVaZcb3/usr/bin//run.sh: line 4: ./SanctuaryMapEditor: No such file or directory clearly the script I made is being called correctly by the .desktop file but for some reason things fail there. – tatsu Jan 11 '22 at 16:32
  • oh the dir isn't being preserved when I run this shell script. it reverts to where I ran the appimage from.

    So I'm back to how can I run a binary from a desktop file?

    – tatsu Jan 11 '22 at 16:40