We use a “Visual Studio Offline Layout” to deploy VS 16.6 to both developers and buildservers with mixed internet connections (offline / proxy / direct). Up until lately, the installation/update from previous VS instances (16.3 to be exact) worked quite well.
Currently, we cannot use the offline layout to install the local cached version of Visual Studio any more, because computers connected to the internet want to update “Visual Studio Installer” prior to installing anything.
The call to vs_Professional.exe update --wait --norestart --noweb --noUpdateInstaller ... fails with exit code '1' pretty quick after it was invoked.
Looking at the dd_ logs in TEMP, we find:
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.
We’re already using the --noweb and --noUpdateInstaller flags when calling the Visual Studio Installer, which leads me to the assumption that those parameters are not handled correctly.
Is there a way to actually force --noUpdateInstaller, can the Visual Installer also be updated offline prior to updating Visual Studio?
edit: a possible workaround to this problem may be to determine if the target workstation is connected to the internet or not - and specify use '--noUpdateInstaller' based on the result of this check.
i.e. in our deployment script:
$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