Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Testing for program Install routine. Cross Platform Compatible.
#2
this might be good enough on any unix descendant:

Code: (Select All)
if not _fileexists("/usr/bin/the-program") then
'    offer to install "the-program"
end if
unless it's a program that someone preferred to install "locally."  usually his/her home directory.  or less often in "/usr/local/bin".

otherwise i'm not keen about "which" or "find".  could use "stat" instead.  "stat" could always give the user a message.  whether or not the file exists.  dislike "which" giving a stony silence when a file doesn't exist.  must rely then on a created zero-length file and it's one of my peeves on linux.

about opening a web browser to install any program.  that is something to consider carefully.  some people expect "rapid service" and dislike command-line package managers.  some people dislike even more like what manjaro does.  from their site in the web browser.  the appearance is that any program could be installed without any other intervention.  but it has to call "pacman" in the least.  more realistically, it has to summon "pamac".  only on that system.  also the command line to install the program is given, in case it doesn't work in the "convenient" way.

you could add "-y" option to "apt install" so it's done automatically.  (on debian, ubuntu or compatible.)  but also add a warning in the message box, that the system will work to install the program.  this is so there is less chance of the user's confusion.

could also add "pacman" for arch linux and compatible (endeavouros, manjaro, cachyos) but this is a pita.  usually must update repositories first.  it could decide to complain it requires a full system update.  the operating system people recommend a full update if someone needs to install or upgrade one program.  otherwise this should have been good enough:

Code: (Select All)
pacman -Sy ffmpeg
not sure anymore what the package for "ffmpeg" is called on arch.
Reply


Messages In This Thread
RE: Testing for program Install routine. Cross Platform Compatible. - by hsiangch_ong - 05-14-2025, 04:12 AM



Users browsing this thread: 1 Guest(s)