PC Review


Reply
Thread Tools Rate Thread

Determining the path to the .NET framework

 
 
andreas.baus@meta-level.de
Guest
Posts: n/a
 
      12th Aug 2005
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.

 
Reply With Quote
 
 
 
 
Marcus Heege
Guest
Posts: n/a
 
      12th Aug 2005
System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory()

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>



 
Reply With Quote
 
andreas.baus@meta-level.de
Guest
Posts: n/a
 
      12th Aug 2005
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.

 
Reply With Quote
 
Marcus Heege
Guest
Posts: n/a
 
      12th Aug 2005
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining Framework Version John Bowman Microsoft Dot NET Framework 4 4th Aug 2005 05:38 PM
Re: Determining if SP1 for Framework 1.1 was successful or not. Thomas Scheidegger [MVP] Microsoft Dot NET Framework 0 10th Sep 2004 12:04 AM
Determining if a path is a network path (aka mapped drive - PathIsNetworkPath) Robert Munroe Microsoft C# .NET 0 10th Dec 2003 10:35 PM
determining correct ARC path? Tim Stephens Microsoft Windows 2000 Setup 0 5th Sep 2003 11:36 PM
Determining Desktop Path Roger Microsoft VB .NET 2 2nd Sep 2003 08:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:56 AM.