Skip to content

Commit

Permalink
chocolatey-visualstudio.extension: use channelUri from detected VS in…
Browse files Browse the repository at this point in the history
…stance, if present

GitHub-Issue: GH-7 GH-8 GH-10 GH-26
  • Loading branch information
jberezanski committed May 15, 2018
1 parent 32bee83 commit 1eb4c2c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ function Get-VSBootstrapperUrlFromChannelManifest
else
{
Write-Debug "Package parameters do not contain 'channelUri' or it is empty"
if ($ProductReference -ne $null -and -not [string]::IsNullOrEmpty($ProductReference.ChannelUri))
{
$manifestUri = $ProductReference.ChannelUri
Write-Debug "Using manifest URI from the provided ProductReference: '$manifestUri'"
}
else
{
Write-Debug "ProductReference has not been provided or does not contain the channel manifest URI"
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

$props = @{
ChannelId = $channelId
ChannelUri = $null
ProductId = $productId
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
installationPath = 'installationPath'
installationVersion = 'installationVersion'
channelId = 'channelId'
channelUri = 'channelUri'
productId = 'product"\s*:\s*{\s*"id'
enginePath = 'enginePath'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ function New-VSProductReference
Param
(
[Parameter(Mandatory = $true)] [string] $ChannelId,
[Parameter(Mandatory = $true)] [string] $ProductId
[Parameter(Mandatory = $true)] [string] $ProductId,
[string] $ChannelUri
)

$props = @{
ChannelId = $ChannelId
ChannelUri = $ChannelUri
ProductId = $ProductId
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@

$argumentSet = $baseArgumentSet.Clone()
$argumentSet['installPath'] = $productInfo.installationPath
$argumentSet['__internal_productReference'] = New-VSProductReference -ChannelId $productInfo.channelId -ProductId $productInfo.productid
$argumentSet['__internal_productReference'] = New-VSProductReference -ChannelId $productInfo.channelId -ProductId $productInfo.productid -ChannelUri $productInfo.channelUri
$argumentSets += $argumentSet
}
}
Expand Down

0 comments on commit 1eb4c2c

Please sign in to comment.