NSIS安装程序,用于检查.NET Framework [英] NSIS installer that checks for .NET Framework

查看:219
本文介绍了NSIS安装程序,用于检查.NET Framework的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个NSIS安装程序来检查.NET Framework并安装它(如果不存在)。您能为此指出一个脚本吗?我对NSIS还是很陌生。

I want to create an NSIS installer that checks for the .NET Framework and installs it if it's not there. Can you point me to a script for this? I'm very new to NSIS.

推荐答案

尝试 DotNetVer 脚本。它使用 LogicLib 且易于使用。

Try the DotNetVer script. It uses LogicLib and is quite easy to use.


  • HasDotNet< version> 检查是否安装了特定版本的.NET Framework。 < version>可以替换为以下值:1.0、1.1、2.0、3.0、3.5、4.0。

  • AtLeastDotNetServicePack 检查.NET框架是否具有Service Pack版本

  • IsDotNetServicePack 检查.NET框架是否具有与指定版本完全相同的Service Pack版本。

  • HasDotNetClientProfile 检查.NET框架是否为客户端配置文件安装。

  • HasDotNetFullProfile 检查.NET框架是否完整安装。

  • HasDotNet<version> checks if the specific version of .NET framework is installed. <version> can be replaced with the following values: 1.0, 1.1, 2.0, 3.0, 3.5, 4.0.
  • AtLeastDotNetServicePack checks if the .NET framework has a service pack version at least as specified.
  • IsDotNetServicePack checks if the .NET framework has a service pack version exactly as specified.
  • HasDotNetClientProfile checks if the .NET framework is a client profiled install.
  • HasDotNetFullProfile checks if the .NET framework is a full install.

示例:


${If} ${HasDotNet4.0}
    DetailPrint "Microsoft .NET Framework 4.0 installed."
    ${If} ${DOTNETVER_4_0} AtLeastDotNetServicePack 1
        DetailPrint "Microsoft .NET Framework 4.0 is at least SP1."
    ${Else}
        DetailPrint "Microsoft .NET Framework 4.0 SP1 not installed."
    ${EndIf}
    ${If} ${DOTNETVER_4_0} HasDotNetClientProfile 1
        DetailPrint "Microsoft .NET Framework 4.0 (Client Profile) available."
    ${EndIf}
    ${If} ${DOTNETVER_4_0} HasDotNetFullProfile 1
        DetailPrint "Microsoft .NET Framework 4.0 (Full Profile) available."
    ${EndIf}
    ${If} ${DOTNETVER_4_0} HasDotNetFullProfile 0
        DetailPrint "Microsoft .NET Framework 4.0 (Full Profile) not available."
    ${EndIf}
${EndIf}

这篇关于NSIS安装程序,用于检查.NET Framework的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆