{REQ}Install .NETFramework 2

Discussion in 'Scripting' started by AhrimanSefid, Mar 4, 2014.

  1. AhrimanSefid

    AhrimanSefid MDL Junior Member

    Apr 12, 2010
    97
    0
    0
    #1 AhrimanSefid, Mar 4, 2014
    Last edited by a moderator: Apr 20, 2017
    hi.
    Me Need install .Net 2 In Win XP And Install .Net 3.5 In Win 8&8.1.
    plz help me fixed code.
    thanks a lot.

    Code:
    @ECHO off
    cls
    set DOTNETINSTALLED=NO
    
    REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\Policy\v2.0" >NUL && set DOTNETINSTALLED=YES
    
    IF %DOTNETINSTALLED%==YES goto MAIN
    goto PREREQUISITE
    
    :PREREQUISITE
    REM Execute Prerequisite Setup Program
    START /wait Dot_NET_2.exe /q
    
    
    
    ping -n 20 127.0.0.1 > NULL
    
    :MAIN
    REM Execute Main Setup Program
    START /wait test.exe
    Code:
    @ECHO OFF
    Ver | Find "XP" > Nul
    If not ErrorLevel 1 Echo OS is Windows XP
    GOTO INSTALL1
    
    Ver | Find "9200" > Nul
    If not ErrorLevel 1 Echo OS is Windows 8
    GOTO INSTALL2
    
    :INSTALL1
    cls
    set DOTNETINSTALLED=NO
    
    REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\Policy\v2.0" >NUL && set DOTNETINSTALLED=YES
    
    IF %DOTNETINSTALLED%==YES goto MAIN
    START /wait Dot_NET_2.exe /q
    EXIT
    
    :INSTALL2
    cls
    set DOTNETINSTALLED=NO
    
    REG QUERY "HKEY_LOCAL_MACHINE\Software\Microsoft\NET Framework Setup\NDP\v3.5" >NUL && set DOTNETINSTALLED=YES
    
    IF %DOTNETINSTALLED%==YES goto MAIN
    START /wait 8Setup.exe
    EXIT
    
    :MAIN
    START /wait "test.exe"
    EXIT 
     
  2. Compo

    Compo MDL Member

    Mar 29, 2011
    137
    105
    10
    I thought that although Windows 8+ comes with .NET Framework 4.5+, .NET Framework 3.5 SP1 is already there as a not installed OS component installable using DISM.
     
  3. AhrimanSefid

    AhrimanSefid MDL Junior Member

    Apr 12, 2010
    97
    0
    0
    I write exe with c#.
    I have this problem that .net framework2 be installed automatically in windows xp and .net farmework 3.5 in windows 8 & windows 8.1. I mean I want my exe recognize what is OS then according OS install appropriate .netfaramework.