locked
Detect if .NET Framework is installed RRS feed

  • Question

  • I am writing a plugin for a 4th Dimension database where I am using .NET 2.0 for much of the advanced functionality but would like to be able to fallback to native (unmanaged) c++ if the framework is not installed on the machine to provide some basic functionality.

    Is this possible??

    The plugin is basically a DLL that uses a standard interface with 4th Dimension that is provided as C code. I have my plugin already working so that the unmanaged C++ calls .NET. I would like to be able to return error codes when .NET is not present when attempting to use functionality that requires it.

     

    Thanks

    Mog

    Sunday, February 19, 2006 5:34 PM

Answers

  • This is an article I wrote on this :-

    http://www.codeproject.com/dotnet/DetectDotNet.asp

     Mog0 wrote:

    This isn't quite what I was looking for...I would like to be able to check at runtime and branch within my code depending on the result.

    However, I hadn't thought of searching the "Help and Support" site so I searched it and found the article:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;318785

    This then linked to:

    http://blogs.msdn.com/astebner/archive/2004/09/18/231253.aspx

    The second link provides source code that allows you to detect programmatically, which version is installed.

    This may solve my problem but I still have one question.

    If I have a mixed mode dll (compiled with /clr) would this dll be able to run in the first place in order to test if .NET is installed? All the entry points are unmanaged code. I don't currrently have a machine without .NET in order to try this out so I would appreciate if someone could let me know if this is possible

    Thanks

    Mog

    Sunday, February 19, 2006 10:35 PM

All replies

  • This isn't quite what I was looking for...I would like to be able to check at runtime and branch within my code depending on the result.

    However, I hadn't thought of searching the "Help and Support" site so I searched it and found the article:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;318785

    This then linked to:

    http://blogs.msdn.com/astebner/archive/2004/09/18/231253.aspx

    The second link provides source code that allows you to detect programmatically, which version is installed.

    This may solve my problem but I still have one question.

    If I have a mixed mode dll (compiled with /clr) would this dll be able to run in the first place in order to test if .NET is installed? All the entry points are unmanaged code. I don't currrently have a machine without .NET in order to try this out so I would appreciate if someone could let me know if this is possible

    Thanks

    Mog

    Sunday, February 19, 2006 8:29 PM
  • This is an article I wrote on this :-

    http://www.codeproject.com/dotnet/DetectDotNet.asp

     Mog0 wrote:

    This isn't quite what I was looking for...I would like to be able to check at runtime and branch within my code depending on the result.

    However, I hadn't thought of searching the "Help and Support" site so I searched it and found the article:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;318785

    This then linked to:

    http://blogs.msdn.com/astebner/archive/2004/09/18/231253.aspx

    The second link provides source code that allows you to detect programmatically, which version is installed.

    This may solve my problem but I still have one question.

    If I have a mixed mode dll (compiled with /clr) would this dll be able to run in the first place in order to test if .NET is installed? All the entry points are unmanaged code. I don't currrently have a machine without .NET in order to try this out so I would appreciate if someone could let me know if this is possible

    Thanks

    Mog

    Sunday, February 19, 2006 10:35 PM