仅在未安装的情况下才安装 .NET Framework

亚历克斯·韦茨

我从以下位置下载了 .NET 离线安装程序:http : //go.microsoft.com/fwlink/?LinkId=852107

我怎样才能让它安装 .NET 4.7.1 以防它以前没有安装?因为当我跑步时:

NDP471-KB4033342-x86-x64-AllOS-ENU.exe /passive

尽管我的计算机上已经安装了 .NET 4.7.1,但它仍会尝试安装它。该工具有一个帮助开关,但似乎没有一个命令适合我的需要:

---------------------------
Microsoft .NET Framework
---------------------------
Usage:      Setup [switches] 

        All switches are optional. 



/CEIPconsent - Optionally send anonymous feedback to improve the customer experience. 

/chainingpackage <name> - Optionally record the name of a package chaining this one. 

/createlayout <full path> - Download all files and associated resources to the specified location. Perform no other action.  * Disabled * 

/lcid - Set the display language to be used by this program, if possible. Example: /lcid 1031 

/log <file | folder> - Location of the log file. Default is the process temporary folder with a name based on the package. 

/msioptions - Specify options to be passed for .msi and .msp items. Example: /msioptions "PROPERTY1='Value'" 

/norestart - If the operation requires a reboot to complete, Setup should neither prompt nor cause a reboot. 

/passive - Shows progress bar advancing but requires no user interaction. 

/showfinalerror - Passive mode only: shows final page if the install is not successful. 

/showrmui - Passive mode only: shows restart manager dialog if files are in use. 

/pipe <name> - Optionally create a communication channel to allow a chaining package to get progress. 

/promptrestart - If the operation requires a reboot to complete, Setup should prompt, and trigger it if the user agrees. 

/q - Quiet mode, no user input required or output shown. 

/repair - Repair the payloads. 

/serialdownload - Force install operation to happen only after all the payload is downloaded. 

/uninstall - Uninstall the payloads. 

/parameterfolder <full path> - Specifies the path to the Setup’s configuration and data files. 

/NoSetupVersionCheck - Do not check ParameterInfo.xml for setup version conflicts. 

/uninstallpatch {patch code} - Removes update for all products the patch has been applied to. 

/? - Display this help.



Examples:



Silently install the package and create log file SP123.htm in the temp folder:  Setup /q /log %temp%\SP123.htm

Install with no user interaction unless reboot is needed to complete the operation: Setup /passive /promptrestart



Some command line switches are disabled for this package: createlayout

(c) Microsoft Corporation. All Rights Reserved.
---------------------------
OK   
---------------------------
组合

虽然这不能回答您的问题,但它可能对您或未来的读者有用。

这是一个未经测试的批处理文件,旨在通过读取注册表来确定已安装的 .Net Framework 版本:

@Echo Off
SetLocal EnableDelayedExpansion
Set "rk=HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP"
Set/A "vi=ri=0"

For /F "Tokens=3*" %%A In ('Reg Query "%rk%" /F v /K') Do If "%%B"=="" (
    If Not "%%~xA"=="" (Set/A "vi+=1"
        For /F "Tokens=2*" %%C In (
            'Reg Query "%rk%\%%~nxA" /V Version 2^>Nul^|Find /V "\"'
        ) Do Set "_v!vi!=%%D"
    ) Else (Set/A "ri+=1"
        For /F "Tokens=2*" %%E In (
            'Reg Query "%rk%\%%~nxA\Full" /V Release 2^>Nul^|Find /V "\"'
        ) Do Set/A "_r!ri!=%%F"))
If %ri% Gtr 0 (Set/A "vi+=1"
    For /F "Tokens=2" %%A In ('FindStr/B "!_r%ri%!" "%~f0"'
    ) Do Set "_v%vi%=%%A") 

If %vi% Gtr 0 For /F "Tokens=1* Delims==" %%A In ('Set _v') Do Echo([%%B]

Timeout -1
GoTo :EOF

Rem Later Version Table - do not remove
378389 4.5
378675 4.5.1
378758 4.5.1
379893 4.5.2
393295 4.6
393297 4.6
394254 4.6.1
394271 4.6.1
394802 4.6.2
394806 4.6.2
460798 4.7
460805 4.7
461308 4.7.1
461310 4.7.1
461808 4.7.2
461814 4.7.2
528040 4.8
528049 4.8
528372 4.8

未来的ReleasedWord 值可以按照相同的格式添加到表的底部:'dWordValue SPACE.NETVersion'

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在未安装Visual Studio的情况下构建.NET 4.6 Framework应用程序?

在未安装 .NET Framework 的情况下运行 CLR 应用程序

如何在没有Internet连接的情况下在XP机器上安装.NET Framework 3.5?

在没有Framework Manager的情况下安装Cognos BI?

安装.net Framework 4.6错误

.NET Framework 4.5.2安装失败

无法安装/激活.NET Framework

.Net Framework 4安装失败

.NET Framework 4.0安装失败

.Net Framework安装统计信息

如何在未安装任何客户端的情况下从Robot Framework连接Oracle数据库

安装.NET Framework 3.5需要.NET Framework 3.5

安装.net Framework 4.0是否需要.net framework 3.5?

仅在安装了模块的情况下才需要

在没有Visual Studio的情况下使用.NET Framework 4.6.1构建.NET Standard Library 1.4

如何在 docker 中安装 .net Framework?

在Docker中安装.net Framework 4.7.2

我无法安装.NET Framework。系统崩溃

在Windows 8.1中安装.Net Framework 3.5

安装后,.NET Framework不是Target Framework的选项

如何在不安装 .net 的情况下运行 .net 应用程序?

如何使用.NET Framework C#脚本安装.NET Core?

如何使用Wix安装程序下载和安装.NET Framework?

使用WIX安装程序安装.NET Framework 4.7.2(如果需要)

在没有InstallUtil.exe的情况下安装.NET Windows服务

在没有可用的dns的情况下如何使用debian net安装程序?

如何在不安装Windows的情况下运行.Net应用程序?

仅在安装了我的应用程序的情况下才提供免费wifi上网

.net Framework 3.5不会在Windows 10上安装