Finding Framework directory from code

  • Thread starter Thread starter Damian R.
  • Start date Start date
D

Damian R.

I am writing a console application which is to act as a
tool within a larger application. The console application
would basically install a windows service that I call an
Agent.
As part of the install of the Agent I need to install the
Windows service into the system. I have 2 questions:

1) Is there a class that I can use to do the neccessary
registration, i.e. I can just call some sort of service
install method on a class?

2) If there is no such class, is there a way I can find
out from within code the path to the installutil.exe
program is?
 
One way to get the path to installutil.exe is to read the value of registry
key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\sdkInstallRoot" and
append the version (got from Environment.Version) to it.

rajasi
 
Back
Top