![]() |
Testing for program Install routine. Cross Platform Compatible. - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Help Me! (https://qb64phoenix.com/forum/forumdisplay.php?fid=10) +---- Thread: Testing for program Install routine. Cross Platform Compatible. (/showthread.php?tid=3689) |
Testing for program Install routine. Cross Platform Compatible. - ahenry3068 - 05-13-2025 The following should work on all 3 major platforms Linux, Windows & MACOS. I'm hoping for people to test this though. (I have no way of testing on MAC & Windows is actually inconvenient (but possible) for me to test) This little program should check if ffmpeg is installed and IF NOT, should facilitate it's installation. (No way this is 100% Internet could be down, system might not be ready etc) But this should be as good as possible. Comments and results requested and appreciated. Code: (Select All)
RE: Testing for program Install routine. Cross Platform Compatible. - hsiangch_ong - 05-14-2025 this might be good enough on any unix descendant: Code: (Select All) if not _fileexists("/usr/bin/the-program") then 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 RE: Testing for program Install routine. Cross Platform Compatible. - hsiangch_ong - 05-14-2025 could one use start terminal command on windows to download a file? that's peculiar. then again it might not be the command for "cmd.exe" anymore. RE: Testing for program Install routine. Cross Platform Compatible. - ahenry3068 - 05-14-2025 (05-14-2025, 04:17 AM)hsiangch_ong Wrote: could one use start terminal command on windows to download a file? that's peculiar. then again it might not be the command for "cmd.exe" anymore. START works on any file the system can open. If it's not an executable it opens the program associated with it. In the case of a URL that is going to be the default browser. RE: Testing for program Install routine. Cross Platform Compatible. - Ed Davis - 05-15-2025 (05-13-2025, 09:38 PM)ahenry3068 Wrote: The following should work on all 3 major platforms Linux, Windows & MACOS.This is very cool! I greatly appreciate multiplatform stuff. Thanks for sharing it. Just a comment - Windows is so goofy. On my machine, APPDATA is: C:\Users\Ed\AppData\Roaming I mean come on, "Roaming"? Couldn't they have come up with a better name? And sure enough, tons of things are installed in "Roaming". Interestingly, under AppData is Local, LocalLow and Roaming. Looks like I have lots of applications also installed in Local. I wish they could make up their minds! ![]() Again, thanks for sharing this! RE: Testing for program Install routine. Cross Platform Compatible. - bplus - 05-15-2025 You can't even find AppData from the Windows File navigator! They do there best to hide it from users. RE: Testing for program Install routine. Cross Platform Compatible. - SMcNeill - 05-15-2025 Just click the option to show hidden and system files... RE: Testing for program Install routine. Cross Platform Compatible. - bplus - 05-15-2025 Good thanks! |