Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong download progress reported during package upgrade #872

Closed
batzen opened this issue Jul 22, 2016 · 5 comments
Closed

Wrong download progress reported during package upgrade #872

batzen opened this issue Jul 22, 2016 · 5 comments

Comments

@batzen
Copy link

batzen commented Jul 22, 2016

What You Are Seeing?

Wrong download progress reported during package upgrade.
For example:

Progress: 95% - Saving 1.15 MB of 1.21 MB (1206624/1265496)
Download of fiddler4setup.exe (1.21 MB) completed.

or

Progress: 100% - Saving 31.17 MB of 31.21 MB (32684628/32729472)
Download of Git-2.9.2-64-bit.exe (31.21 MB) completed.

What is Expected?

Correct download size and progress being displayed.

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

I just called choco upgrade sysinternals fiddler4 filezilla ccleaner deluge git.install -y for the first rund and choco upgrade libreoffice -y --debug --verbose for the second run.

Output Log

I can't provide a log with verbose or debug output enabled for the first run as the upgrade is already finished.
I then only upgraded libreoffice with --debug and --verbose in the second run.

Log for the first run:

PS C:\WINDOWS\system32> choco upgrade sysinternals fiddler4 filezilla ccleaner deluge git.install -y
Upgrading the following packages:
sysinternals;fiddler4;filezilla;ccleaner;deluge;git.install
By upgrading you accept licenses for the packages.

You have sysinternals v2016.04.28 installed. Version 2016.07.04 is available based on your source(s).

sysinternals v2016.07.04 [Approved]
Downloading sysinternals
  from 'https://live.sysinternals.com/files/SysinternalsSuite.zip'
Progress: 100% - Saving 20.08 MB of 20.17 MB (21053192/21153704)
Download of SysinternalsSuite.zip (20.17 MB) completed.
Extracting C:\Users\Bastian\AppData\Local\Temp\chocolatey\sysinternals\2016.07.04\SysinternalsSuite.zip to C:\ProgramDat
a\chocolatey\lib\sysinternals\tools...
C:\ProgramData\chocolatey\lib\sysinternals\tools
WARNING: Clean up older versions of this install, most likely at c:\sysinternals
 ShimGen has successfully created a shim for accesschk.exe
 ShimGen has successfully created a shim for accesschk64.exe
 ShimGen has successfully created a gui shim for AccessEnum.exe
 ShimGen has successfully created a gui shim for ADExplorer.exe
 ShimGen has successfully created a gui shim for ADInsight.exe
 ShimGen has successfully created a shim for adrestore.exe
 ShimGen has successfully created a shim for Autologon.exe
 ShimGen has successfully created a gui shim for Autoruns.exe
 ShimGen has successfully created a shim for Autoruns64.exe
 ShimGen has successfully created a shim for autorunsc.exe
 ShimGen has successfully created a shim for autorunsc64.exe
 ShimGen has successfully created a gui shim for Bginfo.exe
 ShimGen has successfully created a shim for Cacheset.exe
 ShimGen has successfully created a shim for Clockres.exe
 ShimGen has successfully created a shim for Clockres64.exe
 ShimGen has successfully created a shim for Contig.exe
 ShimGen has successfully created a shim for Contig64.exe
 ShimGen has successfully created a shim for Coreinfo.exe
 ShimGen has successfully created a shim for ctrl2cap.exe
 ShimGen has successfully created a gui shim for Dbgview.exe
 ShimGen has successfully created a gui shim for Desktops.exe
 ShimGen has successfully created a gui shim for disk2vhd.exe
 ShimGen has successfully created a shim for diskext.exe
 ShimGen has successfully created a shim for diskext64.exe
 ShimGen has successfully created a shim for Diskmon.exe
 ShimGen has successfully created a gui shim for DiskView.exe
 ShimGen has successfully created a shim for du.exe
 ShimGen has successfully created a shim for du64.exe
 ShimGen has successfully created a shim for efsdump.exe
 ShimGen has successfully created a shim for FindLinks.exe
 ShimGen has successfully created a shim for FindLinks64.exe
 ShimGen has successfully created a shim for handle.exe
 ShimGen has successfully created a shim for handle64.exe
 ShimGen has successfully created a shim for hex2dec.exe
 ShimGen has successfully created a shim for hex2dec64.exe
 ShimGen has successfully created a shim for junction.exe
 ShimGen has successfully created a shim for junction64.exe
 ShimGen has successfully created a shim for ldmdump.exe
 ShimGen has successfully created a shim for Listdlls.exe
 ShimGen has successfully created a shim for Listdlls64.exe
 ShimGen has successfully created a shim for livekd.exe
 ShimGen has successfully created a gui shim for LoadOrd.exe
 ShimGen has successfully created a shim for LoadOrd64.exe
 ShimGen has successfully created a shim for LoadOrdC.exe
 ShimGen has successfully created a shim for LoadOrdC64.exe
 ShimGen has successfully created a shim for logonsessions.exe
 ShimGen has successfully created a shim for logonsessions64.exe
 ShimGen has successfully created a shim for movefile.exe
 ShimGen has successfully created a shim for movefile64.exe
 ShimGen has successfully created a shim for notmyfault.exe
 ShimGen has successfully created a shim for notmyfault64.exe
 ShimGen has successfully created a shim for notmyfaultc.exe
 ShimGen has successfully created a shim for notmyfaultc64.exe
 ShimGen has successfully created a shim for ntfsinfo.exe
 ShimGen has successfully created a shim for ntfsinfo64.exe
 ShimGen has successfully created a gui shim for pagedfrg.exe
 ShimGen has successfully created a shim for pendmoves.exe
 ShimGen has successfully created a shim for pendmoves64.exe
 ShimGen has successfully created a shim for pipelist.exe
 ShimGen has successfully created a shim for pipelist64.exe
 ShimGen has successfully created a gui shim for portmon.exe
 ShimGen has successfully created a shim for procdump.exe
 ShimGen has successfully created a shim for procdump64.exe
 ShimGen has successfully created a gui shim for procexp.exe
 ShimGen has successfully created a gui shim for Procmon.exe
 ShimGen has successfully created a shim for PsExec.exe
 ShimGen has successfully created a shim for PsExec64.exe
 ShimGen has successfully created a shim for psfile.exe
 ShimGen has successfully created a shim for psfile64.exe
 ShimGen has successfully created a shim for PsGetsid.exe
 ShimGen has successfully created a shim for PsGetsid64.exe
 ShimGen has successfully created a shim for PsInfo.exe
 ShimGen has successfully created a shim for PsInfo64.exe
 ShimGen has successfully created a shim for pskill.exe
 ShimGen has successfully created a shim for pskill64.exe
 ShimGen has successfully created a shim for pslist.exe
 ShimGen has successfully created a shim for pslist64.exe
 ShimGen has successfully created a shim for PsLoggedon.exe
 ShimGen has successfully created a shim for PsLoggedon64.exe
 ShimGen has successfully created a shim for psloglist.exe
 ShimGen has successfully created a shim for pspasswd.exe
 ShimGen has successfully created a shim for pspasswd64.exe
 ShimGen has successfully created a shim for psping.exe
 ShimGen has successfully created a shim for psping64.exe
 ShimGen has successfully created a shim for PsService.exe
 ShimGen has successfully created a shim for PsService64.exe
 ShimGen has successfully created a shim for psshutdown.exe
 ShimGen has successfully created a shim for pssuspend.exe
 ShimGen has successfully created a shim for pssuspend64.exe
 ShimGen has successfully created a gui shim for RAMMap.exe
 ShimGen has successfully created a shim for RegDelNull.exe
 ShimGen has successfully created a shim for RegDelNull64.exe
 ShimGen has successfully created a shim for regjump.exe
 ShimGen has successfully created a gui shim for RootkitRevealer.exe
 ShimGen has successfully created a shim for ru.exe
 ShimGen has successfully created a shim for ru64.exe
 ShimGen has successfully created a shim for sdelete.exe
 ShimGen has successfully created a shim for sdelete64.exe
 ShimGen has successfully created a shim for ShareEnum.exe
 ShimGen has successfully created a shim for ShellRunas.exe
 ShimGen has successfully created a shim for sigcheck.exe
 ShimGen has successfully created a shim for sigcheck64.exe
 ShimGen has successfully created a shim for streams.exe
 ShimGen has successfully created a shim for streams64.exe
 ShimGen has successfully created a shim for strings.exe
 ShimGen has successfully created a shim for strings64.exe
 ShimGen has successfully created a shim for sync.exe
 ShimGen has successfully created a shim for sync64.exe
 ShimGen has successfully created a shim for Sysmon.exe
 ShimGen has successfully created a shim for Sysmon64.exe
 ShimGen has successfully created a shim for Tcpvcon.exe
 ShimGen has successfully created a gui shim for Tcpview.exe
 ShimGen has successfully created a shim for Testlimit.exe
 ShimGen has successfully created a shim for Testlimit64.exe
 ShimGen has successfully created a gui shim for vmmap.exe
 ShimGen has successfully created a shim for Volumeid.exe
 ShimGen has successfully created a shim for Volumeid64.exe
 ShimGen has successfully created a shim for whois.exe
 ShimGen has successfully created a shim for whois64.exe
 ShimGen has successfully created a shim for Winobj.exe
 ShimGen has successfully created a gui shim for ZoomIt.exe
 The upgrade of sysinternals was successful.
  Software installed to 'C:\ProgramData\chocolatey\lib\sysinternals\tools'

You have fiddler4 v4.6.2.3 installed. Version 4.6.2.29442 is available based on your source(s).

fiddler4 v4.6.2.29442 [Approved]
Downloading fiddler4
  from 'https://fiddler2.com/dl/fiddler4setup.exe'
Progress: 95% - Saving 1.15 MB of 1.21 MB (1206624/1265496)
Download of fiddler4setup.exe (1.21 MB) completed.
Installing fiddler4...
fiddler4 has been installed.
 The upgrade of fiddler4 was successful.
  Software installed as 'EXE', install location is likely default.

You have filezilla v3.18.0 installed. Version 3.19.0 is available based on your source(s).

filezilla v3.19.0 [Approved]
Uninstalling the 32-bit version before installing the 64-bit version .
Uninstalling filezilla 32-bit...
0
filezilla 32-bit has been uninstalled.
Downloading filezilla 64 bit
  from 'http://sourceforge.net/projects/filezilla/files/FileZilla_Client/3.19.0/FileZilla_3.19.0_win64-setup.exe/downloa
d'
Progress: 98% - Saving 6.16 MB of 6.26 MB (6463160/6569088)
Download of FileZilla_3.19.0_win64-setup.exe (6.26 MB) completed.
Installing filezilla...
filezilla has been installed.
 The upgrade of filezilla was successful.
  Software installed to 'C:\Program Files\FileZilla FTP Client'

You have ccleaner v5.19.5633 installed. Version 5.20.5668 is available based on your source(s).

ccleaner v5.20.5668 [Approved]
#< CLIXML


Piriform Ltd : 20991231
PSPath       : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\No Chrome Offer Until
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google
PSChildName  : No Chrome Offer Until
PSDrive      : HKLM
PSProvider   : Microsoft.PowerShell.Core\Registry

Piriform Ltd : 20991231
PSPath       : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\No Toolbar Offer
               Until
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google
PSChildName  : No Toolbar Offer Until
PSDrive      : HKLM
PSProvider   : Microsoft.PowerShell.Core\Registry



<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0
"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"
><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></
PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">2</I64><PR N="Record"><AV>Preparing m
odules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><S
 S="debug">Host version is 5.0.10586.494, PowerShell Version is '5.0.10586.494' and CLR Version is '4.0.30319.42000'.</S
><S S="debug">Loading community extensions</S><S S="verbose">Exporting function 'Format-FileSize'.</S><S S="verbose">Exp
orting function 'Get-ChecksumValid'.</S><S S="verbose">Exporting function 'Get-ChocolateyUnzip'.</S><S S="verbose">Expor
ting function 'Get-ChocolateyWebFile'.</S><S S="verbose">Exporting function 'Get-EnvironmentVariable'.</S><S S="verbose"
>Exporting function 'Get-EnvironmentVariableNames'.</S><S S="verbose">Exporting function 'Get-FtpFile'.</S><S S="verbose
">Exporting function 'Get-OSArchitectureWidth'.</S><S S="verbose">Exporting function 'Get-ToolsLocation'.</S><S S="verbo
se">Exporting function 'Get-UACEnabled'.</S><S S="verbose">Exporting function 'Get-UninstallRegistryKey'.</S><S S="verbo
se">Exporting function 'Get-VirusCheckValid'.</S><S S="verbose">Exporting function 'Get-WebFile'.</S><S S="verbose">Expo
rting function 'Get-WebFileName'.</S><S S="verbose">Exporting function 'Get-WebHeaders'.</S><S S="verbose">Exporting fun
ction 'Install-BinFile'.</S><S S="verbose">Exporting function 'Install-ChocolateyDesktopLink'.</S><S S="verbose">Exporti
ng function 'Install-ChocolateyEnvironmentVariable'.</S><S S="verbose">Exporting function 'Install-ChocolateyExplorerMen
uItem'.</S><S S="verbose">Exporting function 'Install-ChocolateyFileAssociation'.</S><S S="verbose">Exporting function '
Install-ChocolateyInstallPackage'.</S><S S="verbose">Exporting function 'Install-ChocolateyPackage'.</S><S S="verbose">E
xporting function 'Install-ChocolateyPath'.</S><S S="verbose">Exporting function 'Install-ChocolateyPinnedTaskBarItem'.<
/S><S S="verbose">Exporting function 'Install-ChocolateyPowershellCommand'.</S><S S="verbose">Exporting function 'Instal
l-ChocolateyShortcut'.</S><S S="verbose">Exporting function 'Install-ChocolateyVsixPackage'.</S><S S="verbose">Exporting
 function 'Install-ChocolateyZipPackage'.</S><S S="verbose">Exporting function 'Install-Vsix'.</S><S S="verbose">Exporti
ng function 'Set-EnvironmentVariable'.</S><S S="verbose">Exporting function 'Set-PowerShellExitCode'.</S><S S="verbose">
Exporting function 'Start-ChocolateyProcessAsAdmin'.</S><S S="verbose">Exporting function 'Test-ProcessAdminRights'.</S>
<S S="verbose">Exporting function 'Uninstall-BinFile'.</S><S S="verbose">Exporting function 'Uninstall-ChocolateyEnviron
mentVariable'.</S><S S="verbose">Exporting function 'Uninstall-ChocolateyPackage'.</S><S S="verbose">Exporting function
'Uninstall-ChocolateyZipPackage'.</S><S S="verbose">Exporting function 'Update-SessionEnvironment'.</S><S S="verbose">Ex
porting function 'Write-ChocolateyFailure'.</S><S S="verbose">Exporting function 'Write-ChocolateySuccess'.</S><S S="ver
bose">Exporting function 'Write-FileUpdateLog'.</S><S S="verbose">Exporting alias 'Get-ProcessorBits'.</S><S S="verbose"
>Exporting alias 'Get-InstallRegistryKey'.</S><S S="verbose">Exporting alias 'Generate-BinFile'.</S><S S="verbose">Expor
ting alias 'Add-BinFile'.</S><S S="verbose">Exporting alias 'Remove-BinFile'.</S><S S="verbose">Exporting alias 'refresh
env'.</S><S S="verbose">Importing function 'Format-FileSize'.</S><S S="verbose">Importing function 'Get-ChecksumValid'.<
/S><S S="verbose">Importing function 'Get-ChocolateyUnzip'.</S><S S="verbose">Importing function 'Get-ChocolateyWebFile'
.</S><S S="verbose">Importing function 'Get-EnvironmentVariable'.</S><S S="verbose">Importing function 'Get-EnvironmentV
ariableNames'.</S><S S="verbose">Importing function 'Get-FtpFile'.</S><S S="verbose">Importing function 'Get-OSArchitect
ureWidth'.</S><S S="verbose">Importing function 'Get-ToolsLocation'.</S><S S="verbose">Importing function 'Get-UACEnable
d'.</S><S S="verbose">Importing function 'Get-UninstallRegistryKey'.</S><S S="verbose">Importing function 'Get-VirusChec
kValid'.</S><S S="verbose">Importing function 'Get-WebFile'.</S><S S="verbose">Importing function 'Get-WebFileName'.</S>
<S S="verbose">Importing function 'Get-WebHeaders'.</S><S S="verbose">Importing function 'Install-BinFile'.</S><S S="ver
bose">Importing function 'Install-ChocolateyDesktopLink'.</S><S S="verbose">Importing function 'Install-ChocolateyEnviro
nmentVariable'.</S><S S="verbose">Importing function 'Install-ChocolateyExplorerMenuItem'.</S><S S="verbose">Importing f
unction 'Install-ChocolateyFileAssociation'.</S><S S="verbose">Importing function 'Install-ChocolateyInstallPackage'.</S
><S S="verbose">Importing function 'Install-ChocolateyPackage'.</S><S S="verbose">Importing function 'Install-Chocolatey
Path'.</S><S S="verbose">Importing function 'Install-ChocolateyPinnedTaskBarItem'.</S><S S="verbose">Importing function
'Install-ChocolateyPowershellCommand'.</S><S S="verbose">Importing function 'Install-ChocolateyShortcut'.</S><S S="verbo
se">Importing function 'Install-ChocolateyVsixPackage'.</S><S S="verbose">Importing function 'Install-ChocolateyZipPacka
ge'.</S><S S="verbose">Importing function 'Install-Vsix'.</S><S S="verbose">Importing function 'Set-EnvironmentVariable'
.</S><S S="verbose">Importing function 'Set-PowerShellExitCode'.</S><S S="verbose">Importing function 'Start-ChocolateyP
rocessAsAdmin'.</S><S S="verbose">Importing function 'Test-ProcessAdminRights'.</S><S S="verbose">Importing function 'Un
install-BinFile'.</S><S S="verbose">Importing function 'Uninstall-ChocolateyEnvironmentVariable'.</S><S S="verbose">Impo
rting function 'Uninstall-ChocolateyPackage'.</S><S S="verbose">Importing function 'Uninstall-ChocolateyZipPackage'.</S>
<S S="verbose">Importing function 'Update-SessionEnvironment'.</S><S S="verbose">Importing function 'Write-ChocolateyFai
lure'.</S><S S="verbose">Importing function 'Write-ChocolateySuccess'.</S><S S="verbose">Importing function 'Write-FileU
pdateLog'.</S><S S="verbose">Importing alias 'Add-BinFile'.</S><S S="verbose">Importing alias 'Generate-BinFile'.</S><S
S="verbose">Importing alias 'Get-InstallRegistryKey'.</S><S S="verbose">Importing alias 'Get-ProcessorBits'.</S><S S="ve
rbose">Importing alias 'refreshenv'.</S><S S="verbose">Importing alias 'Remove-BinFile'.</S></Objs>
0
Downloading ccleaner 64 bit
  from 'https://download.piriform.com/ccsetup520.exe'
Progress: 98% - Saving 7.64 MB of 7.76 MB (8010806/8136664)
Download of ccsetup520.exe (7.76 MB) completed.
Installing ccleaner...
ccleaner has been installed.
Only an exit code of non-zero will fail the package by default. Set
 `--failonstderr` if you want error messages to also fail a script. See
 `choco -h` for details.
 The upgrade of ccleaner was successful.
  Software installed to 'C:\Program Files\CCleaner'

You have deluge v1.3.12.1 installed. Version 1.3.13 is available based on your source(s).

deluge v1.3.13 [Approved]
Downloading deluge
  from 'http://download.deluge-torrent.org/windows/deluge-1.3.13-win32-py2.7-0.exe'
Progress: 93% - Saving 14.08 MB of 15.22 MB (14766204/15955676)
Download of deluge-1.3.13-win32-py2.7-0.exe (15.22 MB) completed.
Hashes match.
Installing deluge...
deluge has been installed.
 The upgrade of deluge was successful.
  Software installed as 'exe', install location is likely default.

You have git.install v2.9.0 installed. Version 2.9.2 is available based on your source(s).

git.install v2.9.2 [Approved]
Downloading git.install 64 bit
  from 'https://github.com/git-for-windows/git/releases/download/v2.9.2.windows.1/Git-2.9.2-64-bit.exe'
Progress: 100% - Saving 31.17 MB of 31.21 MB (32684628/32729472)
Download of Git-2.9.2-64-bit.exe (31.21 MB) completed.
Installing git.install...
git.install has been installed.
WARNING: Git installed - You may need to close and reopen your shell for PATH changes to take effect.
 The upgrade of git.install was successful.
  Software installed to 'C:\Program Files\Git\'

Chocolatey upgraded 6/6 packages. 0 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Upgraded:
 - sysinternals v2016.07.04
 - deluge v1.3.13
 - ccleaner v5.20.5668
 - git.install v2.9.2
 - fiddler4 v4.6.2.29442
 - filezilla v3.19.0

Check out Pro / Business for more features! https://chocolatey.org/compare

Log for the second run:

PS C:\WINDOWS\system32> choco upgrade libreoffice -y --debug --verbose
Chocolatey is running on Windows v 10.0.10586.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 libreoffice -y --debug --verbose
Received arguments: upgrade libreoffice -y --debug --verbose
RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
Sending message 'PreRunMessage' out if there are subscribers...
[Pending] Removing all pending packages that should not be considered installed...
The source 'https://chocolatey.org/api/v2/' 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: CommandName='upgrade'|
CacheLocation='C:\Users\Bastian\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://chocolatey.org/api/v2/'|SourceType='normal'|
Debug='True'|Verbose='True'|Force='False'|Noop='False'|
HelpRequested='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='False'|AcceptLicense='True'|
AllowUnofficialBuild='False'|Input='libreoffice'|AllVersions='False'|
SkipPackageInstallProvider='False'|PackageNames='libreoffice'|
Prerelease='False'|ForceX86='False'|OverrideArguments='False'|
NotSilent='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.10586.0'|
Information.PlatformName='Windows'|
Information.ChocolateyVersion='0.9.10.3'|
Information.ChocolateyProductVersion='0.9.10.3'|
Information.FullName='choco, Version=0.9.10.3, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64Bit='True'|Information.IsInteractive='True'|
Information.IsUserAdministrator='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Features.AutoUninstaller='True'|
Features.CheckSumFiles='True'|Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseFipsCompliantChecksums='False'|
ListCommand.LocalOnly='False'|
ListCommand.IncludeRegistryPrograms='False'|ListCommand.PageSize='25'|
ListCommand.Exact='False'|ListCommand.ByIdOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
NewCommand.AutomaticPackage='False'|
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|FeatureCommand.Command='unknown'|
ConfigCommand.Command='unknown'|PinCommand.Command='unknown'|
_ Chocolatey:ChocolateyUpgradeCommand - Normal Run Mode _
Upgrading the following packages:
libreoffice
By upgrading you accept licenses for the packages.

You have libreoffice v5.1.3 installed. Version 5.1.4 is available based on your source(s).
Backing up existing libreoffice prior to upgrade.
Moving 'C:\ProgramData\chocolatey\lib\libreoffice'
 to 'C:\ProgramData\chocolatey\lib-bkp\libreoffice'
Attempting to create directory "C:\ProgramData\chocolatey\lib\libreoffice".
Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\libreoffice\libreoffice.nupkg"
 to "C:\ProgramData\chocolatey\lib\libreoffice\libreoffice.nupkg".
Attempting to create directory "C:\ProgramData\chocolatey\lib\libreoffice\tools".
Attempting to copy "C:\ProgramData\chocolatey\lib-bkp\libreoffice\tools\chocolateyInstall.ps1"
 to "C:\ProgramData\chocolatey\lib\libreoffice\tools\chocolateyInstall.ps1".
Capturing package files in 'C:\ProgramData\chocolatey\lib\libreoffice'
 Found 'C:\ProgramData\chocolatey\lib\libreoffice\libreoffice.nupkg'
  with checksum '7F594C27F6F9A51841CB72C0D72E1874'
 Found 'C:\ProgramData\chocolatey\lib\libreoffice\tools\chocolateyInstall.ps1'
  with checksum '6EE1623ED55874E0C84635B364B61308'
[NuGet] Uninstalling 'libreoffice 5.1.3'.
[NuGet] Removed file 'chocolateyInstall.ps1' to folder 'C:\ProgramData\chocolatey\lib\libreoffice\tools'.
[NuGet] Removed folder 'C:\ProgramData\chocolatey\lib\libreoffice\tools'.
[NuGet] Removed file 'libreoffice.nupkg' to folder 'C:\ProgramData\chocolatey\lib\libreoffice'.
[NuGet] Removed folder 'C:\ProgramData\chocolatey\lib\libreoffice'.
[NuGet] Successfully uninstalled 'libreoffice 5.1.3'.
[NuGet] Installing 'libreoffice 5.1.4'.
[NuGet] Added file 'chocolateyInstall.ps1' to folder 'libreoffice\tools'.
[NuGet] Added file 'libreoffice.nuspec' to folder 'libreoffice'.
[NuGet] Added file 'libreoffice.nupkg' to folder 'libreoffice'.
[NuGet] Successfully installed 'libreoffice 5.1.4'.

libreoffice v5.1.4 [Approved]
Setting installer args and package parameters for libreoffice
Contents of 'C:\ProgramData\chocolatey\lib\libreoffice\tools\chocolateyInstall.ps1':
# Important: The contents of this file - the `libreoffice` and
# `libreoffice-oldstable` install scripts - **must** be identical.

$packageName = 'libreoffice'
$version = '5.1.4'
$url32 = 'https://download.documentfoundation.org/libreoffice/stable/5.1.4/win/x86/LibreOffice_5.1.4_Win_x86.msi'
$url64 = 'https://download.documentfoundation.org/libreoffice/stable/5.1.4/win/x86_64/LibreOffice_5.1.4_Win_x64.msi'
$validExitCodes = @(0,3010)

# Check if LibreOffice in the same version is already installed
$alreadyInstalled = Get-WmiObject -Class Win32_Product | Where-Object {
  ($_.Name -match '^LibreOffice [\d\.]+$') -and ($_.Version -match "^$version")
}

if ($alreadyInstalled) {

  Write-Output $(
    "LibreOffice $version is already installed on the computer. " +
    "Skipping download."
  )

  if ((Get-ProcessorBits 64) -and $url64) {

    Write-Output $(
      "Do you already have LibreOffice $version 32-bit installed " +
      "and want to switch to 64-bit? " +
      "In that case you have to manually uninstall the 32-bit version " +
      "and reinstall this package."
    )
  }

} else {

  if ($url64) {
    Install-ChocolateyPackage $packageName 'msi' '/passive /norestart' `
      $url32 $url64 -validExitCodes $validExitCodes
  } else {
    Install-ChocolateyPackage $packageName 'msi' '/passive /norestart' `
      $url32 -validExitCodes $validExitCodes
  }
}

Calling built-in PowerShell host with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.T
hread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstalle
r.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\
libreoffice\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters ''']
Redirecting System.Management.Automation.resources, Version=3.0.0.0, Culture=en-US, PublicKeyToken=31bf3856ad364e35, req
uested by ''
Attempting to load assembly System.Management.Automation.resources failed:
 Could not load file or assembly 'System.Management.Automation.resources, Version=5.0.0.0, Culture=en-US, PublicKeyToken
=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Attempting to load assembly System.Management.Automation.resources failed:
 Could not load file or assembly 'System.Management.Automation.resources, Version=4.0.0.0, Culture=en-US, PublicKeyToken
=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Attempting to load assembly System.Management.Automation.resources failed:
 Could not load file or assembly 'System.Management.Automation.resources, Version=3.0.0.0, Culture=en-US, PublicKeyToken
=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Attempting to load assembly System.Management.Automation.resources failed:
 Could not load file or assembly 'System.Management.Automation.resources, Version=1.0.0.0, Culture=en-US, PublicKeyToken
=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Host version is 5.0.10586.0, PowerShell Version is '5.0.10586.494' and CLR Version is '4.0.30319.42000'.
Loading community extensions
VERBOSE: Exporting function 'Format-FileSize'.
VERBOSE: Exporting function 'Get-ChecksumValid'.
VERBOSE: Exporting function 'Get-ChocolateyUnzip'.
VERBOSE: Exporting function 'Get-ChocolateyWebFile'.
VERBOSE: Exporting function 'Get-EnvironmentVariable'.
VERBOSE: Exporting function 'Get-EnvironmentVariableNames'.
VERBOSE: Exporting function 'Get-FtpFile'.
VERBOSE: Exporting function 'Get-OSArchitectureWidth'.
VERBOSE: Exporting function 'Get-ToolsLocation'.
VERBOSE: Exporting function 'Get-UACEnabled'.
VERBOSE: Exporting function 'Get-UninstallRegistryKey'.
VERBOSE: Exporting function 'Get-VirusCheckValid'.
VERBOSE: Exporting function 'Get-WebFile'.
VERBOSE: Exporting function 'Get-WebFileName'.
VERBOSE: Exporting function 'Get-WebHeaders'.
VERBOSE: Exporting function 'Install-BinFile'.
VERBOSE: Exporting function 'Install-ChocolateyDesktopLink'.
VERBOSE: Exporting function 'Install-ChocolateyEnvironmentVariable'.
VERBOSE: Exporting function 'Install-ChocolateyExplorerMenuItem'.
VERBOSE: Exporting function 'Install-ChocolateyFileAssociation'.
VERBOSE: Exporting function 'Install-ChocolateyInstallPackage'.
VERBOSE: Exporting function 'Install-ChocolateyPackage'.
VERBOSE: Exporting function 'Install-ChocolateyPath'.
VERBOSE: Exporting function 'Install-ChocolateyPinnedTaskBarItem'.
VERBOSE: Exporting function 'Install-ChocolateyPowershellCommand'.
VERBOSE: Exporting function 'Install-ChocolateyShortcut'.
VERBOSE: Exporting function 'Install-ChocolateyVsixPackage'.
VERBOSE: Exporting function 'Install-ChocolateyZipPackage'.
VERBOSE: Exporting function 'Install-Vsix'.
VERBOSE: Exporting function 'Set-EnvironmentVariable'.
VERBOSE: Exporting function 'Set-PowerShellExitCode'.
VERBOSE: Exporting function 'Start-ChocolateyProcessAsAdmin'.
VERBOSE: Exporting function 'Test-ProcessAdminRights'.
VERBOSE: Exporting function 'Uninstall-BinFile'.
VERBOSE: Exporting function 'Uninstall-ChocolateyEnvironmentVariable'.
VERBOSE: Exporting function 'Uninstall-ChocolateyPackage'.
VERBOSE: Exporting function 'Uninstall-ChocolateyZipPackage'.
VERBOSE: Exporting function 'Update-SessionEnvironment'.
VERBOSE: Exporting function 'Write-ChocolateyFailure'.
VERBOSE: Exporting function 'Write-ChocolateySuccess'.
VERBOSE: Exporting function 'Write-FileUpdateLog'.
VERBOSE: Exporting alias 'Get-ProcessorBits'.
VERBOSE: Exporting alias 'Get-InstallRegistryKey'.
VERBOSE: Exporting alias 'Generate-BinFile'.
VERBOSE: Exporting alias 'Add-BinFile'.
VERBOSE: Exporting alias 'Remove-BinFile'.
VERBOSE: Exporting alias 'refreshenv'.
VERBOSE: Importing function 'Format-FileSize'.
VERBOSE: Importing function 'Get-ChecksumValid'.
VERBOSE: Importing function 'Get-ChocolateyUnzip'.
VERBOSE: Importing function 'Get-ChocolateyWebFile'.
VERBOSE: Importing function 'Get-EnvironmentVariable'.
VERBOSE: Importing function 'Get-EnvironmentVariableNames'.
VERBOSE: Importing function 'Get-FtpFile'.
VERBOSE: Importing function 'Get-OSArchitectureWidth'.
VERBOSE: Importing function 'Get-ToolsLocation'.
VERBOSE: Importing function 'Get-UACEnabled'.
VERBOSE: Importing function 'Get-UninstallRegistryKey'.
VERBOSE: Importing function 'Get-VirusCheckValid'.
VERBOSE: Importing function 'Get-WebFile'.
VERBOSE: Importing function 'Get-WebFileName'.
VERBOSE: Importing function 'Get-WebHeaders'.
VERBOSE: Importing function 'Install-BinFile'.
VERBOSE: Importing function 'Install-ChocolateyDesktopLink'.
VERBOSE: Importing function 'Install-ChocolateyEnvironmentVariable'.
VERBOSE: Importing function 'Install-ChocolateyExplorerMenuItem'.
VERBOSE: Importing function 'Install-ChocolateyFileAssociation'.
VERBOSE: Importing function 'Install-ChocolateyInstallPackage'.
VERBOSE: Importing function 'Install-ChocolateyPackage'.
VERBOSE: Importing function 'Install-ChocolateyPath'.
VERBOSE: Importing function 'Install-ChocolateyPinnedTaskBarItem'.
VERBOSE: Importing function 'Install-ChocolateyPowershellCommand'.
VERBOSE: Importing function 'Install-ChocolateyShortcut'.
VERBOSE: Importing function 'Install-ChocolateyVsixPackage'.
VERBOSE: Importing function 'Install-ChocolateyZipPackage'.
VERBOSE: Importing function 'Install-Vsix'.
VERBOSE: Importing function 'Set-EnvironmentVariable'.
VERBOSE: Importing function 'Set-PowerShellExitCode'.
VERBOSE: Importing function 'Start-ChocolateyProcessAsAdmin'.
VERBOSE: Importing function 'Test-ProcessAdminRights'.
VERBOSE: Importing function 'Uninstall-BinFile'.
VERBOSE: Importing function 'Uninstall-ChocolateyEnvironmentVariable'.
VERBOSE: Importing function 'Uninstall-ChocolateyPackage'.
VERBOSE: Importing function 'Uninstall-ChocolateyZipPackage'.
VERBOSE: Importing function 'Update-SessionEnvironment'.
VERBOSE: Importing function 'Write-ChocolateyFailure'.
VERBOSE: Importing function 'Write-ChocolateySuccess'.
VERBOSE: Importing function 'Write-FileUpdateLog'.
VERBOSE: Importing alias 'Add-BinFile'.
VERBOSE: Importing alias 'Generate-BinFile'.
VERBOSE: Importing alias 'Get-InstallRegistryKey'.
VERBOSE: Importing alias 'Get-ProcessorBits'.
VERBOSE: Importing alias 'refreshenv'.
VERBOSE: Importing alias 'Remove-BinFile'.
Running 'ChocolateyScriptRunner' for libreoffice v5.1.4 with packageScript 'C:\ProgramData\chocolatey\lib\libreoffice\to
ols\chocolateyInstall.ps1', packageFolder:'C:\ProgramData\chocolatey\lib\libreoffice', installArguments: '', packagePara
meters: '',
Running 'C:\ProgramData\chocolatey\lib\libreoffice\tools\chocolateyInstall.ps1'
Running 'Install-ChocolateyPackage' for libreoffice with url:'https://download.documentfoundation.org/libreoffice/stable
/5.1.4/win/x86/LibreOffice_5.1.4_Win_x86.msi', args: '/passive /norestart', fileType: 'msi', url64bit: 'https://download
.documentfoundation.org/libreoffice/stable/5.1.4/win/x86_64/LibreOffice_5.1.4_Win_x64.msi', checksum: '', checksumType:
'', checksum64: '', checksumType64: '', validExitCodes: '0 3010'
Running 'Get-ChocolateyWebFile' for libreoffice with url:'https://download.documentfoundation.org/libreoffice/stable/5.1
.4/win/x86/LibreOffice_5.1.4_Win_x86.msi', fileFullPath:'C:\Users\Bastian\AppData\Local\Temp\chocolatey\libreoffice\5.1.
4\libreofficeInstall.msi', url64bit:'https://download.documentfoundation.org/libreoffice/stable/5.1.4/win/x86_64/LibreOf
fice_5.1.4_Win_x64.msi', checksum: '', checksumType: '', checksum64: '', checksumType64: ''
Running 'Get-OSArchitectureWidth'
CPU is 64 bit
Setting url to 'https://download.documentfoundation.org/libreoffice/stable/5.1.4/win/x86_64/LibreOffice_5.1.4_Win_x64.ms
i' and bitPackage to 64
Running 'Get-WebFileName' to determine name with url:'https://download.documentfoundation.org/libreoffice/stable/5.1.4/w
in/x86_64/LibreOffice_5.1.4_Win_x64.msi', defaultName:'libreofficeInstall.msi'
Using response url to determine file name. 'http://mirror.dkm.cz/tdf/libreoffice/stable/5.1.4/win/x86_64/LibreOffice_5.1
.4_Win_x64.msi'
File name determined from url is 'LibreOffice_5.1.4_Win_x64.msi'
Running 'Get-WebHeaders' with url:'https://download.documentfoundation.org/libreoffice/stable/5.1.4/win/x86_64/LibreOffi
ce_5.1.4_Win_x64.msi', userAgent: 'chocolatey command line'
Setting the UserAgent to 'chocolatey command line'
Request Headers:
  'Accept':'*/*'
  'User-Agent':'chocolatey command line'
Response Headers:
  'Connection':'keep-alive'
  'X-debug-message':'/tdf/libreoffice/stable/5.1.4/win/x86_64/LibreOffice_5.1.4_Win_x64.msi'
  'Accept-Ranges':'bytes'
  'Content-Length':'249442304'
  'Content-Type':'application/octet-stream'
  'Date':'Fri, 22 Jul 2016 19:58:04 GMT'
  'ETag':'"5761cda6-ede3000"'
  'Last-Modified':'Wed, 15 Jun 2016 21:50:30 GMT'
  'Server':'nginx/1.6.2'
Downloading libreoffice 64 bit
  from 'https://download.documentfoundation.org/libreoffice/stable/5.1.4/win/x86_64/LibreOffice_5.1.4_Win_x64.msi'
Running 'Get-WebFile' for C:\Users\Bastian\AppData\Local\Temp\chocolatey\libreoffice\5.1.4\LibreOffice_5.1.4_Win_x64.msi
 with url:'https://download.documentfoundation.org/libreoffice/stable/5.1.4/win/x86_64/LibreOffice_5.1.4_Win_x64.msi', u
serAgent: 'chocolatey command line'
Setting request timeout to  30000
Setting read/write timeout to  2700000
Setting the UserAgent to 'chocolatey command line'
Downloading https://download.documentfoundation.org/libreoffice/stable/5.1.4/win/x86_64/LibreOffice_5.1.4_Win_x64.msi to
 C:\Users\Bastian\AppData\Local\Temp\chocolatey\libreoffice\5.1.4\LibreOffice_5.1.4_Win_x64.msi
Progress: 100% - Saving 237.46 MB of 237.89 MB (248993889/249442304)
Download of LibreOffice_5.1.4_Win_x64.msi (237.89 MB) completed.
No virus checking built into FOSS Chocolatey. Check out Pro or Business if you need this. https://chocolatey.org/compare

Checking that 'C:\Users\Bastian\AppData\Local\Temp\chocolatey\libreoffice\5.1.4\LibreOffice_5.1.4_Win_x64.msi' is the si
ze we expect it to be.
Verifying package provided checksum of '' for 'C:\Users\Bastian\AppData\Local\Temp\chocolatey\libreoffice\5.1.4\LibreOff
ice_5.1.4_Win_x64.msi'.
Running 'Get-ChecksumValid' with file:'C:\Users\Bastian\AppData\Local\Temp\chocolatey\libreoffice\5.1.4\LibreOffice_5.1.
4_Win_x64.msi', checksum: '', checksumType: ''
Running 'Install-ChocolateyInstallPackage' for libreoffice with file:'C:\Users\Bastian\AppData\Local\Temp\chocolatey\lib
reoffice\5.1.4\LibreOffice_5.1.4_Win_x64.msi', args: '/passive /norestart', fileType: 'msi', validExitCodes: '0 3010', u
seOnlyPackageSilentArguments: 'False'
Installing libreoffice...
Running 'Start-ChocolateyProcessAsAdmin' with exeToRun:'C:\WINDOWS\System32\msiexec.exe', statements: '/i "C:\Users\Bast
ian\AppData\Local\Temp\chocolatey\libreoffice\5.1.4\LibreOffice_5.1.4_Win_x64.msi" /passive /norestart '
Elevating Permissions and running ["C:\WINDOWS\System32\msiexec.exe" /i "C:\Users\Bastian\AppData\Local\Temp\chocolatey\
libreoffice\5.1.4\LibreOffice_5.1.4_Win_x64.msi" /passive /norestart ]. This may take a while, depending on the statemen
ts.
Setting RunAs for elevation
Command ["C:\WINDOWS\System32\msiexec.exe" /i "C:\Users\Bastian\AppData\Local\Temp\chocolatey\libreoffice\5.1.4\LibreOff
ice_5.1.4_Win_x64.msi" /passive /norestart ] exited with '3010'.
Finishing 'Start-ChocolateyProcessAsAdmin'
libreoffice has been installed.
Built-in PowerShell host called with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Th
read]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller
.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\l
ibreoffice\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters '''] exited with '3010'.
Calling command ['"C:\WINDOWS\System32\shutdown.exe" /a']
Command ['"C:\WINDOWS\System32\shutdown.exe" /a'] exited with '1116'
Capturing package files in 'C:\ProgramData\chocolatey\lib\libreoffice'
 Found 'C:\ProgramData\chocolatey\lib\libreoffice\.chocolateyPending'
  with checksum '07D554D5E1684C21CD8797B1FA0A3840'
 Found 'C:\ProgramData\chocolatey\lib\libreoffice\libreoffice.nupkg'
  with checksum '9E77642D9434ABD2682FC38B792572A5'
 Found 'C:\ProgramData\chocolatey\lib\libreoffice\libreoffice.nuspec'
  with checksum '6482987579B71EC4CACCB289DC25E4CC'
 Found 'C:\ProgramData\chocolatey\lib\libreoffice\tools\chocolateyInstall.ps1'
  with checksum '62CA473B03CF73BAB94E990F04F14E84'
Attempting to create directory "C:\ProgramData\chocolatey\.chocolatey\libreoffice.5.1.4".
Attempting to copy "C:\ProgramData\chocolatey\.chocolatey\libreoffice.5.1.4\.registry.update"
 to "C:\ProgramData\chocolatey\.chocolatey\libreoffice.5.1.4\.registry".
Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\libreoffice.5.1.4\.registry.update".
Attempting to copy "C:\ProgramData\chocolatey\.chocolatey\libreoffice.5.1.4\.files.update"
 to "C:\ProgramData\chocolatey\.chocolatey\libreoffice.5.1.4\.files".
Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\libreoffice.5.1.4\.files.update".
Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\libreoffice.5.1.4\.sxs".
Attempting to delete file "C:\ProgramData\chocolatey\.chocolatey\libreoffice.5.1.4\.pin".
Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
Attempting to delete directory "C:\ProgramData\chocolatey\lib-bkp\libreoffice".
Attempting to delete file "C:\ProgramData\chocolatey\lib\libreoffice\.chocolateyPending".
 The upgrade of libreoffice was successful.
  Software installed to 'C:\Program Files\LibreOffice 5\'
Attempting to delete file "C:\Users\Bastian\AppData\Local\NuGet\Cache\libreoffice.5.1.4.nupkg".

Chocolatey upgraded 1/1 packages. 0 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Packages requiring reboot:
 - libreoffice (exit code 3010)

The recent package changes indicate a reboot is necessary.
 Please reboot at your earliest convenience.
Sending message 'PostRunMessage' out if there are subscribers...
Exiting with 3010
@ferventcoder
Copy link
Member

Chocolatey's log files capture verbose/debug output, so you can provide the output. :)

However I don't think we'll need it.

The numbers being off - it only displays progress every so many bytes, that's why you see 96% and then it is done. We probably need a better capture at true 100% to show the totals properly.

@bill-long
Copy link

I instrumented PoshHostUserInterface.WriteProgress() to see what was going on here. I discovered two issues that affected both the initial install and package upgrades.

First, in Get-WebFile.ps1, we have this at line 285:

if ($total -eq $goal) {
  Write-Progress "Completed download of $url." "Completed download of $fileName ($goalFormatted)." -id 0 -Completed
}

Unlike line 281, this one doesn't pass a -PercentComplete. This resulted in a hit on the -1 condition in WriteProgress(), which short-circuits the method and immediately exits. With instrumentation it looked like this:

Downloading git.install 64 bit
  from 'https://github.com/git-for-windows/git/releases/download/v2.8.1.windows.1/Git-2.8.1-64-bit.exe'
Progress: 100% - Saving 29.69 MB of 29.72 MB (31134280/31168480)
Percent: -1 StatusDesc: Completed download of C:\Users\bill\AppData\Local\Temp\chocolatey\git.install\2.8.1\Git-2.8.1-64-bit.exe (29.72 MB).
   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at chocolatey.infrastructure.powershell.PoshHostUserInterface.WriteProgress(Int64 sourceId, ProgressRecord record)
   at System.Management.Automation.Internal.Host.InternalHostUserInterface.WriteProgress(Int64 sourceId, ProgressRecord record)

After I changed Get-WebFile.ps1 to pass -PercentComplete 100 on line 285, we started skipping WriteProgress due to hasLoggedFinalProgress being true. My instrumented version showed:

Progress: 100% - Saving 29.59 MB of 29.72 MB (31026760/31168480)
Already complete! Not logging further progress.
   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at chocolatey.infrastructure.powershell.PoshHostUserInterface.WriteProgress(Int64 sourceId, ProgressRecord record)
   at System.Management.Automation.Internal.Host.InternalHostUserInterface.WriteProgress(Int64 sourceId, ProgressRecord record)

I completely removed the hasLoggedFinalProgress logic, and now the output looks like what I think was intended:

Downloading git.install 64 bit
  from 'https://github.com/git-for-windows/git/releases/download/v2.8.1.windows.1/Git-2.8.1-64-bit.exe'
Progress: 100% - Completed download of C:\Users\bill\AppData\Local\Temp\chocolatey\git.install\2.8.1\Git-2.8.1-64-bit.exe (29.72 MB).
Download of Git-2.8.1-64-bit.exe (29.72 MB) completed.

I'm not sure if that final progress logic was intended to defend against some other issue? Anyway, I'll go ahead and open a pull request and you can take a look.

@ferventcoder ferventcoder modified the milestones: 0.9.10.4, 0.9.10.x Jul 25, 2016
@ferventcoder ferventcoder self-assigned this Jul 25, 2016
@ferventcoder
Copy link
Member

@bill-long so am I hearing there is more than issue of just reporting then?

@bill-long
Copy link

No, it's just an issue of what gets reported. There are two scenarios that cause it to skip reporting the last bits of the file, even though it does actually complete. This affects both the install of new packages and upgrades of existing packages.

ferventcoder pushed a commit that referenced this issue Aug 3, 2016
Always pass -PercentComplete to Write-Progress, otherwise the output will
not be logged due to the -1 check. Because we can reach 100% when there
are a few bytes left to retrieve, allow further logging of progress even if
we reached 100%.

In Get-WebFile and Get-FtpFile, don't log completion until we read 0 bytes
from the stream. Also, when calculating the percentage, round down instead
of up so we don't log 100% until we are actually at 100%.
ferventcoder added a commit that referenced this issue Aug 3, 2016
* pr873:
  (GH-875) Pad progress output line to console width
  (GH-872) Fix: Download progress never reaches completion
ferventcoder added a commit that referenced this issue Aug 3, 2016
* stable:
  (GH-875) Pad progress output line to console width
  (GH-872) Fix: Download progress never reaches completion
@ferventcoder
Copy link
Member

Will be fixed in 0.9.10.4. Thanks @bill-long!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants