I'd say, you need to collect user agent strings database for that. Serve no-flash version by default, check flash through javascript as eg here, update the database with results.