none
How to programmatically know if .Net framework is fully installed. RRS feed

  • Question

  • I have a custom setup that I call .Net functions from custom actions. Also this setup checks if .Net framework 4.o is installed as a pre-requisite. If not installed, the installation wizard terminates the installation successfully. 

    If I install .Net framework 4 and continue to install my installation wizard without restarting the computer to complete the .Net installation, CCPSearch finds that the required .Net version is installed and continues the setup wizard. But it fails to execute .Net driven custom actions. If I restart the computer and complete the .Net installation and then run the setup, the custom actions are executes without any problem. 

    This means the computer needs to be restarted to complete the .Net installation (i could be wrong :p). Is there a way to find if the .Net is not installed completely, so I can programmatically check this and terminate the installation prompting the end user to restart the PC before installing the setup ?

    • Moved by Sabah ShariqMVP Wednesday, January 4, 2017 10:41 AM Not related to C#
    Wednesday, January 4, 2017 10:28 AM

All replies

  • Hi Kalpa,

    I am moving your thread to .NET forum for getting quick response.


    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    Wednesday, January 4, 2017 10:41 AM
  • Hi Kalpa,

    Welcome to MSDN forum.

    To determine Which .NET Framework Versions Are Installed:

    1. To find .NET Framework versions by viewing the registry (.NET Framework 1-4)
      • On the Start menu, choose Run.
      • In the Open box, enter regedit.exe.
      • You must have administrative credentials to run regedit.exe.
      • In the Registry Editor, open the following subkey:

                  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP

      2.  To find .NET Framework versions by viewing the registry (.NET Framework 4.5 and later)

           open the following subkey:

            HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full

    More information, please refer to here: https://msdn.microsoft.com/en-us/library/hh925568%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, January 5, 2017 3:03 AM
  • Thank you for your response.

    Can this be achieved programatically ? I also need to know whether the system was restarted, fully completing the .Net installation.

    Thursday, January 5, 2017 2:43 PM
  • Hi Kalpa,

    Thank you for your update.

    The .NET Framework setup will require a reboot when one of the files it needs to install is in use during installation. There are a handful of files that are shared by all versions of the .NET Framework, so if there is an earlier version of the .NET Framework installed on the system than the one that is currently being installed, and a managed application is running and holding one of the shared files in use, then a reboot could be required at the end of installation.

    Please refer to here: https://blogs.msdn.microsoft.com/astebner/2006/06/14/how-to-manage-reboots-when-deploying-the-net-framework/

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, January 6, 2017 9:35 AM
  • Hi,

    If you think my reply is helpful for you, could you please mark it as an answer which will be helpful for those who has the same doubt with you? Thank you for understanding.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, January 24, 2017 8:48 AM