¿Cómo lo digo? if.NET 3.5 SP1 está instalado?


¿Cómo puedo saber si SP1 se ha instalado en un servidor que tiene. NET 3.5?

Author: Peter Mortensen, 2008-10-14

7 answers

Use Agregar/Quitar programas del Panel de control.

 18
Author: rp.,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-10-13 20:45:39

Mira HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\. Uno de estos debe ser cierto:

  • El valor Version en esa clave debe ser 3.5.30729.01
  • O el valor SP en la misma clave debe ser 1

En C# (tomado del primer comentario), podrías hacer algo en este sentido:

const string name = @"SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5";
RegistryKey subKey = Registry.LocalMachine.OpenSubKey(name);
var version = subKey.GetValue("Version").ToString();
var servicePack = subKey.GetValue("SP").ToString();
 132
Author: Ray,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-03-01 11:36:36

Puedes ir a SmallestDotNet usando IE desde el servidor. Eso le dirá la versión y también proporcionará un enlace de descarga si está desactualizado.

 27
Author: Andy May,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-10-13 20:42:17

Llegué a esta página mientras intentaba averiguar cómo detectar las versiones de framework instaladas en un servidor sin acceso a escritorio remoto o registro, por lo que la respuesta de Danny V funcionó para mí.

string path = System.Environment.SystemDirectory;
path = path.Substring( 0, path.LastIndexOf('\\') );
path = Path.Combine( path, "Microsoft.NET" );
// C:\WINDOWS\Microsoft.NET\

string[] versions = new string[]{
    "Framework\\v1.0.3705",
    "Framework64\\v1.0.3705",
    "Framework\\v1.1.4322",
    "Framework64\\v1.1.4322",
    "Framework\\v2.0.50727",
    "Framework64\\v2.0.50727",
    "Framework\\v3.0",
    "Framework64\\v3.0",
    "Framework\\v3.5",
    "Framework64\\v3.5",
    "Framework\\v3.5\\Microsoft .NET Framework 3.5 SP1",
    "Framework64\\v3.5\\Microsoft .NET Framework 3.5 SP1",
    "Framework\\v4.0",
    "Framework64\\v4.0"
};

foreach( string version in versions )
{
    string versionPath = Path.Combine( path, version );

    DirectoryInfo dir = new DirectoryInfo( versionPath );
    if( dir.Exists )
    {
        Response.Output.Write( "{0}<br/>", version );
    }
}
 12
Author: Matt,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-04-30 23:25:22

Eche un vistazo a este artículo que muestra las claves de registro que necesita buscar y proporciona una biblioteca.NET que lo hará por usted.

Primero, debe determinar si.NET 3.5 está instalado mirando HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5\Install, que es un valor DWORD. Si ese valor está presente y se establece en 1, entonces se instala esa versión del Framework.

Mire HKLM \ Software \ Microsoft \ NET Framework Setup \ NDP \ v3. 5 \ SP, que es una DWORD valor que indica el nivel de Service Pack (donde 0 es no service pack).

Para ser correcto sobre las cosas, realmente necesita asegurarse de que.NET Fx 2.0 y. NET Fx 3.0 estén instalados primero y luego verifique si. NET 3.5 está instalado. Si los tres son verdaderos, entonces usted puede comprobar para el nivel del paquete de servicio.

 9
Author: Scott Dorman,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-05-05 19:13:51

Comprobar es el siguiente directorio existe:

En máquinas de 64 bits: % SYSTEMROOT% \ Microsoft. NET\Framework64 \ v3. 5\Microsoft. NET Framework 3.5 SP1 \

En máquinas de 32 bits: % SYSTEMROOT% \ Microsoft. NET \ Framework \ v3. 5\Microsoft. NET Framework 3.5 SP1 \

Donde %SYSTEMROOT% es la variable ambiental SYSTEMROOT (e. g. C:\Windows).

 4
Author: Danny Varod,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2010-03-03 23:14:28

Asumiendo que el nombre está en todas partes "Microsoft. NET Framework 3.5 SP1", puede usar esto:

string uninstallKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(uninstallKey))
{
    return rk.GetSubKeyNames().Contains("Microsoft .NET Framework 3.5 SP1");
}
 2
Author: Panos,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-10-13 20:52:48