Skip to content

Commit

Permalink
(chocolatey#2468) Remove choco version command
Browse files Browse the repository at this point in the history
This command is no longer required, and has been replaced by either the
choco list or the choco upgrade --noop commands depending on whether you
are attempting to get locally installed items, or checking to see what
upgrades are available.

In addition, the cver shim has also been removed.
  • Loading branch information
gep13 committed Mar 14, 2022
1 parent cb5d5f1 commit 2c32292
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 141 deletions.
12 changes: 6 additions & 6 deletions nuget/chocolatey/tools/chocolateysetup.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ function Remove-ShimWithAuthenticodeSignature {
function Remove-UnsupportedShimFiles {
param([string[]]$Paths)

$shims = @('cpack.exe')
$shims = @("cpack.exe", "cver.exe")

$Paths | ForEach-Object {
$path = $_
$shims | ForEach-Object { Join-Path $path $_ } | Where-Object { Test-Path $_ } | ForEach-Object {
$path = $_
Write-Debug "Removing shim from '$path'."
$shimPath = $_
Write-Debug "Removing shim from '$shimPath'."

try {
Remove-ShimWithAuthenticodeSignature -filePath $path
Remove-ShimWithAuthenticodeSignature -filePath $shimPath
}
catch {
Write-ChocolateyWarning "Unable to remove '$path'. Please remove the file manually."
Write-ChocolateyWarning "Unable to remove '$shimPath'. Please remove the file manually."
}
}
}
Expand Down Expand Up @@ -387,7 +387,7 @@ param(
$from = "$chocolateyPathOld\bin"
$to = "$chocolateyPath\bin"
# TODO: This exclusion list needs to be updated once shims are removed
$exclude = @("choco.exe", "chocolatey.exe", "cinst.exe", "clist.exe", "cpush.exe", "cuninst.exe", "cup.exe", "cver.exe", "RefreshEnv.cmd")
$exclude = @("choco.exe", "chocolatey.exe", "cinst.exe", "clist.exe", "cpush.exe", "cuninst.exe", "cup.exe", "RefreshEnv.cmd")
Get-ChildItem -Path $from -recurse -Exclude $exclude |
% {
Write-Debug "Copying $_ `n to $to"
Expand Down
2 changes: 0 additions & 2 deletions src/chocolatey.resources/chocolatey.resources.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
<EmbeddedResource Include="redirects\cpush.exe.ignore" />
<EmbeddedResource Include="redirects\cuninst.exe.ignore" />
<EmbeddedResource Include="redirects\cup.exe.ignore" />
<EmbeddedResource Include="redirects\cver.exe.ignore" />
<EmbeddedResource Include="tools\checksum.exe.ignore" />
<EmbeddedResource Include="tools\shimgen.exe.ignore" />
</ItemGroup>
Expand All @@ -104,7 +103,6 @@
<EmbeddedResource Include="redirects\cpush.exe" />
<EmbeddedResource Include="redirects\cuninst.exe" />
<EmbeddedResource Include="redirects\cup.exe" />
<EmbeddedResource Include="redirects\cver.exe" />
<EmbeddedResource Include="tools\7zip.license.txt" />
<EmbeddedResource Include="tools\checksum.exe" />
<EmbeddedResource Include="tools\checksum.license.txt" />
Expand Down
Binary file removed src/chocolatey.resources/redirects/cver.exe
Binary file not shown.
1 change: 0 additions & 1 deletion src/chocolatey.resources/redirects/cver.exe.ignore

This file was deleted.

3 changes: 1 addition & 2 deletions src/chocolatey/chocolatey.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
Expand Down Expand Up @@ -175,7 +175,6 @@
<Compile Include="infrastructure.app\commands\ChocolateyUninstallCommand.cs" />
<Compile Include="infrastructure.app\commands\ChocolateyUpdateCommand.cs" />
<Compile Include="infrastructure.app\commands\ChocolateyUpgradeCommand.cs" />
<Compile Include="infrastructure.app\commands\ChocolateyVersionCommand.cs" />
<Compile Include="infrastructure.app\configuration\ChocolateySource.cs" />
<Compile Include="infrastructure.app\configuration\ConfigFileConfigSetting.cs" />
<Compile Include="infrastructure.app\configuration\ConfigFileFeatureSetting.cs" />
Expand Down
129 changes: 0 additions & 129 deletions src/chocolatey/infrastructure.app/commands/ChocolateyVersionCommand.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public void RegisterComponents(Container container)
new ChocolateyFeatureCommand(container.GetInstance<IChocolateyConfigSettingsService>()),
new ChocolateyApiKeyCommand(container.GetInstance<IChocolateyConfigSettingsService>()),
new ChocolateyUnpackSelfCommand(container.GetInstance<IFileSystem>()),
new ChocolateyVersionCommand(container.GetInstance<IChocolateyPackageService>()),
new ChocolateyUpdateCommand(container.GetInstance<IChocolateyPackageService>()),
new ChocolateyExportCommand(container.GetInstance<INugetService>(), container.GetInstance<IFileSystem>()),
new ChocolateyTemplateCommand(container.GetInstance<ITemplateService>())
Expand Down

0 comments on commit 2c32292

Please sign in to comment.