chocolatey / chocolatey-licensed-issues

Issues for Licensed Editions of Chocolatey
19 stars 13 forks source link

Internalizing packages with choco v2.0 mangles version numbers #349

Closed vanceitc closed 1 year ago

vanceitc commented 1 year ago

Checklist

What You Are Seeing?

After upgrading chocolatey to version 2.0, the internalization process now mangles the package version by adding or trimming zeros from the version number of the output package. This issue complicates automated processes that need to compare the versions.

For example, after internalizing with;

choco.exe download "dotnet4.6.1" --version="4.6.01055.20170308" --source="https://community.chocolatey.org/api/v2/" --output-directory="C:\temp" --internalize

Package 'dotnet4.6.1' with version '4.6.01055.20170308' becomes '4.6.1055.20170308', stripping the leading 0 from patch segment.

Package '7zip.install' with version '22.1' becomes '22.1.0', adding a .0 to the patch segment.

String comparison is obviously going to break, but even converting to the dotnet version type and comparing fails;

PS> ([version]"22.1" -eq [version]"22.1.0") False

Downgrading back to version 1.4 resolves this issue.

What is Expected?

Package version string should be identical after internalization.

How Did You Get This To Happen?

PS> choco.exe download "dotnet4.6.1" --version="4.6.01055.20170308" --source="https://community.chocolatey.org/api/v2/" --output-directory="C:\temp" --internalize

Package 'dotnet4.6.1' with version '4.6.01055.20170308' becomes '4.6.1055.20170308', trimming the leading 0 from patch segment.

Package '7zip.install' with version '22.1' becomes '22.1.0', adding a .0 patch segment.

System Details

Installed Packages

chocolatey
chocolatey-license
chocolatey.extension

# Fresh and clean installation

Output Log

PS C:\Users\C0011022\Projects\choco-test> choco.exe download "dotnet4.6.1" --version="4.6.01055.20170308" --source="https://community.chocolatey.org/api/v2/" --internalize --debug --verbose

Chocolatey v2.0.0 BusinessTrial
Chocolatey is running on Windows v 10.0.19045.0
Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
Command line: "C:\ProgramData\chocolatey\choco.exe" download dotnet4.6.1 --version=4.6.01055.20170308 --source=https://community.chocolatey.org/api/v2/ --internalize --debug --verbose
Received arguments: download dotnet4.6.1 --version=4.6.01055.20170308 --source=https://community.chocolatey.org/api/v2/ --internalize --debug --verbose
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
CountdownTask is now ready and waiting for PostRunMessage.
Terminal services setup not necessary for this session.
[Synchronize] Synchronize detected non-elevated run with default install, so synchronize is disabled. If background mode, synchronize will occur from background task.
[Programs & Features Package Sync] Detected non-elevated run with default install, so Packages in Programs & Features Sync is disabled. If in background mode, it will occur from background task.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
Performing validation checks.
Global Configuration Validation Checks:
 - Package Exit Code / Exit On Reboot = Checked
System State Validation Checks:
 Reboot Requirement Checks:
 - Pending Computer Rename = Checked
 - Pending Component Based Servicing = Checked
 - Pending Windows Auto Update = Checked
 - Pending File Rename Operations = Ignored
 - Pending Windows Package Installer = Checked
 - Pending Windows Package Installer SysWow64 = Checked
The source 'chocolatey' evaluated to a 'normal' source type

NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
Configuration: MaximumDownloadRateBitsPerSecond='0'|
MaximumDownloadRateBitsPerSecondAutoSet='False'|
LicensedInformation.LicenseType='BusinessTrial'|
LicensedInformation.LicenseIsValid='True'|
LicensedInformation.LicenseIsTrial='True'|
LicensedInformation.PauseInTrial='False'|
LicensedInformation.LicenseUserName='Georgia Department of Transportation [100] (puttero[at REDACTED])'|

LicensedInformation.LicenseExpirationDate='6/20/2023 12:00:00 AM'|
LicensedInformation.LicenseNodeCount='100'|
LicensedInformation.LicensedVersion='6.0.0.0'|
ChocolateyVersion.Version='2.0.0.0'|
ChocolateyVersion.IsLegacyVersion='False'|
ChocolateyVersion.Revision='0'|ChocolateyVersion.IsSemVer2='False'|
ChocolateyVersion.OriginalVersion='2.0.0.0'|
ChocolateyVersion.Major='2'|
ChocolateyVersion.Minor='0'|ChocolateyVersion.Patch='0'|
ChocolateyVersion.IsPrerelease='False'|
ChocolateyVersion.HasMetadata='False'|
LicensedFeatures.UseDownloadCache='True'|
LicensedFeatures.AllowSynchronization='True'|
LicensedFeatures.AllowBackgroundServiceOverride='False'|
LicensedFeatures.UseBackgroundService='False'|
LicensedFeatures.UseBackgroundServiceWithSelfServiceSourcesOnly='True'|
LicensedFeatures.UseBackgroundServiceWithNonAdministratorsOnly='False'|
LicensedFeatures.UseBackgroundServiceInteractively='False'|
LicensedFeatures.UseBackgroundServiceWithEmptySessions='True'|
LicensedFeatures.AllowBackgroundServiceUninstallsFromUserInstallsOnly='False'|

LicensedFeatures.AllowPreviewFeatures='False'|
LicensedFeatures.ShowAllPackagesInProgramsAndFeatures='False'|
LicensedFeatures.AdminOnlyExecutionForAllChocolateyCommands='False'|
LicensedFeatures.AdminOnlyExecutionForNewCommand='False'|
LicensedFeatures.AdminOnlyExecutionForDownloadCommand='False'|
LicensedFeatures.ReduceInstalledPackageSize='True'|
LicensedFeatures.ReduceOnlyNupkgSize='False'|
LicensedFeatures.UseLocalSystemForServiceInstalls='True'|
LicensedFeatures.WarnOnUpcomingLicenseExpiration='True'|
LicensedFeatures.UseChocolateyCentralManagement='False'|
LicensedFeatures.UseChocolateyCentralManagementDeployments='False'|
LicensedFeatures.UseLogRetentionPolicy='True'|
LicensedFeatures.ExcludeChocolateyPackagesDuringUpgradeAll='False'|
LicensedNewCommand.UseOriginalFilesLocation='False'|
LicensedNewCommand.PauseOnError='False'|
LicensedNewCommand.BuildPackage='False'|
LicensedNewCommand.GeneratePackagesFromSoftwareInstalls='False'|
LicensedNewCommand.IncludeArchitectureInPackageId='False'|
LicensedDownloadCommand.Internalize='True'|
LicensedDownloadCommand.AppendUseOriginalLocation='True'|
LicensedDownloadCommand.InternalizeAnyUrlFound='False'|
LicensedDownloadCommand.DownloadInstalledPackages='False'|
LicensedDownloadCommand.IgnoreUnfoundPackages='False'|
LicensedConvertCommand.IncludeAll='False'|
LicensedConvertCommand.IncludeDependencies='False'|
LicensedPushCommand.IntuneAuthenticationUrl='https://login.microsoftonline.com'|

LicensedPushCommand.IntuneApiUrl='https://graph.microsoft.com'|
LicensedPushCommand.IntuneRetryIntervalInSeconds='5'|
LicensedPushCommand.IntuneUploadTimeoutInSeconds='600'|
LicensedPushCommand.IntuneUploadChunkSizeInMegabytes='10'|
LicensedPushCommand.SkipCleanup='False'|
LicensedListCommand.ShowAuditInformation='False'|
LicensedListCommand.ShowDisplayVersion='False'|
LicensedUninstallCommand.FromProgramsAndFeatures='False'|
VirusConfiguration.VirusCheckMinimumPositives='4'|
VirusConfiguration.VirusScannerType='Generic'|
VirusConfiguration.GenericVirusScannerArgs=''[[File]]''|
VirusConfiguration.GenericVirusScannerValidExitCodes='0'|
VirusConfiguration.GenericVirusScannerTimeoutInSeconds='120'|
LicensedServiceInstaller.DefaultUserName='ChocolateyLocalAdmin'|
CentralManagementConfiguration.ReportPackagesTimerIntervalInSeconds='1800'|

CentralManagementConfiguration.ReceiveTimeoutInSeconds='30'|
CentralManagementConfiguration.SendTimeoutInSeconds='30'|
CentralManagementConfiguration.CertificateValidationMode='PeerOrChainTrust'|

CentralManagementConfiguration.MaxReceiveMessageSizeInBytes='2147483647'|

CentralManagementConfiguration.DeploymentCheckTimerIntervalInSeconds='180'|

LicensedBackgroundService.LogRetentionPolicyInDays='30'|
CommandName='download'|
CacheLocation='C:\Users\C0011022\AppData\Local\Temp\chocolatey'|
CommandExecutionTimeoutSeconds='14400'|WebRequestTimeoutSeconds='30'|
Sources='chocolatey'|SourceType='normal'|ShowOnlineHelp='False'|
Debug='True'|Verbose='True'|Trace='False'|Force='False'|Noop='False'|
HelpRequested='False'|UnsuccessfulParsing='False'|RegularOutput='True'|
QuietOutput='False'|PromptForConfirmation='True'|
DisableCompatibilityChecks='False'|AcceptLicense='False'|
AllowUnofficialBuild='False'|Input='dotnet4.6.1'|
Version='4.6.01055.20170308'|AllVersions='False'|
SkipPackageInstallProvider='False'|SkipHookScripts='False'|
PackageNames='dotnet4.6.1'|Prerelease='False'|ForceX86='False'|
OverrideArguments='False'|NotSilent='False'|
ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowDowngrade='False'|ForceDependencies='False'|PinPackage='False'|
Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.19045.0'|
Information.PlatformName='Windows 10'|
Information.ChocolateyVersion='2.0.0.0'|
Information.ChocolateyProductVersion='2.0.0'|
Information.FullName='choco, Version=2.0.0.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='True'|
Information.UserName='C0011022'|Information.UserDomainName='GDOT-AD'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='False'|
Information.IsLicensedVersion='True'|
Information.LicenseType='BusinessTrial'|
Information.CurrentDirectory='C:\Users\C0011022\Projects\choco-test'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
ListCommand.LocalOnly='False'|ListCommand.IdOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.ByTagOnly='False'|ListCommand.IdStartsWith='False'|
ListCommand.OrderByPopularity='False'|ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
ListCommand.ExplicitPageSize='False'|
ListCommand.ExplicitSource='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='Unknown'|
ApiKeyCommand.Command='Unknown'|PinCommand.Command='Unknown'|
OutdatedCommand.IgnorePinned='False'|
ExportCommand.IncludeVersionNumbers='False'|
Proxy.Location='gdot-enterprise.gdot.ad.local:8080'|
Proxy.BypassOnLocal='True'|TemplateCommand.Command='unknown'|
_ Chocolatey:ProChocolateyDownloadCommand - Normal Run Mode _
Downloading existing package(s) to C:\Users\C0011022\Projects\choco-test\download
Attempting to create directory "C:\Users\C0011022\Projects\choco-test\download".
Using proxy server 'gdot-enterprise.gdot.ad.local:8080'.
Switching source name chocolatey to actual source value 'https://community.chocolatey.org/api/v2/'.
Searching for dotnet4.6.1 v4.6.01055.20170308 to download from https://community.chocolatey.org/api/v2/.
Resolving resource PackageMetadataResource for source https://community.chocolatey.org/api/v2/
[NuGet]   GET https://community.chocolatey.org/api/v2/Packages(Id='dotnet4.6.1',Version='4.6.1055.20170308')
[NuGet]   NotFound https://community.chocolatey.org/api/v2/Packages(Id='dotnet4.6.1',Version='4.6.1055.20170308') 166ms
[NuGet]   GET https://community.chocolatey.org/api/v2/FindPackagesById()?id='dotnet4.6.1'&semVerLevel=2.0.0
[NuGet]   OK https://community.chocolatey.org/api/v2/FindPackagesById()?id='dotnet4.6.1'&semVerLevel=2.0.0 66ms
Downloading dotnet4.6.1 v4.6.01055.20170308 from https://github.com/Thieum/ChocolateyPackages/tree/master/DotNet4.6.1.
Using proxy server 'gdot-enterprise.gdot.ad.local:8080'.
Resolving resource DependencyInfoResource for source https://community.chocolatey.org/api/v2/
[NuGet]   GET https://community.chocolatey.org/api/v2/Packages(Id='DotNet4.6.1',Version='4.6.1055.20170308')
[NuGet]   NotFound https://community.chocolatey.org/api/v2/Packages(Id='DotNet4.6.1',Version='4.6.1055.20170308') 133ms
[NuGet]   CACHE https://community.chocolatey.org/api/v2/FindPackagesById()?id='DotNet4.6.1'&semVerLevel=2.0.0
[NuGet] Enhanced retry: HttpRetryHandler is in a state that retry would have been abandoned or not waited if it were not enabled.
[NuGet]   GET https://community.chocolatey.org/api/v2/$metadata
[NuGet]   OK https://community.chocolatey.org/api/v2/$metadata 46ms
[NuGet]   GET https://community.chocolatey.org/api/v2/FindPackagesById()?id='KB2919355'&semVerLevel=2.0.0
[NuGet]   OK https://community.chocolatey.org/api/v2/FindPackagesById()?id='KB2919355'&semVerLevel=2.0.0 41ms
[NuGet]   GET https://community.chocolatey.org/api/v2/FindPackagesById()?id='KB2919442'&semVerLevel=2.0.0
[NuGet]   OK https://community.chocolatey.org/api/v2/FindPackagesById()?id='KB2919442'&semVerLevel=2.0.0 47ms
[NuGet]   CACHE https://community.chocolatey.org/api/v2/FindPackagesById()?id='KB2919442'&semVerLevel=2.0.0
[NuGet] Resolving dependency information took 0 ms
Attempting to delete file "".
Resolving resource DownloadResource for source https://community.chocolatey.org/api/v2/
[NuGet] Adding package 'KB2919442.1.0.20160915' to folder 'C:\Users\C0011022\Projects\choco-test\download'
[NuGet] Added package 'KB2919442.1.0.20160915' to folder 'C:\Users\C0011022\Projects\choco-test\download'
[NuGet]   GET https://community.chocolatey.org/api/v2/Packages(Id='KB2919442',Version='1.0.20160915')
[NuGet]   OK https://community.chocolatey.org/api/v2/Packages(Id='KB2919442',Version='1.0.20160915') 71ms

KB2919442 v1.0.20160915 [Approved]
Found internalizable Chocolatey functions. Inspecting values for remote resources.
Attempting to delete file "C:\Users\C0011022\Projects\choco-test\download\KB2919442\KB2919442.nupkg".
 [variables] add: $kb='KB2919442'
 [variables] add: $packageName='KB2919442'
 [variables] add: $silentArgs='/quiet /norestart /log:"$env:TEMP\$kb.Install.evt"'
 [variables] add: $url='$(Split-Path -parent $MyInvocation.MyCommand.Definition)\files\Windows8.1-KB2919442-x86.msu'
 [variables] add: $url64='$(Split-Path -parent $MyInvocation.MyCommand.Definition)\files\Windows8.1-KB2919442-x64.msu'
 [variables] add: $checksum='3368C3A329F402FD982B15B399368627B96973F008A5456B5286BDFC10C1169B'
 [variables] add: $checksum64='C10787E669B484674584A990E069295E8B81B5366F98508010A3AE181B729482'
 [variables] update: $url64='$(Split-Path -parent $MyInvocation.MyCommand.Definition)\files\Windows8.1-KB2919442-x64.msu'
 [variables] update: $checksum64='C10787E669B484674584A990E069295E8B81B5366F98508010A3AE181B729482'
 [variables] update/variable substitution: $silentArgs='/quiet /norestart /log:"$env:TEMP\KB2919442.Install.evt"'

Package already specifies `UseOriginalLocation` in the script.
 Skipping adding additional `UseOriginalLocation` arguments to the file.
Updating chocolateyInstall.ps1 with local resources.
Attempting to delete file "C:\Users\C0011022\Projects\choco-test\download\KB2919442\tools\ChocolateyInstall.ps1".
Recompiling package.

Recompiled package files available at 'C:\Users\C0011022\Projects\choco-test\download\KB2919442'
Recompiled nupkg available in 'C:\Users\C0011022\Projects\choco-test'
Attempting to delete file "".
[NuGet] Adding package 'KB2919355.1.0.20160915 : KB2919442 [1.0.20160915, )' to folder 'C:\Users\C0011022\Projects\choco-test\download'
[NuGet] Added package 'KB2919355.1.0.20160915 : KB2919442 [1.0.20160915, )' to folder 'C:\Users\C0011022\Projects\choco-test\download'
[NuGet]   GET https://community.chocolatey.org/api/v2/Packages(Id='KB2919355',Version='1.0.20160915')
[NuGet]   OK https://community.chocolatey.org/api/v2/Packages(Id='KB2919355',Version='1.0.20160915') 47ms

KB2919355 v1.0.20160915 [Approved]
Found internalizable Chocolatey functions. Inspecting values for remote resources.
Attempting to delete file "C:\Users\C0011022\Projects\choco-test\download\KB2919355\KB2919355.nupkg".
 [variables] add: $kb='KB2919355'
 [variables] add: $packageName='KB2919355'
 [variables] add: $silentArgs='/quiet /norestart /log:"$env:TEMP\$kb.Install.evt"'
 [variables] add: $url='$(Split-Path -parent $MyInvocation.MyCommand.Definition)\files\Windows8.1-KB2919355-x86.msu'
 [variables] add: $url64='$(Split-Path -parent $MyInvocation.MyCommand.Definition)\files\Windows8.1-KB2919355-x64.msu'
 [variables] add: $checksum='F8BECA5B463A36E1FEF45AD0DCA6A0DE7606930380514AC1852DF5CA6E3F6C1D'
 [variables] add: $checksum64='B0C9ADA530F5EE90BB962AFA9ED26218C582362315E13B1BA97E59767CB7825D'
 [variables] update: $url64='$(Split-Path -parent $MyInvocation.MyCommand.Definition)\files\Windows8.1-KB2919355-x64.msu'
 [variables] update: $checksum64='B0C9ADA530F5EE90BB962AFA9ED26218C582362315E13B1BA97E59767CB7825D'
 [variables] update/variable substitution: $silentArgs='/quiet /norestart /log:"$env:TEMP\KB2919355.Install.evt"'

Package already specifies `UseOriginalLocation` in the script.
 Skipping adding additional `UseOriginalLocation` arguments to the file.
Updating chocolateyInstall.ps1 with local resources.
Attempting to delete file "C:\Users\C0011022\Projects\choco-test\download\KB2919355\tools\ChocolateyInstall.ps1".
Recompiling package.

Recompiled package files available at 'C:\Users\C0011022\Projects\choco-test\download\KB2919355'
Recompiled nupkg available in 'C:\Users\C0011022\Projects\choco-test'
Attempting to delete file "".
[NuGet] Adding package 'DotNet4.6.1.4.6.1055.20170308 : KB2919355 [1.0.20160915, )' to folder 'C:\Users\C0011022\Projects\choco-test\download'
[NuGet] Added package 'DotNet4.6.1.4.6.1055.20170308 : KB2919355 [1.0.20160915, )' to folder 'C:\Users\C0011022\Projects\choco-test\download'

DotNet4.6.1 v4.6.1055.20170308 [Approved]
Found internalizable Chocolatey functions. Inspecting values for remote resources.
Attempting to delete file "C:\Users\C0011022\Projects\choco-test\download\DotNet4.6.1\DotNet4.6.1.nupkg".
 [variables] add: $packageName='DotNet461'
 [variables] add: $toolsDir='$(Split-Path -parent $MyInvocation.MyCommand.Definition)'
 [variables] add: $url='https://download.microsoft.com/download/E/4/1/E4173890-A24A-4936-9FC9-AF930FE3FA40/NDP461-KB3102436-x86-x64-AllOS-ENU.exe'
 [variables] update: $packageName=''
 [variables] update: $toolsDir=''
 [variables] update: $url=''
Found 'https://download.microsoft.com/download/E/4/1/E4173890-A24A-4936-9FC9-AF930FE3FA40/NDP461-KB3102436-x86-x64-AllOS-ENU.exe' for replacement.
Using explicit proxy server 'gdot-enterprise.gdot.ad.local:8080'.
Setting request timeout to '30000'
Setting read/write timeout to '14400000'
Setting the UserAgent to 'chocolatey command line'
Using response url to determine file name ('https://download.microsoft.com/download/E/4/1/E4173890-A24A-4936-9FC9-AF930FE3FA40/NDP461-KB3102436-x86-x64-AllOS-ENU.exe').
File name determined from url is 'NDP461-KB3102436-x86-x64-AllOS-ENU.exe'
Using explicit proxy server 'gdot-enterprise.gdot.ad.local:8080'.
Setting the UserAgent to 'chocolatey command line'
Attempting to create directory "C:\Users\C0011022\Projects\choco-test\download\DotNet4.6.1\tools\files".
Downloading: 100% - 64.55 MB
Download of 'NDP461-KB3102436-x86-x64-AllOS-ENU.exe' completed.
Replacing 'https://download.microsoft.com/download/E/4/1/E4173890-A24A-4936-9FC9-AF930FE3FA40/NDP461-KB3102436-x86-x64-AllOS-ENU.exe' with '$(Split-Path -parent $MyInvocation.MyCommand.Definition)\files\NDP461-KB3102436-x86-x64-AllOS-ENU.exe'

Adding -UseOriginalLocation to Install-ChocolateyPackage (if found).
 You can also turn off the feature 'internalizeAppendUseOriginalLocation' to not append
Updating chocolateyInstall.ps1 with local resources.
Attempting to delete file "C:\Users\C0011022\Projects\choco-test\download\DotNet4.6.1\tools\ChocolateyInstall.ps1".
Recompiling package.

Recompiled package files available at 'C:\Users\C0011022\Projects\choco-test\download\DotNet4.6.1'
Recompiled nupkg available in 'C:\Users\C0011022\Projects\choco-test'
Sending message 'PostRunMessage' out if there are subscribers...

Additional Context

No response

pauby commented 1 year ago

Please see the upgrade guide for information on version normalization.

vanceitc commented 1 year ago

This is a breaking change for us, can you recommend a safe and reliable way to compare versions for equality?

Trying an equality comparison using the [System.Version] type fails.

PS> ([version]"22.1" -eq [version]"22.1.0") False

pauby commented 1 year ago

All versions need a three part version number: ([version]"22.1.0" -eq [version]"22.1.0"). But without knowing what the use case is, I can't recommend anything. For example, this might be a PowerShell script where you can update the version number string, or it might be something else where you can't.

Tow things I'd suggest:

  1. Reach out to support – run choco support to see your options.
  2. Downgrade to 1.4.0 until you can resolve the issue or have a workaround.

If you can wait for 2., I'd do 1. first, and work with the Support Team. If you can't wait, downgrade but still reach out to the Support Team.

vanceitc commented 1 year ago

Fortunately we caught this issue while still trialing C4B, now we will be looking for alternative solutions for now.