- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我们使用 “Visual Studio Offline Layout”将 VS 16.6 部署到具有混合互联网连接(离线/代理/直接)的开发人员和构建服务器。直到最近,installation/update来自以前的 VS 实例(确切地说是 16.3)运行得很好。
目前,我们不能再使用离线布局来安装本地缓存版本的 Visual Studio,因为连接到互联网的计算机需要在安装任何东西之前更新“Visual Studio Installer”。
对 vs_Professional.exe update --wait --norestart --noweb --noUpdateInstaller ...
的调用在调用后很快失败,退出代码为“1”。查看 TEMP 中的 dd_
日志,我们发现:
VisualStudio Bootstrapper:08.06.2020 10:17:49: Starting VS setup process 'vs_installer.exe' with arguments ' --layoutPath "<unc_path>\vs2019_250520_layout" --in "\<unc_path>\vs2019_250520_layout\Response.json" update --passive --norestart --productkey ;-) --nocache --noUpdateInstaller --noWeb --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.NetCoreTools --add Microsoft.VisualStudio.Workload.Node --add Microsoft.VisualStudio.Component.VC.v141.MFC --includeOptional --includeRecommended --addProductLang en-us --locale de-DE --activityId "2e4fbc9e-37da-4791-9228-11b9649b69fa" --pipe "d549be32-ee39-49d5-b871-bed44625cafb"'.
VisualStudio Bootstrapper:08.06.2020 10:17:49: VS setup process C:\Program Files (x86)\Microsoft Visual Studio\Installer\vs_installer.exe started. All done.
VisualStudio Bootstrapper:08.06.2020 10:17:49: Waiting for setup process to complete...
VisualStudio Bootstrapper:08.06.2020 10:17:54: Pipe disconnected.
VisualStudio Bootstrapper:08.06.2020 10:17:56: VS setup process exited with code 1
VisualStudio Bootstrapper:08.06.2020 10:17:56: Bootstrapper failed with client process error or unknown error.
我们已经在使用 --noweb
and --noUpdateInstaller
调用 Visual Studio 安装程序时的标志,这让我假设这些参数没有得到正确处理。
有没有办法真正强制--noUpdateInstaller
, Visual Installer 是否也可以在更新 Visual Studio 之前离线更新?
编辑:此问题的可能解决方法是确定目标工作站是否连接到互联网 - 并根据此检查的结果指定使用“--noUpdateInstaller”。
即在我们的部署脚本中:
$hasInternetConnection = try {
$request = [System.Net.WebRequest]::Create( "http://microsoft.com" )
$response = $request.GetResponse()
$response.StatusCode -eq 200
}
catch {
$false
}
# use '--noUpdateInstaller' iff we are not connected to the internet!
$updateInstaller = if ($hasInternetConnection) {
""
}
else {
"--noUpdateInstaller"
}
$packageArgs = @{
packageName = $packageName
fileType = 'EXE'
file = $(Join-Path $layoutPath "vs_Professional.exe")
softwareName = 'Microsoft Visual Studio 2019 Professional'
silentArgs = "$setupPrefix --passive --norestart --wait --productkey $productKey --nocache $updateInstaller --noWeb $selectedWorkloads --includeOptional --includeRecommended --addProductLang en-us"
validExitCodes = @(0, 3010)
}
Install-ChocolateyInstallPackage @packageArgs
最佳答案
不幸的是,--noUpdateInstaller
开关非常具有误导性,并没有完全按照它的名称建议进行操作。
如果您的计算机没有连接到互联网,Visual Studio“离线安装程序”只会真正离线工作,否则它会始终联系 MSFT 并检查更新是否可用,至少对于安装程序 vs_installer.exe
本身。如果您没有连接到 Internet,则需要指定 --noUpdateInstaller
以忽略它无法检查更新的错误。
create-a-network-installation-of-visual-studio 上的“提示”说
If you want to install from an offline source on a non-internetconnected computer, specify both the --noWeb and --noUpdateInstalleroptions. The former prevents downloading updated workloads,components, and so on. The latter prevents the installer fromself-updating from the web.
缺少的是,如果安装程序的更新版本可用且退出代码为“1”,则命令执行实际上会失败。这似乎被设计打破了,但可以通过对安装/部署/升级脚本进行小的修改来解决。
(用于将 VS 部署到主机的示例 PowerShell 脚本,注意:vs_professional.exe 是从 UNC 共享调用的!)
# let the magical vs_installer be updated, if vs has already be installed previously
if (Test-IsVSAlreadyInstalled) {
try {
vs_professional.exe --quiet --update --wait
} catch {
Write-Host "failed to update magical vs_installer"
}
}
# only pass "update" if VS is already installed
$updatePrefix = if (Test-IsVSAlreadyInstalled) { "update" } else { "" }
# install or upgrade visual studio
vs_professional.exe $updatePrefix --passive --norestart --wait --productkey $productKey --noWeb $selectedWorkloads
--noUpdateInstaller
注意:这将允许 vs_installer.exe 自行更新,但仅使用离线布局位置的 vsix 包和二进制文件。
(用于将 VS 部署到主机的示例 PowerShell 脚本,注意:vs_professional.exe 是从 UNC 共享调用的!)
hasInternetConnection = try {
$request = [System.Net.WebRequest]::Create( "http://microsoft.com" )
$response = $request.GetResponse()
$response.StatusCode -eq 200
}
catch {
$false
}
# use '--noUpdateInstaller' iff we are not connected to the internet!
$updateInstaller = if ($hasInternetConnection) {
""
}
else {
"--noUpdateInstaller"
}
# only pass "update" if VS is already installed
$updatePrefix = if (Test-IsVSAlreadyInstalled) { "update" } else { "" }
# install or upgrade visual studio
vs_professional.exe $updatePrefix --passive --norestart --wait --productkey $productKey --nocache $updateInstaller --noWeb $selectedWorkloads
我正在使用包装在 Chocolatey Package 中的变通办法 #2 中描述的脚本,到目前为止取得了良好的效果。
关于visual-studio - Visual Studio 2019 离线布局更新忽略 '--noUpdateInstaller',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62259223/
我经常使用 SSMS 查询数据和构建数据集,我的 IT 部门负责数据库管理。 最近我发现了 Azure Data Studio,我喜欢: 智能感知 源代码控制(例如使用 Git) 来自社区的扩展 SQ
我想根据我使用的 visual studio 版本编译不同的东西,比如 #if VISUAL_STUDIO_VERSION > 2015 eventH?.Invoke(this, EventArgs.
我们的开发团队计划从 visual studio 2005 升级到 visual studio 2010 -- 跳过 visual studio 2008。 大部分项目是VB ASP.NET项目,使用
我的Visual Studio 2015无法构建2010平台工具集。它说: The build tools for Visual Studio 2010 (v100) cannot be found.
我目前正在使用 Visual Studio 2015 来编程 ASP.NET Core 应用程序。我对安装 Visual Studio 2017 有以下疑问: 什么被认为是最佳实践和/或最干净的方法?
尝试从扩展和更新获取 Visual Studio 扩展时,出现以下错误:- 向 visualstudiogallery.msdn.microsoft.com/Services/VStudio/Exte
这个问题在这里已经有了答案: Can Visual Studio Code and VS 2012 be installed on same computer? (1 个回答) 关闭去年。 在安装了
作为标准安装的一部分,Visual Studio Code 带有一个名为“Monokai Dimmed”的颜色主题。 有没有办法将它移植到 Visual Studio 2015?我检查了社区主题( h
我想开始编程 CUDA。 我已经安装了 Visual Studio 2010 Express。 我还安装了 nVidia nSight Visual Studio。 而且我具备所有常见的先决条件(Ne
Visual Studio Community Edition是否可以使用Visual Studio Online帐户上的存储库? 我一直为包含在Online帐户中的Visual Studio Onl
我有一个我一直在开发的应用程序,但在 android studio 上遇到了问题。当我点击“build->run”然后选择我的设备时,应用程序永远不会在我的手机上运行(并且自动出现的android-s
我正在使用Visual Studio2010。我面临的一个问题是,当我创建一个新的Web项目时,Visual Studio将创建该项目,并且不会在解决方案资源管理器中显示其解决方案。 另一件事是,我想
我通读了这里的许多帖子,却找不到一个有效的明确答案。因此,在花了一些时间使它生效之后,我认为应该发布它。 问题:发布配置文件将建立在服务器上,但不会发布。 解: 确保已安装Microsoft Wind
我正在尝试使用Visual Studio 2012构建针对.NET 3.5的C++ CLI应用程序。 通过安装Visual Studio 2008,并指定v90平台工具集,我已经在一台机器上进行了这项
我在 Microsoft Visual Studios 2013 中有一个项目,我想在 Microsoft Visual Studios 2010 中打开它。有什么简单的方法吗?还是我必须在2010年
我想知道,如果我发送一个解决方案文件夹(它是用 visual studio C# 编写的),您可以在 visual studio for mac 中打开解决方案吗? 在visual studio 20
有没有办法在 Visual Studio Code 和 Visual Studio 中设置相同的快捷方式(而不必每次都手动更改它们)? 例如,我在 Visual Studio Code 中经常使用 A
我刚开始了解 Visual Studio Code。我想知道,我可以将 Visual Studio 替换为所有 .NET 开发相关的工作吗? 我可以节省 Visual Studio 许可的成本吗? V
我安装了具有有效许可证(Visual Studio 订阅)的 Visual Studio 2019 企业版(VS 2019 16.1.4),它运行良好。 突然之间,当我尝试打开项目或项目中的任何文件时
我一直在使用 Compass 编译 Windows 环境中的 sass 文件,无论是在命令行上还是使用 Compass-app 来查看目录。 我刚刚开始使用 Visual Studio(专业版 201
我是一名优秀的程序员,十分优秀!