System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()
> Is there a canonical way to determine the path to the folder where the
> runtime environment is installed? The reason I am asking is that I have
[quoted text clipped - 3 lines]
> does not use the default Microsoft installer) to find the regasm, since
> it is not in the path by default.
andreas.baus@meta-level.de - 12 Aug 2005 15:01 GMT
Unfortunately that won't work in the scripting language of the setup
utility, unless I can write a small .NET executable to call during the
installation process which returns the result of the call to me. I was
hoping there was a way to get this value from the registry, for example.
Marcus Heege - 12 Aug 2005 17:36 GMT
I don't know of an officially documented one, but
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework
has a value named InstallRoot that gives you the framework's root directory
(without the version number).
Usually this value is "C:\WINDOWS\Microsoft.NET\Framework\"
This seems to be consistent with v1.1 and v2.0, however, you still need the
version dependent part of the path.
On my v2.0 VPC, there is a subkey with the v2 version number, however this
is not consistent with v1.1.
HTH