none
How to detect .Net framework 2.0 on vista? RRS feed

  • Question

  • I have created setup by using Visual studio 2008 and framework 2.0. I removed .Net framewrok 2.0 from prerequisite as it shows "Accept agreement" screen. Requirement is it should install silently and because of this I used batch file in which I put conditions for .Net framework 2.0 as follows.


    SET FileName="%windir%\Microsoft.NET\Framework\v2.0.50727\Microsoft .NET Framework 2.0\install.exe"
    IF NOT EXIST %FileName%
    GOTO SetupOfNetFramework

    It works on all OS but not on Vista. Now I would like to know the following points.

    (1) Does .Net framewrok 2.0 come with VISTA by default?
    (2) If yes, can we remove it?
    (3) If yes, where is .Net framework 2.0 located on hard drive?
    (4) How to detect it on Vista machine in batch file?

    Waiting for some feedback and thanks in advance.

    Thursday, December 11, 2008 7:17 AM

Answers

  • Praful Udade said:

    I have created setup by using Visual studio 2008 and framework 2.0. I removed .Net framewrok 2.0 from prerequisite as it shows "Accept agreement" screen. Requirement is it should install silently and because of this I used batch file in which I put conditions for .Net framework 2.0 as follows.


    SET FileName="%windir%\Microsoft.NET\Framework\v2.0.50727\Microsoft .NET Framework 2.0\install.exe"
    IF NOT EXIST %FileName%
    GOTO SetupOfNetFramework

    It works on all OS but not on Vista. Now I would like to know the following points.

    (1) Does .Net framewrok 2.0 come with VISTA by default?
    (2) If yes, can we remove it?
    (3) If yes, where is .Net framework 2.0 located on hard drive?
    (4) How to detect it on Vista machine in batch file?

    Waiting for some feedback and thanks in advance.



    Hi Praful,

    Thank you for your further clarification. Now I could clarify what "it" means in your question.
    If I don't misunderstand, I get that you want to detect OS in batch file.

    I hope the following blog and will help you:
    How to detect Windows Vista in batch file or logon script
    http://roddotnet.blogspot.com/2008/08/how-to-detect-windows-vista-in-batch.html

    Here is a thread that also about how to detect OS in batch file or logon script. Batch file is provided in it.
    http://www.vistaheads.com/forums/microsoft-public-windows-vista-administration-accounts-passwords/30569-detect-vista-logon-script.html

    I hope this will help you this time.


    Thanks
    • Marked as answer by Prafulla Udade Wednesday, December 17, 2008 7:26 AM
    • Marked as answer by Prafulla Udade Wednesday, December 17, 2008 7:27 AM
    • Marked as answer by Prafulla Udade Wednesday, December 17, 2008 7:28 AM
    Wednesday, December 17, 2008 2:40 AM
  • Thnx JoJo. It's Awesome!
    • Marked as answer by Prafulla Udade Friday, December 19, 2008 7:40 AM
    Friday, December 19, 2008 7:39 AM

All replies

  • Hi Praful Udade,

    Both .Net framework 2.0 and 3.0 versions are installed as OS components on Windows Vista so that .Net framework 2.0 cannot be removed.

    Referring to detection, as far as I know, in Vista, .NET 2.0 and 3.0 (both SP1 as well) use CBS. You had better use the registry keys for detection.

    Any misunderstanding of your question , please tell me.

    Thanks.

    Monday, December 15, 2008 6:10 AM
  • Thanks for your reply.

    I would like to know how to detect operating system is vista by using batch file (DOS cammand)?

    Thanks in advance.
    Monday, December 15, 2008 8:05 AM
  •  Hi Praful,


    If I don't misunderstand it, in Heath Stewart's blog, he indicates that registry keys is the only way for detection.
    http://blogs.msdn.com/heaths/archive/2007/11/26/microsoft-net-framework-2-0-service-pack-1-and-how-to-detect-it.aspx

    Monday, December 15, 2008 8:24 AM
  • No, When I run my Install.bat file on any machine, it should detect what is OS. I would like to know how to detect OS is vista in Install.bat file?
    Tuesday, December 16, 2008 9:46 AM
  • Praful Udade said:

    I have created setup by using Visual studio 2008 and framework 2.0. I removed .Net framewrok 2.0 from prerequisite as it shows "Accept agreement" screen. Requirement is it should install silently and because of this I used batch file in which I put conditions for .Net framework 2.0 as follows.


    SET FileName="%windir%\Microsoft.NET\Framework\v2.0.50727\Microsoft .NET Framework 2.0\install.exe"
    IF NOT EXIST %FileName%
    GOTO SetupOfNetFramework

    It works on all OS but not on Vista. Now I would like to know the following points.

    (1) Does .Net framewrok 2.0 come with VISTA by default?
    (2) If yes, can we remove it?
    (3) If yes, where is .Net framework 2.0 located on hard drive?
    (4) How to detect it on Vista machine in batch file?

    Waiting for some feedback and thanks in advance.



    Hi Praful,

    Thank you for your further clarification. Now I could clarify what "it" means in your question.
    If I don't misunderstand, I get that you want to detect OS in batch file.

    I hope the following blog and will help you:
    How to detect Windows Vista in batch file or logon script
    http://roddotnet.blogspot.com/2008/08/how-to-detect-windows-vista-in-batch.html

    Here is a thread that also about how to detect OS in batch file or logon script. Batch file is provided in it.
    http://www.vistaheads.com/forums/microsoft-public-windows-vista-administration-accounts-passwords/30569-detect-vista-logon-script.html

    I hope this will help you this time.


    Thanks
    • Marked as answer by Prafulla Udade Wednesday, December 17, 2008 7:26 AM
    • Marked as answer by Prafulla Udade Wednesday, December 17, 2008 7:27 AM
    • Marked as answer by Prafulla Udade Wednesday, December 17, 2008 7:28 AM
    Wednesday, December 17, 2008 2:40 AM
  • Hi Praful,

    I do agree to Jojo. Please look into the registy editor's HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\ASP.NET\2.0.50727.0 folder to know whether the .NET Framework 2.0 is present or not.

    Thanks,
    Somen
    somen das
    Thursday, December 18, 2008 11:10 AM
  • Thnx JoJo. It's Awesome!
    • Marked as answer by Prafulla Udade Friday, December 19, 2008 7:40 AM
    Friday, December 19, 2008 7:39 AM