我从以下位置下载了 .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
未来的Release
dWord 值可以按照相同的格式添加到表的底部:'dWordValue SPACE.NETVersion'
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句