From b709fc5dce6bca00233b6ece99f79b8dcf2efe84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bere=C5=BCa=C5=84ski?= Date: Fri, 27 Apr 2018 23:20:33 +0200 Subject: [PATCH] chocolatey-visualstudio.extension: use InstallChannelUri for VS Installer update only if --noWeb was requested Without --noWeb, the VS Installer will use ChannelUri, so the extension needs to to that, too. GitHub-Issue: GH-7 GH-8 GH-10 GH-26 --- .../Start-VisualStudioModifyOperation.ps1 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/chocolatey-visualstudio.extension/extensions/Start-VisualStudioModifyOperation.ps1 b/chocolatey-visualstudio.extension/extensions/Start-VisualStudioModifyOperation.ps1 index 1cddbf68..f02ec5da 100644 --- a/chocolatey-visualstudio.extension/extensions/Start-VisualStudioModifyOperation.ps1 +++ b/chocolatey-visualstudio.extension/extensions/Start-VisualStudioModifyOperation.ps1 @@ -223,8 +223,17 @@ if ($shouldFixInstaller -or ($Operation -ne 'uninstall' -and -not $installerUpdated)) { - # TODO: $useInstallChannelUri only if --noWeb - $useInstallChannelUri = $Operation -ne 'update' + if ($Operation -ne 'update' -and $argumentSet.ContainsKey('noWeb')) + { + Write-Debug 'InstallChannelUri will be used for VS Installer update because operation is not "update" and --noWeb was passed in package parameters' + $useInstallChannelUri = $true + } + else + { + Write-Debug 'InstallChannelUri will not be used for VS Installer update because either operation is "update" or --noWeb was not passed in package parameters' + $useInstallChannelUri = $false + } + if ($PSCmdlet.ShouldProcess("Visual Studio Installer", "update")) { Assert-VSInstallerUpdated -PackageName $PackageName -PackageParameters $PackageParameters -ProductReference $thisProductReference -Url $BootstrapperUrl -Checksum $BootstrapperChecksum -ChecksumType $BootstrapperChecksumType -UseInstallChannelUri:$useInstallChannelUri