extract common part of checking all possible installation location