我从以下网址下载了.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
---------------------------
答案 0 :(得分:0)
虽然这并没有回答您的问题,但它可能对您或未来的读者有用。
这是一个未经测试的批处理文件,旨在通过阅读注册表来确定.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
未来Release
dWord值可以按照相同的格式添加到表格底部:&#39; dWordValue SPACE .NETVersion&#39;