AppImage / AppImageKit

Package desktop applications as AppImages that run on common Linux-based operating systems, such as RHEL, CentOS, openSUSE, SLED, Ubuntu, Fedora, debian and derivatives. Join #AppImage on irc.libera.chat
http://appimage.org
Other
8.72k stars 559 forks source link

Precompiled AppRun changes AppImage working directory #1149

Closed A-G-D closed 3 years ago

A-G-D commented 3 years ago

Using the precompiled AppRun, executing an AppImage changes its current working directory to its temporary mount point. So let's say I want my AppImage to open a file named file.curv placed in the same directory my AppImage is located, then the following line

agd@agd:~$./Curv-x86_64.AppImage file.curv

won't work. It won't look for file.curv relative to the directory the AppImage is placed in, but instead will look for /tmp/.mount_Curv****/usr/file.curv. I don't know if this is the behaviour intended by the creator of the precompiled AppRun, but even if so, there are many cases where I won't want this kind of behaviour as a user of the AppImage (In most cases, we want the AppImage to behave exactly the same as the payload application, yet even in the most common use-case as shown in my example, it won't even work).

It there a solution to this while still using the precompiled AppRun? or do I have to create a custom AppRun? I would prefer if the former is possible.

probonopd commented 3 years ago

Yes, this is by design. For applications that have absolute paths compiled in which are binary-patched out this is necessary. If you don't want this behavior, then you can use a custom AppRun symlink/script/binary.