From 3f6250c3762801183829c493016285c9e4000680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bere=C5=BCa=C5=84ski?= Date: Tue, 21 Nov 2017 23:11:49 +0100 Subject: [PATCH] chocolatey-visualstudio.extension: obtain InstallChannelUri from detected VS instances GitHub-Issue: GH-7 GH-8 GH-10 GH-26 --- .../extensions/Get-VSBootstrapperUrlFromChannelManifest.ps1 | 1 + .../extensions/Get-VSProductReference.ps1 | 1 + .../extensions/Get-WillowInstalledProducts.ps1 | 1 + .../extensions/New-VSProductReference.ps1 | 4 +++- .../extensions/Start-VisualStudioModifyOperation.ps1 | 2 +- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/chocolatey-visualstudio.extension/extensions/Get-VSBootstrapperUrlFromChannelManifest.ps1 b/chocolatey-visualstudio.extension/extensions/Get-VSBootstrapperUrlFromChannelManifest.ps1 index d452cd28..66faf0c6 100644 --- a/chocolatey-visualstudio.extension/extensions/Get-VSBootstrapperUrlFromChannelManifest.ps1 +++ b/chocolatey-visualstudio.extension/extensions/Get-VSBootstrapperUrlFromChannelManifest.ps1 @@ -26,6 +26,7 @@ function Get-VSBootstrapperUrlFromChannelManifest else { Write-Debug "Package parameters do not contain 'channelUri' or it is empty" + # TODO: check $ProductReference.InstallChannelUri if ($ProductReference -ne $null -and -not [string]::IsNullOrEmpty($ProductReference.ChannelUri)) { $manifestUri = $ProductReference.ChannelUri diff --git a/chocolatey-visualstudio.extension/extensions/Get-VSProductReference.ps1 b/chocolatey-visualstudio.extension/extensions/Get-VSProductReference.ps1 index 90ab31d6..153b5471 100644 --- a/chocolatey-visualstudio.extension/extensions/Get-VSProductReference.ps1 +++ b/chocolatey-visualstudio.extension/extensions/Get-VSProductReference.ps1 @@ -18,6 +18,7 @@ $props = @{ ChannelId = $channelId ChannelUri = $null + InstallChannelUri = $null ProductId = $productId } diff --git a/chocolatey-visualstudio.extension/extensions/Get-WillowInstalledProducts.ps1 b/chocolatey-visualstudio.extension/extensions/Get-WillowInstalledProducts.ps1 index dd5b8b18..2e91366c 100644 --- a/chocolatey-visualstudio.extension/extensions/Get-WillowInstalledProducts.ps1 +++ b/chocolatey-visualstudio.extension/extensions/Get-WillowInstalledProducts.ps1 @@ -25,6 +25,7 @@ } $optionalProductProperties = @{ nickname = 'nickname' + installChannelUri = 'installChannelUri' } $propertyNameSelector = (($expectedProductProperties.Values + $optionalProductProperties.Values) | ForEach-Object { "($_)" }) -join '|' $regexTextBasicInfo = '"(?{0})"\s*:\s*"(?[^\"]+)"' -f $propertyNameSelector diff --git a/chocolatey-visualstudio.extension/extensions/New-VSProductReference.ps1 b/chocolatey-visualstudio.extension/extensions/New-VSProductReference.ps1 index 5a9766fa..7ba6a718 100644 --- a/chocolatey-visualstudio.extension/extensions/New-VSProductReference.ps1 +++ b/chocolatey-visualstudio.extension/extensions/New-VSProductReference.ps1 @@ -5,12 +5,14 @@ function New-VSProductReference ( [Parameter(Mandatory = $true)] [string] $ChannelId, [Parameter(Mandatory = $true)] [string] $ProductId, - [string] $ChannelUri + [string] $ChannelUri, + [string] $InstallChannelUri ) $props = @{ ChannelId = $ChannelId ChannelUri = $ChannelUri + InstallChannelUri = $InstallChannelUri ProductId = $ProductId } diff --git a/chocolatey-visualstudio.extension/extensions/Start-VisualStudioModifyOperation.ps1 b/chocolatey-visualstudio.extension/extensions/Start-VisualStudioModifyOperation.ps1 index 9483db22..80f44d78 100644 --- a/chocolatey-visualstudio.extension/extensions/Start-VisualStudioModifyOperation.ps1 +++ b/chocolatey-visualstudio.extension/extensions/Start-VisualStudioModifyOperation.ps1 @@ -194,7 +194,7 @@ $argumentSet = $baseArgumentSet.Clone() $argumentSet['installPath'] = $productInfo.installationPath - $argumentSet['__internal_productReference'] = New-VSProductReference -ChannelId $productInfo.channelId -ProductId $productInfo.productid -ChannelUri $productInfo.channelUri + $argumentSet['__internal_productReference'] = New-VSProductReference -ChannelId $productInfo.channelId -ProductId $productInfo.productid -ChannelUri $productInfo.channelUri -InstallChannelUri $productInfo.installChannelUri $argumentSets += $argumentSet } }