You might look at some very old code I have here.

My Computer Info script
http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=138538&site_id=1#import

Software depends on what type of installer was used. Some locations are updated/added for MSI that regular EXE Installers don't use the same location. Certainly a haberdashery of methods in the Registry. Then some applications use a display name or product name and some don't which makes it very difficult to be 100%