I’m not sure why you’ll worry that the future version will not be backward compatible, they have all been until now, and there is no reason to believe that this will change. You create your installer today, and not when 4.6 is released, so even if you could find it, what would you do? Refuse to install, although it is likely to be compatible? It is impossible to detect, except to make sure that the .net version is installed [at least what you are targeting].
Also, if you are really worried about a future major version that violates compatibility, you can build in the installer for the .net version that you are aiming for, if that happens, how your application will be installed, say, Windows 9 / .net 6 later and those that will not be updated, the installer will install the previous version next to each other, and when several .net versions are installed, the one that matches your application will be used.
source share