I have a program that checks if apt, apt-get and dpkg are installed. But now I need to check if using a normal distro (like Mint, Ubuntu, etc.) or using termux to change the path, how can I do that?
I already tried this, but then it says the path doesn't exist (on a normal distro):
std::ifstream aptget("/usr/bin/apt-get");
std::ifstream dpkg("/usr/bin/dpkg");
std::ifstream termuxapt("/data/data/com.termux/files/usr/bin/apt");
std::ifstream termuxaptget("/data/data/com.termux/files/usr/bin/apt-get");
std::ifstream termuxdpkg("/data/data/com.termux/files/usr/bin/dpkg");
if (!apt.is_open()) {
cout << "Path not found" << endl;
} else if(!aptget.is_open()) {
cout << "Path not found" << endl;
} else if(!dpkg.is_open()) {
cout << "Path not found" << endl;
} else if(!termuxapt.is_open()) {
cout << "Path not found" << endl;
} else if(!termuxaptget.is_open()) {
cout << "Path not found" << endl;
} else if(!termuxdpkg.is_open()) {
cout << "Path not found" << endl;
} else {
cout << "Path found" << endl;
}