[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to embed command line tools in a Gambas app for AppImages ?


Le 09/07/2024 à 10:54, Claus Dietrich a écrit :
Am 08.07.24 um 21:24 schrieb Benoît Minisini:
I have just tested this simple project on a Ubuntu Mint 21 VM without 'ffmpeg' installed:

Public Sub Main()

  Exec ["ffmpeg"] Wait
  Shell "ffmpeg" Wait

End Sub

I created an AppImage from it, adding 'ffmpeg' as extra-dependencies.

Then I run the resulting AppImage on the same system.

- 'Exec' runs the embedded ffmpeg as expected.
- 'Shell' fails to run the embedded ffmpeg, it does not find it.

Regards,

I changed my class from Shell to Exec and indeed it worked on an OS without ffmpeg. Thanks!!!

As I am writing a Gambas-Buch chapter about AppImages and would be pleased if I could have answers to the following:

1.    Do we have to use Exec instead of Shell if we want to run resources embedded in a Gambas AppImage? I couldn't find anything in the Gambas documentation which could explain this.

Maybe because I have no idea how exactly AppImage works!

When you run the AppImage file, it is mounted as a new directory somewhere, and the PATH environment variable of the program is set according to what we put in the AppImageBuilder.yml file.

Apparently, the exec*() system calls ('Exec' instruction) take that into account, which is logical.

But when using an intermediate shell ('Shell' instruction) or System.Exist(), that new path is not taken into account, no idea why.

We must read the AppImage and AppImageBuilder documentation. Maybe there are some clues somewhere in it.


2.    Should the new environment parameter in the yml recipe template remain as standard instead of optional?

I don't know. It seems logical to me that if you have an AppImage, you want to run the command-line tools located inside the AppImage before the one installed on the system.

I can add a check-box for that and make it checked by default.


3.    What about methods like System.Exist() and System.Find() ? It seems that these commands are still aiming at the host environment and not the inner AppImage resources, right?

Indeed. As I said, I have no idea why at the moment.

Regards,

--
Benoît Minisini.


Follow-Ups:
Re: How to embed command line tools in a Gambas app for AppImages ?Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
References:
Re: How to embed command line tools in a Gambas app for AppImages ?Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: How to embed command line tools in a Gambas app for AppImages ?Claus Dietrich <claus.dietrich@xxxxxxxxxx>
Re: How to embed command line tools in a Gambas app for AppImages ?Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: How to embed command line tools in a Gambas app for AppImages ?Claus Dietrich <claus.dietrich@xxxxxxxxxx>
Re: How to embed command line tools in a Gambas app for AppImages ?Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
Re: How to embed command line tools in a Gambas app for AppImages ?Claus Dietrich <claus.dietrich@xxxxxxxxxx>