MrFlibble wrote: ↑Tue Dec 23, 2025 11:38 am
That works, as long as the symlink is being executed at ~/GNUstep/Applications/Oolite.
Code: Select all
$ cd ~/GNUstep/Applications/Oolite
$ ln -s ../../../Downloads/Oolite_test_1.91.0.7738-251223-46d0fcb-x86_64.AppImage oolite.appimage
$ cd /tmp
$ ~/GNUstep/Applications/Oolite/oolite.appimage
# Success. Selecting my savegame shows my custom D.T.T. Warlance.
Of course that still won't address running via a symlink elsewhere, e.g. ~/.local/bin, a normal $PATH location. To achieve that with this method still requires a wrapper script.
mcarans wrote: ↑Tue Dec 23, 2025 12:18 am
APPIMAGE returns the "(Absolute) path to AppImage file (with symlinks resolved)"
If that were true, it might be that APPIMAGE is the better solution. However, here I show testing that (with the (previous appimage) in ~/GNUstep/Applications/Oolite, with a symlink in ~/.local/bin
Code: Select all
$ cd ~/.local/bin
$ ln -s ../../GNUstep/Applications/Oolite/Oolite_test_1.91.0.7728-251219-7857806-x86_64.AppImage oolite.appimage
$ cd /tmp
# User convenience: We can call it without path from anywhere as ~/.local/bin is in $PATH
$ oolite.appimage
# Select savefile. See that the OXP ship is replaced with a question mark.
$ grep load.failed ~/.Oolite/Logs/Latest.log
11:06:03.349 [load.failed]: ***** Failed to load saved game "Flibble-Z4-20251221-003.oolite-save": Could not find ship type “dtt_war_lance_player” - please reinstall the appropriate OXP.
So that's not working as expected. If it did, then dropping the appimage file in ~/GNUstep/Applications/Oolite and sym-linking from somewhere in $PATH would result in OX[PZ]s being found in ~/GNUstep/Applications/Oolite/AddOns.
I note that command line arguments are passed through to oolite. I've not dived into appimage or your methods, but would guess that the legacy wrapper scripts which launch the oolite binary still exist in some form. If APPIIMAGE cannot work, would it be particularly hard to add the one-liner I'd suggested suggested yesterday into those scripts. A positive test could warn about upcoming deprecation as well as changing $pwd to work around this issue. Maybe add a 'custom OXP paths' command line option.
OT: I found that running with a garbage argument (I mistyped --help as --helo) is simply ignored, so Oolite launches fully. Perhaps for unrecognised command line arguments Oolite should spit out the help text then exit.
In legacy, the script ~/GNUstep/Applications/Oolite/oolite checks for first run, shows a couple if file if so, touches a file to say they've been seen, and then runs ~/GNUstep/Applications/Oolite/oolite.app/oolite-wrapper which in turn contains the lines:-
Code: Select all
OOLITE_ROOT=$(cd $(dirname $0); cd ..; pwd -P)
# and later...
cd ${OOLITE_ROOT}/
./oolite.app/oolite "$@"
RC=$?
Perhaps these stanzas (if they exist in similar form in your appimage) might be the source of some confusion.
At the moment the appimage just runs the oolte executable directly. It could be changed to do something else internally like run a script that launches oolite.
To avoid confusion I'll mention here that an AppImage has its own internal filesystem which uses squashfs. You can see the folder structure by running the folloowing which will extract the appimage folder structure to a folder in the current directory:
Code: Select all
./oolite*.AppImage --appimage-extract
"When you double-click an AppImage, it mounts itself and looks for a file named AppRun in the root of the AppImage directory (root of internal filesystem).
If AppRun is a binary: The system executes it directly.
If AppRun is a shell script: The system executes the script.
If AppRun is a symlink: It executes whatever the symlink points to (which can be your wrapper script)."
I'm a bit confused about what you are trying to do or what we want here. I have some questions (these concern the distro's filesystem not the internal appimage filesystem):
1. With regard to finding addons, the AppImage could look in various places:
a. The folder in which the .AppImage file is located
b. The folder of the symlink that launches the AppImage
c. The working directory at time of launch (which could be different to both 1 and 2 above)
eg. 1a could be ~/Downloads/ where oolite*.AppImage resides. 1b could be ~/.local/bin where oolite.appimage symlink resides. 1c could be anywhere such as ~.
Perhaps the simplest is to check all 3 to cover all bases. What do you think?
2. Should there be a launcher script in the AppImage itself?
a. If so, should that script check for first run and show a couple of files?
b. Given the working directory will be 1c, should it cd to another folder and if so should it cd to 1a or 1b? Or is this taken care of if the AppImage looks in multiple places for the AddOns folder?
c. Is there anything else that the script should do before or after launching the oolite executable?