-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chocolatey-visualstudio.extension: improve reliability
- skip VS 2017 product installation if the product is already installed (prevents upgrade, but also avoids problems with upgrade, such as broken VS Installer or installation still running after Chocolatey exits) (#7, #8) - warn the user to disallow running the Chocolatey Auto Uninstaller (#6)
- Loading branch information
1 parent
567f7af
commit ac32f2a
Showing
5 changed files
with
60 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
chocolatey-visualstudio.extension/extensions/Get-VSProductReference.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function Get-VSProductReference | ||
{ | ||
[CmdletBinding()] | ||
Param | ||
( | ||
[Parameter(Mandatory = $true)] [string] $VisualStudioYear, | ||
[Parameter(Mandatory = $true)] [string] $Product | ||
) | ||
|
||
switch ($VisualStudioYear) | ||
{ | ||
'2017' { $channelId = 'VisualStudio.15.Release' } | ||
default { throw "Unsupported VisualStudioYear: $VisualStudioYear"} | ||
} | ||
|
||
$productId = "Microsoft.VisualStudio.Product." + $Product | ||
|
||
$props = @{ | ||
ChannelId = $channelId | ||
ProductId = $productId | ||
} | ||
|
||
$obj = New-Object -TypeName PSObject -Property $props | ||
return $obj | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters