adapt download method according to os