1

I would like to write a Perl script that checks if .NET 3.5 is installed. I want to check it because it calls some .NET stuff which does not work if it is missing.

Is there an easy way to determine if .NET is installed?

adrianbanks
  • 81,306
  • 22
  • 176
  • 206
capfan
  • 817
  • 10
  • 26
  • 3
    [This](http://stackoverflow.com/a/199783/116923) answers tells you to use the registry to check for .Net versions. I suspect your next question will be how to query the registry using perl :) – adrianbanks Aug 12 '13 at 13:42
  • 2
    And the answer to that would be [Win32::TieRegistry](http://search.cpan.org/perldoc?Win32::TieRegistry) – ikegami Aug 12 '13 at 14:02

1 Answers1

2

If you trust the Registry, you can use the Win32::TieRegistry module from CPAN and look for the right key based on the Microsoft documentation for How to: Determine Which .NET Framework Versions Are Installed. It's a bit tricky if you need .NET 3.5 and above because you have to check for different keys for versions below or above 4.

brian d foy
  • 129,424
  • 31
  • 207
  • 592