【发布时间】:2020-06-08 09:42:30
【问题描述】:
我们使用“Visual Studio Offline Layout” 将 VS 16.6 部署到具有混合互联网连接(离线/代理/直接)的开发人员和构建服务器。直到最近,以前的 VS 实例(确切地说是 16.3)中的 installation/update 运行良好。
目前,我们无法再使用离线布局安装本地缓存版本的 Visual Studio,因为连接到 Internet 的计算机需要在安装任何东西之前更新“Visual Studio 安装程序”。
对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.
在调用 Visual Studio 安装程序时,我们已经在使用 --noweb and --noUpdateInstaller 标志,这让我认为这些参数没有正确处理。
有没有办法真正强制--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
【问题讨论】:
标签: visual-studio installation visual-studio-2019