0

I have an application which uses thirdparty dlls that need .Net 4.0.
So, I packaged .Net exe using iexpress with my installer which is created using Wix.
However, later I came to know that it needs to reboot the machine after installing .Net 4.0 since some of its files may be in use.
I do not want my users to reboot the machine after installing my application.
The better way I thought is to display upfront what all running applications are using .Net so that they can close those applications and continue the installation without need to reboot.

How can I detect these running applications which are using .Net?

Thanks

Ashish
  • 53
  • 6

1 Answers1

0

I think you’d have to do something similar to Process Explorer:

  1. Call the CLRCreateInstance function with CLSID_CLRMetaHost.
  2. Enumerate each process on the system, then call the ICLRMetaHost::EnumerateLoadedRuntimes method for each process.
  3. For each runtime returned, call the ICLRRuntimeInfo::GetVersionString Method and check whether it returned the version string for .NET 4.0.
fission
  • 1,170
  • 18
  • 35