Another "proper" way is to get the creation date of some file you know for "sure" is added by installer. In my case it's "unins000.exe" which is (re)created by Inno setup v5. No PInvoke involved but simply use FileInfo's Exists and CreationTime properties!
The InstallDate key in the registry is not always there, especially when the program has not been installed with through MSI (as for example Adobe Flash Player Plugin, DAEMON Tools, 7-ZIP, Picasa, TeamViewer, Mozilla Firefox).
The "proper" way to get to that information is to use ::MsiGetProductInfo(). PInvoke should be trivial.
Thanks Rob! I've added a complete C# example below.
Another "proper" way is to get the creation date of some file you know for "sure" is added by installer. In my case it's "unins000.exe" which is (re)created by Inno setup v5. No PInvoke involved but simply use FileInfo's Exists and CreationTime properties!
I don't know about any API which will do that, but you could try to read the value from the Registry directly. Check the following key:
The information stored under the Uninstall key is displayed e.g. in Control Panel -> Add or Remove Programs.
The InstallDate key in the registry is not always there, especially when the program has not been installed with through MSI (as for example Adobe Flash Player Plugin, DAEMON Tools, 7-ZIP, Picasa, TeamViewer, Mozilla Firefox).