I am trying to install an application that requires .NET 4.5. I need to check if .NET 4.5 is installed or not. I've created a BAT file to check the .NET version and installer 4.5 (if not already installed) before installing my application.
I'd love to find a BAT script that I can use to check the .NET version, but everything I've found requires another tool that I can't guarantee will be on the installation computer. Instead, I wrote a small application that checks the .NET version. The application works fine BUT, I don't know how to get the program to run on all computers. If I target the application to .NET 2.0, then I run into trouble with computers that have .NET 4.5 but don't have 2.0. If I target it to run on 4.5, then obviously it requires 4.5 and can only run on computers that already have 4.5.
What is the best way to check if I need to install 4.5, that will work on any configuration of Windows?