[Gambas-user] Desktop.InstallPackage() ?
Benoît Minisini
g4mba5 at gmail.com
Fri Feb 4 18:25:16 CET 2022
Le 04/02/2022 à 18:16, Bruce Steers a écrit :
> I added a function called Install() to a version of gb.desktop i have
> imported into an app.
>
> Could be a nice addition to the Desktop.class I thought?
>
> Detects if user has apt-get, dnf, zypper, pacman or apk (could add more)
>
> has a NoConfirm arg to use the -y or --noconfirm args of the installers.
>
> Downside is it uses TerminalView so the user must have
> gambas3-gb-form-terminal installed (it is auto-loaded so no need to add
> TerminalView to your application)
>
> one or more package names can be given.
> uses su -c not sudo
> function returns 0 if all okay or an error code if install fails/is
> cancelled
>
> Any thoughts from any others on a function like this?
>
> All the best
> BruceS
>
I suggest making a new component named 'gb.desktop.package' (or
something better, but starting with 'gb.desktop.').
That way you will be able to make the dependencies (gb.form.terminal)
explicit, and won't pollute gb.desktop with features not automatically
needed.
Regards,
--
Benoît Minisini
More information about the User
mailing list