even redirecting the output to install.sh like in your examples is enough added complexity to make it not work in some cases
You can't have any install method that works in all cases.
if your goal is to have a simple install method anyone can use
Similarly, you can't have an install method anyone can use.