chocolatey / choco

Chocolatey - the package manager for Windows
https://chocolatey.org
Other
10.09k stars 892 forks source link

Choco not removing old file until second run of installation. #2209

Open richarddziennmi opened 3 years ago

richarddziennmi commented 3 years ago

What You Are Seeing?

Files in the C:\ProgramData\chocolatey\lib[xxx]\tools folder don't seem to get properly replaced until the second run of an installation. On the first installation of a new version of a package the contents of the nuget get unpacked into the lib\[xxx]\tools\ folder but the old files are still left over, when there are new files in the package.

What is Expected?

The content of C:\ProgramData\chocolatey\lib[xxx]\tools contains only the files in the latest version of the package.

How Did You Get This To Happen? (Steps to Reproduce)

Have two versions of a package available on your chocolatey server. The contents of the Tools folder on the server are e,g

In Package version 1.0:

.\chocolateyinstall.ps1 .\chocolateyuninstall.ps1 .\InstallFilesv_1.0.zip

In Package version 1.1:

.\chocolateyinstall.ps1 .\chocolateyuninstall.ps1 .\InstallFilesv_1.1.zip

Then: Choco Install version 1.0 of the package. (normal install) Choco upgrade to version 1.1 (lib[xxx]\tools\ will still contain files from the old install if above) Run choco upgrade to version 1.1 again. (lib[xxx]\tools contents will be properly erased)

Output Log -- First Upgrade attempt.

PS C:> choco upgrade mypackage --version="1.0.75" --force -y --debug --verbose Chocolatey v0.10.15 Business Chocolatey is running on Windows v 10.0.17763.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" upgrade mypackage --version=1.0.75 --force -y --debug --verbose Received arguments: upgrade mypackage --version=1.0.75 --force -y --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. SynchronizeTask is now ready and waiting for PreRunMessage. PackagesInProgramsAndFeaturesTask is now ready and waiting for PostRunMessage. Sending message 'PreRunMessage' out if there are subscribers... [Pending] Removing all pending packages that should not be considered installed... [Synchronize] Updating packages with Programs and Features [Synchronize] Currently only supports removals. Soon will handle updates. MyPackage 1.0.72 Performing validation checks. Global Configuration Validation Checks:

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='Business'| LicensedInformation.LicenseIsValid='True'| LicensedInformation.LicenseIsTrial='False'| LicensedInformation.PauseInTrial='False'| LicensedInformation.LicenseUserName='Network Merchants Limited [100] (christian.preston[at REDACTED])'|

LicensedInformation.LicenseExpirationDate='23/11/2021 00:00:00'| LicensedInformation.LicensedVersion='2.1.1.0'| ChocolateyVersion.Version='0.10.15.0'| ChocolateyVersion.PackageReleaseVersion='0'| LicensedFeatures.UseDownloadCache='True'| LicensedFeatures.AllowSynchronization='True'| 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'| LicensedNewCommand.UseOriginalFilesLocation='False'| LicensedNewCommand.PauseOnError='False'| LicensedNewCommand.BuildPackage='False'| LicensedNewCommand.GeneratePackagesFromSoftwareInstalls='False'| LicensedNewCommand.IncludeArchitectureInPackageId='False'| LicensedNewCommand.GenerateForCommunityUse='False'| LicensedDownloadCommand.Internalize='False'| LicensedDownloadCommand.AppendUseOriginalLocation='True'| LicensedDownloadCommand.InternalizeAnyUrlFound='False'| LicensedDownloadCommand.DownloadInstalledPackages='False'| LicensedDownloadCommand.IgnoreUnfoundPackages='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'|

CommandName='upgrade'| CacheLocation='C:\Users\richard.dzien.a\AppData\Local\Temp\chocolatey'| ContainsLegacyPackageInstalls='True'| CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'| Sources='https://licensedpackages.chocolatey.org/api/v2/;https://[server]/chocolatey'|

SourceType='normal'|Debug='True'|Verbose='True'|Trace='False'| Force='True'|Noop='False'|HelpRequested='False'| UnsuccessfulParsing='False'|RegularOutput='True'|QuietOutput='False'| PromptForConfirmation='False'|AcceptLicense='True'| AllowUnofficialBuild='False'|Input='mypackage'|Version='1.0.75'| AllVersions='False'|SkipPackageInstallProvider='False'| PackageNames='mypackage'|Prerelease='False'|ForceX86='False'| OverrideArguments='False'|NotSilent='False'| ApplyPackageParametersToDependencies='False'| ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'| AllowMultipleVersions='False'|AllowDowngrade='False'| ForceDependencies='False'|Information.PlatformType='Windows'| Information.PlatformVersion='10.0.17763.0'| Information.PlatformName='Windows Server 2016'| Information.ChocolateyVersion='0.10.15.0'| Information.ChocolateyProductVersion='0.10.15'| Information.FullName='choco, Version=0.10.15.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'| Information.Is64BitProcess='True'|Information.IsInteractive='True'| Information.UserName='richard.dzien.a'| Information.UserDomainName='[domain]'| Information.IsUserAdministrator='True'| Information.IsUserSystemAccount='False'| Information.IsUserRemoteDesktop='False'| Information.IsUserRemote='True'| Information.IsProcessElevated='True'| Information.IsLicensedVersion='True'| Information.LicenseType='Business'| Information.CurrentDirectory='C:\'|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'| Features.ScriptsCheckLastExitCode='False'| 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'| 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.Remove='False'|PinCommand.Command='unknown'| OutdatedCommand.IgnorePinned='False'|Proxy.BypassOnLocal='True'| Chocolatey:ProChocolateyUpgradeCommand - Normal Run Mode Upgrading the following packages: mypackage By upgrading you accept licenses for the packages. Resolving reference to chocolatey.licensed...

You have MyPackage v1.0.72 installed. Version 1.0.75 is available based on your source(s). Backing up existing MyPackage prior to operation. Moving 'C:\ProgramData\chocolatey\lib\MyPackage' to 'C:\ProgramData\chocolatey\lib-bkp\MyPackage' Attempting to create directory "C:\ProgramData\chocolatey\lib\MyPackage". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\ReadMe.md" to "C:\ProgramData\chocolatey\lib\MyPackage\ReadMe.md". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\MyPackage.nupkg" to "C:\ProgramData\chocolatey\lib\MyPackage\MyPackage.nupkg". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\MyPackage.nuspec" to "C:\ProgramData\chocolatey\lib\MyPackage\MyPackage.nuspec". Attempting to create directory "C:\ProgramData\chocolatey\lib\MyPackage\tools". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\chocolateyinstall.ps1" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\chocolateyinstall.ps1". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\chocolateyuninstall.ps1" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\chocolateyuninstall.ps1". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\config.json" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\config.json". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\InstalledConfig.json" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\InstalledConfig.json". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\LICENSE.txt" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\LICENSE.txt". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\ExtraFunctions.ps1" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\ExtraFunctions.ps1". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\VERIFICATION.txt" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\VERIFICATION.txt". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\MyPackage_Server_Release_72_72.zip" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\MyPackage_Server_Release_72_72.zip". Deleting file C:\ProgramData\chocolatey\lib\MyPackage\tools\chocolateyinstall.ps1 Attempting to delete file "C:\ProgramData\chocolatey\lib\MyPackage\tools\chocolateyinstall.ps1". Deleting file C:\ProgramData\chocolatey\lib\MyPackage\tools\chocolateyuninstall.ps1 Attempting to delete file "C:\ProgramData\chocolatey\lib\MyPackage\tools\chocolateyuninstall.ps1". Capturing package files in 'C:\ProgramData\chocolatey\lib\MyPackage' Found 'C:\ProgramData\chocolatey\lib\MyPackage\ReadMe.md' with checksum '2B08C04547E6939F17F98A5AD3A85FE2' Found 'C:\ProgramData\chocolatey\lib\MyPackage\MyPackage.nupkg' with checksum 'FEF0FA5FFD9CC9B619E0C249B1137B25' Found 'C:\ProgramData\chocolatey\lib\MyPackage\MyPackage.nuspec' with checksum '922C45B4339AE472EEC4F32FDF35ECD2' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\config.json' with checksum 'B4F42AE9756BBE4D62CE52FBCA29CADD' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\InstalledConfig.json' with checksum '4D2011E4A46B593466068108A5539FAE' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\LICENSE.txt' with checksum 'C0A6C63571D90B7DE831EF3FE1C43162' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\ExtraFunctions.ps1' with checksum '5E5D38E0474646C0D31837809F7F9A98' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\VERIFICATION.txt' with checksum 'B227967C2E978A3D3599910E5F79FFC5' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\MyPackage_Server_Release_72_72.zip' with checksum '9D72345445D85C47DFAAABDB82DE447D' Progress: Downloading MyPackage 1.0.75... 100% [NuGet] Uninstalling 'MyPackage 1.0.72'. [NuGet] Removed file 'MyPackage.nuspec' to folder 'C:\ProgramData\chocolatey\lib\MyPackage'. [NuGet] Removed file 'MyPackage.nupkg' to folder 'C:\ProgramData\chocolatey\lib\MyPackage'. [NuGet] The directory is not empty.

[NuGet] Successfully uninstalled 'MyPackage 1.0.72'. [NuGet] Installing 'MyPackage 1.0.75'. [NuGet] Added file 'ReadMe.md' to folder 'MyPackage'. [NuGet] Added file 'chocolateyinstall.ps1' to folder 'MyPackage\tools'. [NuGet] Added file 'chocolateyuninstall.ps1' to folder 'MyPackage\tools'. [NuGet] Added file 'config.json' to folder 'MyPackage\tools'. [NuGet] Added file 'LICENSE.txt' to folder 'MyPackage\tools'. [NuGet] Added file 'ExtraFunctions.ps1' to folder 'MyPackage\tools'. [NuGet] Added file 'VERIFICATION.txt' to folder 'MyPackage\tools'. [NuGet] Added file 'MyPackage_Server_Release_75_75.zip' to folder 'MyPackage\tools'. [NuGet] Added file 'MyPackage.nupkg' to folder 'MyPackage'. [NuGet] Added file 'MyPackage.nuspec' to folder 'MyPackage'. [NuGet] Successfully installed 'MyPackage 1.0.75'.

Output Log -- Second attempt.

PS C:> choco upgrade mypackage --version="1.0.75" --force -y --debug --verbose Chocolatey v0.10.15 Business Chocolatey is running on Windows v 10.0.17763.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" upgrade mypackage --version=1.0.75 --force -y --debug --verbose Received arguments: upgrade mypackage --version=1.0.75 --force -y --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. SynchronizeTask is now ready and waiting for PreRunMessage. PackagesInProgramsAndFeaturesTask is now ready and waiting for PostRunMessage. Sending message 'PreRunMessage' out if there are subscribers... [Pending] Removing all pending packages that should not be considered installed... [Synchronize] Updating packages with Programs and Features [Synchronize] Currently only supports removals. Soon will handle updates. MyPackage 1.0.75 Performing validation checks. Global Configuration Validation Checks:

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='Business'| LicensedInformation.LicenseIsValid='True'| LicensedInformation.LicenseIsTrial='False'| LicensedInformation.PauseInTrial='False'| LicensedInformation.LicenseUserName='Network Merchants Limited [100] (christian.preston[at REDACTED])'|

LicensedInformation.LicenseExpirationDate='23/11/2021 00:00:00'| LicensedInformation.LicensedVersion='2.1.1.0'| ChocolateyVersion.Version='0.10.15.0'| ChocolateyVersion.PackageReleaseVersion='0'| LicensedFeatures.UseDownloadCache='True'| LicensedFeatures.AllowSynchronization='True'| 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'| LicensedNewCommand.UseOriginalFilesLocation='False'| LicensedNewCommand.PauseOnError='False'| LicensedNewCommand.BuildPackage='False'| LicensedNewCommand.GeneratePackagesFromSoftwareInstalls='False'| LicensedNewCommand.IncludeArchitectureInPackageId='False'| LicensedNewCommand.GenerateForCommunityUse='False'| LicensedDownloadCommand.Internalize='False'| LicensedDownloadCommand.AppendUseOriginalLocation='True'| LicensedDownloadCommand.InternalizeAnyUrlFound='False'| LicensedDownloadCommand.DownloadInstalledPackages='False'| LicensedDownloadCommand.IgnoreUnfoundPackages='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'|

CommandName='upgrade'| CacheLocation='C:\Users\richard.dzien.a\AppData\Local\Temp\chocolatey'| ContainsLegacyPackageInstalls='True'| CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'| Sources='https://licensedpackages.chocolatey.org/api/v2/;https://[server]/chocolatey'|

SourceType='normal'|Debug='True'|Verbose='True'|Trace='False'| Force='True'|Noop='False'|HelpRequested='False'| UnsuccessfulParsing='False'|RegularOutput='True'|QuietOutput='False'| PromptForConfirmation='False'|AcceptLicense='True'| AllowUnofficialBuild='False'|Input='mypackage'|Version='1.0.75'| AllVersions='False'|SkipPackageInstallProvider='False'| PackageNames='mypackage'|Prerelease='False'|ForceX86='False'| OverrideArguments='False'|NotSilent='False'| ApplyPackageParametersToDependencies='False'| ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'| AllowMultipleVersions='False'|AllowDowngrade='False'| ForceDependencies='False'|Information.PlatformType='Windows'| Information.PlatformVersion='10.0.17763.0'| Information.PlatformName='Windows Server 2016'| Information.ChocolateyVersion='0.10.15.0'| Information.ChocolateyProductVersion='0.10.15'| Information.FullName='choco, Version=0.10.15.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'| Information.Is64BitProcess='True'|Information.IsInteractive='True'| Information.UserName='richard.dzien.a'| Information.UserDomainName='[domain]'| Information.IsUserAdministrator='True'| Information.IsUserSystemAccount='False'| Information.IsUserRemoteDesktop='False'| Information.IsUserRemote='True'| Information.IsProcessElevated='True'| Information.IsLicensedVersion='True'| Information.LicenseType='Business'| Information.CurrentDirectory='C:\'|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'| Features.ScriptsCheckLastExitCode='False'| 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'| 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.Remove='False'|PinCommand.Command='unknown'| OutdatedCommand.IgnorePinned='False'|Proxy.BypassOnLocal='True'| Chocolatey:ProChocolateyUpgradeCommand - Normal Run Mode Upgrading the following packages: mypackage By upgrading you accept licenses for the packages. Resolving reference to chocolatey.licensed... MyPackage v1.0.75 is the latest version available based on your source(s). Backing up existing MyPackage prior to operation. Moving 'C:\ProgramData\chocolatey\lib\MyPackage' to 'C:\ProgramData\chocolatey\lib-bkp\MyPackage' Attempting to create directory "C:\ProgramData\chocolatey\lib\MyPackage". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\ReadMe.md" to "C:\ProgramData\chocolatey\lib\MyPackage\ReadMe.md". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\MyPackage.nupkg" to "C:\ProgramData\chocolatey\lib\MyPackage\MyPackage.nupkg". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\MyPackage.nuspec" to "C:\ProgramData\chocolatey\lib\MyPackage\MyPackage.nuspec". Attempting to create directory "C:\ProgramData\chocolatey\lib\MyPackage\tools". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\chocolateyinstall.ps1" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\chocolateyinstall.ps1". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\chocolateyuninstall.ps1" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\chocolateyuninstall.ps1". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\config.json" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\config.json". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\InstalledConfig.json" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\InstalledConfig.json". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\LICENSE.txt" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\LICENSE.txt". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\ExtraFunctions.ps1" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\ExtraFunctions.ps1". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\VERIFICATION.txt" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\VERIFICATION.txt". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\MyPackage_Server_Release_72_72.zip" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\MyPackage_Server_Release_72_72.zip". Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\MyPackage\tools\MyPackage_Server_Release_75_75.zip" to "C:\ProgramData\chocolatey\lib\MyPackage\tools\MyPackage_Server_Release_75_75.zip". Deleting file C:\ProgramData\chocolatey\lib\MyPackage\tools\chocolateyinstall.ps1 Attempting to delete file "C:\ProgramData\chocolatey\lib\MyPackage\tools\chocolateyinstall.ps1". Deleting file C:\ProgramData\chocolatey\lib\MyPackage\tools\chocolateyuninstall.ps1 Attempting to delete file "C:\ProgramData\chocolatey\lib\MyPackage\tools\chocolateyuninstall.ps1". Capturing package files in 'C:\ProgramData\chocolatey\lib\MyPackage' Found 'C:\ProgramData\chocolatey\lib\MyPackage\ReadMe.md' with checksum '2B08C04547E6939F17F98A5AD3A85FE2' Found 'C:\ProgramData\chocolatey\lib\MyPackage\MyPackage.nupkg' with checksum 'F673867C955F4F3D4FFE976CE93F8570' Found 'C:\ProgramData\chocolatey\lib\MyPackage\MyPackage.nuspec' with checksum '0693EA3A8F9C22214D293595C3241AD6' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\config.json' with checksum 'B4F42AE9756BBE4D62CE52FBCA29CADD' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\InstalledConfig.json' with checksum '4D2011E4A46B593466068108A5539FAE' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\LICENSE.txt' with checksum 'C0A6C63571D90B7DE831EF3FE1C43162' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\ExtraFunctions.ps1' with checksum '33302A2399DBFECE8CD006D5716B57D5' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\VERIFICATION.txt' with checksum 'B227967C2E978A3D3599910E5F79FFC5' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\MyPackage_Server_Release_72_72.zip' with checksum '9D72345445D85C47DFAAABDB82DE447D' Found 'C:\ProgramData\chocolatey\lib\MyPackage\tools\MyPackage_Server_Release_75_75.zip' with checksum '94DCED795109F01B1823B250DE635249' Attempting to delete directory "C:\ProgramData\chocolatey\lib\MyPackage". Ensuring removal of package cache files. Progress: Downloading MyPackage 1.0.75... 100% [NuGet] Installing 'MyPackage 1.0.75'. [NuGet] Added file 'ReadMe.md' to folder 'MyPackage'. [NuGet] Added file 'chocolateyinstall.ps1' to folder 'MyPackage\tools'. [NuGet] Added file 'chocolateyuninstall.ps1' to folder 'MyPackage\tools'. [NuGet] Added file 'config.json' to folder 'MyPackage\tools'. [NuGet] Added file 'LICENSE.txt' to folder 'MyPackage\tools'. [NuGet] Added file 'ExtraFunctions.ps1' to folder 'MyPackage\tools'. [NuGet] Added file 'VERIFICATION.txt' to folder 'MyPackage\tools'. [NuGet] Added file 'MyPackage_Server_Release_75_75.zip' to folder 'MyPackage\tools'. [NuGet] Added file 'MyPackage.nupkg' to folder 'MyPackage'. [NuGet] Added file 'MyPackage.nuspec' to folder 'MyPackage'. [NuGet] Successfully installed 'MyPackage 1.0.75'.

Observations

In the first log there is the line: [NuGet] The directory is not empty. after the Capturing package files in section.

But in the second log it says Attempting to delete directory "C:\ProgramData\chocolatey\lib\MyPackage". after the Capturing package files in ... section.

richarddziennmi commented 3 years ago

One thing i am curious about though.

Why does it move the old installer files to a backup folder, then copy them back to the original folder? This seems unnecessary...