Is it possible to show a clean error if the user does not have the installed version of .NET?

I did and cannot find the answer, but is it possible to show a clean error if the user does not have the required version of .NET installed instead of the standard window without exception?

+4
source share
3 answers

You can always check if .NET is installed. Here is an article that describes how to do this. http://www.codeproject.com/Articles/18574/Is-NET-Framework-installed-on-this-machine

Of course you need to do this in unmanaged code.

+1
source

No, this is not so - your application has no chance of launching, because there is no .Net framework to launch it, so there is no way to show anything but the usual Windows dialog box.

One way to solve the problem is to create a boot script (executable executable file) in .Net 2.0 - this was sent to the service pack for Windows XP and has been included in every operating system ever since. This bootloader can check for the required installation of .Net framework and show a good error message if it does not exist - you can even install it for the user (we have a custom installer that works in this way and we send the .Net framework to as part of the package, so we can install them and initiate the required reboot if the user wants).

+2
source

A useful workaround: Create an installer application that checks for .NET runtime. Then, if you did not find the download and installation of the .NET Framework for the end user.

Possible solutions for this can be created using Inno Setup. See: Downloading and installing .NET 4.0 with Inno Setup as a starting point.

+1
source

Source: https://habr.com/ru/post/1442182/


All Articles