Copy of https://bitbucket.org/kardianos/osext