Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / August 2005

Tip: Looking for answers? Try searching our database.

Determining the path to the .NET framework

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
andreas.baus@meta-level.de - 12 Aug 2005 09:32 GMT
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
created a small Office Add-In in C# which needs to be registered as a
COM component using regasm.exe during installation. So I need a way for
the install script (the Add-In is only a part of a larger project which
does not use the default Microsoft installer) to find the regasm, since
it is not in the path by default.
Marcus Heege - 12 Aug 2005 13:09 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.