(re-add) platform detection logic. (Where did this go? I created it yesterday, then it disappeared)