[Gambas-user] Gambas self-extracting installer (4)

Bruce bbruen at ...2308...
Mon Oct 28 03:51:41 CET 2013


On Mon, 2013-10-28 at 13:06 +1100, Ian Haywood wrote:
> On Sunday, October 27, 2013, Benoit Minisini
> <gambas at ...1... <mailto:gambas at ...1...>> wrote:
> > But I don't think it's a good idea to ask for the root or sudo password
> > to installed Gambas package, for security reasons (can you really trust
> > that self-extracting installer?)
> >
>  I suggest detecting gksu or kdesu on the system and using those, this
> means your code doesn't have to handle the root password.

pkexec also (for XFCE based systems)!

Our autotools installer uses the following. I know its' not bash but it
might offer some clues.

          Select Case Desktop.Type
            Case "LXDE"
              Print "Installing - " & Subst("gksu -D Installer 'cd &1;
        pwd; make install'", User.Home &/ workdir &/
        Replace(File.BaseName(wkitem), ".tar", ""))
              Shell Subst("gksu -D Installer 'cd &1; pwd; make
        install'", User.Home &/ workdir &/
        Replace(File.BaseName(wkitem), ".tar", "")) To logger
              Print logger
            Case "KDE", "KDE4"
              Print "Installing - " & Subst("kdesu -n 'cd &1; pwd; make
        install'", User.Home &/ workdir &/
        Replace(File.BaseName(wkitem), ".tar", ""))
              Shell Subst("kdesu -n 'cd &1; pwd; make install'",
        User.Home &/ workdir &/ Replace(File.BaseName(wkitem), ".tar",
        "")) To logger
              Print logger
            Case "GNOME", "XFCE"
              Print "Installing - " & Subst("'cd &1; pwd; pkexec make
        install'", User.Home &/ workdir &/
        Replace(File.BaseName(wkitem), ".tar", ""))
              Shell Subst("'cd &1; pwd; pkexec make install'", User.Home
        &/ workdir &/ Replace(File.BaseName(wkitem), ".tar", "")) To
        logger
            Case Else
              Print Desktop.Type
  End Select

Bruce





More information about the User mailing list