Thanks, Les -- I had this same problem, and you solved it for me. For other
readers, here is the command adapted for Gambas3:
Shell sudo -S chmod 0777 ~/myfilename EOF\nmypassword\nEOF
Note: chmod 0777 is just an example of a chmod code
The newline code \n should NOT have spaces before it
I've found a better solution: I've created a module file with a process.
This can be triggered from within the main program.
' Gambas module file
PUBLIC hProcess AS Process
PUBLIC wins AS Form
PUBLIC szoveg1 AS TextBox
PUBLIC SUB ReadPassword()
DIM black AS Button
wins = NEW Form
wins.Width =
sudo allows you to pass a password to the shell with -S
The following should do it.
sudo -S apt-get install PACKAGENAME EOF
PASSWORD
EOF
Regards
Les Hardy
M. Cs. wrote:
I'd like to make my app able to download and install packages via apt-get
(or any other command-line package manager).
I'd like to make my app able to download and install packages via apt-get
(or any other command-line package manager). How can I do that? I know it
will need the user's password but how can I pass the command?
The simple SHELL sudo apt-get install ... won't do the thing!
Thanks!