Multiple executables in one AppImage which share libs

I have two applications built with the Qt framework that I’d like to package together. There is a main program that calls a secondary program.

Both programs share some Qt libraries. I currently build the secondary as an appImage then include it in the main appImage. This makes the overall image very large. It would be much smaller if I could build both executables into one image and have them share libraries. I looked at the documentation and I’m not finding any mention of how to do this.

Is this possible?

Yes. Have both applications in the same AppDir, and specify the secondary application (the one that is not being referenced in Exec= in the desktop file) to linuxdeployqt like this: linuxdeployqt -executable=appdir/usr/bin/secondaryapp -appimage.

Hi @probono

My scenario is a bit different to @bbailey 's
I got a set of command line utilities (written in C++/built with CMake + gcc);
and these utilities depend on some common shared libraries.

Accroding to the rule “one AppImage file = one application”,
it seems that it is not possible to package all of the utilities together into one AppImage.
(even if the bin folder in AppDir is allowed to contain multiple executable.)

One workaround I can image is that I create a launcher and make the launcher to invoke the utilities in AppDir/bin.
(AppRun points to the launcher).

Is there any suggestion for my scenario?

Thanks.

ahha it seems I asked the same question as

Yes. Is it working for you?

I haven’t try yet. But I thought it should work. Thanks :grinning:

I landed on this page because it was the Number 1 search result for my query: “linuxdeployqt two executables”

This answer helped me a lot.

But it seems that -binary is not the actual name of the option!

I made it work using the option -executable instead. Was this command flag renamed at some point? Anyhow, it works :slight_smile:

1 Like

You are correct. Corrected above.