1

I have an application which uses MS Chart Controls for .net v3.5 SP1 and as part of the installer, I currently include the chart controls and install them every time the installer runs.

That feels a bit crude though so I'd like to detect whether the controls are installed (I already have some code that does that for .net via detecting registry entries). Is there some standard registry entries I can check for?

Jon Cage
  • 36,366
  • 38
  • 137
  • 215

1 Answers1

1

Some searching around in the registry suggests that under 32-bit windows there should be the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Chart Setup\NDP\v3.5\Version

On 64-bit Windows there is an equivalent key here:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\NET Framework Chart Setup\NDP\v3.5\Version

On several systems (with .net 3.5 SP1 and chart controls installed) that value reads 3.5.30730.0 so that seems like a reasonable place to start.

Jon Cage
  • 36,366
  • 38
  • 137
  • 215
  • How to conditionally install something depending on existing registry key you can find e.g. in [`this post`](http://stackoverflow.com/a/10111173/960757). – TLama Nov 05 '13 at 14:48
  • If you need to potentially download the files if you can't find them, this can be handy too: http://www.codeproject.com/Articles/20868/NET-Framework-1-1-2-0-3-5-Installer-for-InnoSetup – Jon Cage Nov 05 '13 at 14:58
  • Note that the "Wow6432Node" part is only where you look for it in RegEdit. If you are using Inno or any other program to look for a key, you must not include that part. – Miral Nov 06 '13 at 20:18
  • @Miral: So if I just search on the first key it will find it regardless of whether it's 32 or 64 bit Windows? – Jon Cage Nov 07 '13 at 13:37
  • If you don't change the defaults, Inno assumes that you are installing a 32-bit application. Therefore when you refer to `HKLM` within Inno it will always look in the 32-bit registry regardless of whether Windows is 32-bit or 64-bit. This is usually what you want, although it is possible to explicitly ask for the 64-bit registry for special cases, or to tell Inno that you do have a 64-bit application. – Miral Nov 08 '13 at 04:13
  • It's a 32-bit application but on my 64-bit machine, the first key doesn't seem to exist. So I'm assuming that if I check for both keys and one or the other comes back positive then chart controls have been installed right? – Jon Cage Nov 08 '13 at 10:47