Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file .NET Framework安装仅在未安装的情况下进行_Batch File - Fatal编程技术网

Batch file .NET Framework安装仅在未安装的情况下进行

Batch file .NET Framework安装仅在未安装的情况下进行,batch-file,Batch File,我从以下位置下载了.NET脱机安装程序: 如果以前没有安装.NET 4.7.1,我如何才能让它安装它? 因为当我跑步时: NDP471-KB4033342-x86-x64-AllOS-ENU.exe /passive 虽然我的计算机上已经安装了.NET 4.7.1,但它仍尝试安装它。 该工具有一个帮助开关,但似乎没有一个命令适合我的需要: --------------------------- Microsoft .NET Framework -------------------------

我从以下位置下载了.NET脱机安装程序:

如果以前没有安装.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的安装版本:

@回音 SetLocal EnableDelayedExpansion 设置rk=HKLM\SOFTWARE\Microsoft\NET Framework安装程序\NDP 设置/A vi=ri=0 对于“注册查询%rk%/F v/K”中的/F令牌=3*%%A,如果%%B== 如果不是%%xA==Set/A vi+=1 对于/F令牌=2*%%C In “注册查询%rk%\%~nxA/V版本2^>Nul^查找/V” 一定要准备好!vi!=%%D 其他设置/A ri+=1 对于/F令牌=2*%%E In '注册查询%rk%\%%~nxA\Full/V版本2^>Nul^查找/V\' 一定要设置/A\r!ri!=%%F 如果%ri%Gtr 0套/A vi+=1 对于/F代币=2%%A In'FindStr/B_r%ri%!%~f0' 设置_v%vi%=%A 如果%vi%Gtr 0 For/F令牌=1*Delims==%%A在“Set _v”中做回显[%%B] 超时-1 后藤:EOF Rem更新版本表-不删除 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
未来版本的dWord值可以按照相同的格式添加到表的底部:“dWordValueSPACE.NETVersion”

您能解释一下这个批处理的功能吗?代码上面的第二段清楚地说明了这一点;双击它找到!我明白,但它如何确定合适的版本?批处理是否读取自身以匹配版本?语法相当神秘。对于所有版本,它都从注册表读取;从4.5和更高版本开始,它使用自己的内置表将注册表返回的dWord值与版本匹配。在Windows 10上测试。它不会检测到已安装4.8的>=.net 4.0