Score:1

steps to create an AppImage

ke flag

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

LiamF avatar
py flag
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."
tatsu avatar
ke flag
@LiamF jsut click on the flag icon and report it for malware url
Score:3
gb flag

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.

tatsu avatar
ke flag
thanks, it actually might, though in the meantime I built my abomination with appimagetool also, testing it now.
AjayC avatar
gb flag
@Someone Thanks I have removed the wrong URL link from the script. The Icon is picked from the package only.
tatsu avatar
ke flag
"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?
AjayC avatar
gb flag
@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.
tatsu avatar
ke flag
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 avatar
ke flag
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 avatar
ke flag
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 avatar
ke flag
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?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.