[Gambas-user] Desktop.InstallPackage() ?

Bruce Steers bsteers4 at gmail.com
Fri Feb 4 19:09:17 CET 2022


On Fri, 4 Feb 2022 at 17:26, Benoît Minisini <g4mba5 at gmail.com> wrote:

> 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
>

okay yes i guess that would be better.
I'll get on it, thinking to add a search and uninstall command too

gb.desktop.applications ?
DesktopApplications.class  : requires gb.form.terminal, supported installer

DesktopApplications.IsSupported() As Boolean
DesktopApplications.Install(PackageNames As String)
DesktopApplications.Remove(PackageNames As String)
DesktopApplications.IsInstalled(PackageNames As String) As Boolean
DesktopApplications.Search(PackageNames As String) As String[]


Respects
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220204/214ca9bd/attachment.htm>


More information about the User mailing list