Automatically detect the current OS