microsoft / microsoft/winget-pkgs

[Package Issue]: sharkdp.bat: Unable to remove Portable package as it has been modified

Open
#124,261 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue-Bug
Dominant language
No language data
Stars
11.1k
Forks
9.7k
Avg merge
1h 32m
Merged PRs (30d)
376

Description

Please confirm these before moving forward
  • I have searched for my issue and not found a work-in-progress/duplicate/resolved issue.
  • I have not been informed if the issue is resolved in a preview version of the winget client.
Category of the issue

Installation issue.

Brief description of your issue

I havesharkdp.bat 0.23.0 installed via WinGet. New version 0.24.0 is shown as available, but update fails due to the following error:

Unable to remove Portable package as it has been modified; to override this check use --force

I have not modified the package. Of course it is possible that something on my machine did that, but I would like to at least check here if this is common issue whose cause is on the WinGet packing side.

Workaround (that also checks that the problem does not happen for fresh install from 0.23.0 to 0.24.0) was:

winget uninstall --force sharkdp.bat
Remove-Item -Force -Recurse C:\Users\user.name\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\
winget install sharkdp.bat --version 0.23.0
winget upgrade sharkdp.bat
Steps to reproduce

I got into this as follows:

  1. Some time back: winget install sharkdp.bat
  2. In between, multiple times: winget upgrade --all, maybe upgrading the package
  3. Finally: winget upgrade --all
Actual behavior

Error as given in description.

Expected behavior

Package is upgraded.

Environment
Windows Package Manager v1.6.2771
Windows: Windows.Desktop v10.0.22621.2428
Package: Microsoft.DesktopAppInstaller v1.21.2771.0
Screenshots and Logs

Relevant log entry from failed winget upgrade --all:

2023-10-30 08:57:41.395 [CLI ] Found existing installer file at 'C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.24.0\bat-v0.24.0-x86_64-pc-windows-msvc.zip'. Verifying file hash.
2023-10-30 08:57:41.485 [CLI ] Existing installer file hash matches. Will use existing installer.
2023-10-30 08:57:41.485 [CLI ] Installer hash verified
2023-10-30 08:57:41.485 [CORE] Started applying motw to C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.24.0\bat-v0.24.0-x86_64-pc-windows-msvc.zip with zone: 2
2023-10-30 08:57:41.489 [CORE] Finished applying motw
2023-10-30 08:57:41.598 [CLI ] Extracting archive to: C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.24.0\extracted
2023-10-30 08:57:42.144 [CLI ] Successfully extracted archive
2023-10-30 08:57:42.258 [CLI ] Symlink target does not match ARP Entry. Expected:  Actual: C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc\bat.exe
2023-10-30 08:57:42.258 [CLI ] Portable file has been modified: C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Links\bat.exe
2023-10-30 08:57:42.258 [CLI ] Terminating context: 0x8a150057 at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\PortableFlow.cpp:104

Trying to winget uninstall sharkdp.bat was similar.

winget uninstall --force sharkdp.bat succeeds but leaves a folder behind:

2023-10-30 09:04:59.284 [CLI ] Found one app. App id: sharkdp.bat App name: bat
2023-10-30 09:04:59.413 [CLI ] Symlink target does not match ARP Entry. Expected:  Actual: C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc\bat.exe
2023-10-30 09:04:59.413 [CLI ] Portable file has been modified: C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Links\bat.exe
2023-10-30 09:04:59.413 [CLI ] Deleting portable symlink at: C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Links\bat.exe
2023-10-30 09:04:59.414 [CLI ] Unable to remove install directory as there are remaining files in: C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe
2023-10-30 09:04:59.415 [CORE] Install directory is not empty: C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Links
2023-10-30 09:04:59.415 [CLI ] PortableARPEntry deleted.
2023-10-30 09:04:59.418 [CLI ] Leaf command succeeded: root:uninstall

After that winget install sharkdp.bat --version 0.23.0 fails since a folder it needs is to available (leading to the delete-a-folder part in the workaround):

2023-10-30 09:05:21.600 [CLI ] Successfully renamed downloaded installer. Path: C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.23.0\bat-v0.23.0-x86_64-pc-windows-msvc.zip
2023-10-30 09:05:21.716 [CLI ] Extracting archive to: C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.23.0\extracted
2023-10-30 09:05:22.226 [CLI ] Successfully extracted archive
2023-10-30 09:05:22.348 [REPO] Creating new Portable Index with version [Latest] at 'C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe.db'
2023-10-30 09:05:22.349 [SQL ] Opening SQLite connection #9: 'C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe.db' [6, 0]
2023-10-30 09:05:22.368 [CORE] Renaming directory to: C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc
2023-10-30 09:05:22.370 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Filesystem.cpp(89)\WindowsPackageManager.dll!00007FFF86887F75: (caller: 00007FFF866C23F5) LogHr(1) tid(1cb4) 8007023E {Sovellusvirhe}

Poikkeus %s (0x    Msg:[std::exception: rename: Käyttö estetty.: "C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.23.0\extracted\bat-v0.23.0-x86_64-pc-windows-msvc", "C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc"] 

2023-10-30 09:05:22.371 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Filesystem.cpp(101)\WindowsPackageManager.dll!00007FFF86887FAC: (caller: 00007FFF866C23F5) LogHr(2) tid(1cb4) 8007023E {Sovellusvirhe}

Poikkeus %s (0x    Msg:[std::exception: rename: Käyttö estetty.: "C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.23.0\extracted\bat-v0.23.0-x86_64-pc-windows-msvc", "C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc"] 

2023-10-30 09:05:22.483 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Filesystem.cpp(112)\WindowsPackageManager.dll!00007FFF86887FE3: (caller: 00007FFF866C23F5) LogHr(3) tid(1cb4) 8007023E {Sovellusvirhe}

Poikkeus %s (0x    Msg:[std::exception: rename: Käyttö estetty.: "C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.23.0\extracted\bat-v0.23.0-x86_64-pc-windows-msvc", "C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc"] 

2023-10-30 09:05:22.591 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Filesystem.cpp(112)\WindowsPackageManager.dll!00007FFF86887FE3: (caller: 00007FFF866C23F5) LogHr(4) tid(1cb4) 8007023E {Sovellusvirhe}

Poikkeus %s (0x    Msg:[std::exception: rename: Käyttö estetty.: "C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.23.0\extracted\bat-v0.23.0-x86_64-pc-windows-msvc", "C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc"] 

2023-10-30 09:05:22.699 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Filesystem.cpp(112)\WindowsPackageManager.dll!00007FFF86887FE3: (caller: 00007FFF866C23F5) LogHr(5) tid(1cb4) 8007023E {Sovellusvirhe}

Poikkeus %s (0x    Msg:[std::exception: rename: Käyttö estetty.: "C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.23.0\extracted\bat-v0.23.0-x86_64-pc-windows-msvc", "C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc"] 

2023-10-30 09:05:22.806 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Filesystem.cpp(112)\WindowsPackageManager.dll!00007FFF86887FE3: (caller: 00007FFF866C23F5) LogHr(6) tid(1cb4) 8007023E {Sovellusvirhe}

Poikkeus %s (0x    Msg:[std::exception: rename: Käyttö estetty.: "C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.23.0\extracted\bat-v0.23.0-x86_64-pc-windows-msvc", "C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc"] 

2023-10-30 09:05:22.915 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Filesystem.cpp(112)\WindowsPackageManager.dll!00007FFF86887FE3: (caller: 00007FFF866C23F5) LogHr(7) tid(1cb4) 8007023E {Sovellusvirhe}

Poikkeus %s (0x    Msg:[std::exception: rename: Käyttö estetty.: "C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.23.0\extracted\bat-v0.23.0-x86_64-pc-windows-msvc", "C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc"] 

2023-10-30 09:05:22.916 [FAIL] D:\a\_work\1\s\external\pkg\src\AppInstallerCommonCore\Filesystem.cpp(127)\WindowsPackageManager.dll!00007FFF8688801A: (caller: 00007FFF866C23F5) LogHr(8) tid(1cb4) 8007023E {Sovellusvirhe}

Poikkeus %s (0x    Msg:[std::exception: remove: Hakemisto ei ole tyhjä.: "C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc"] 

2023-10-30 09:05:22.916 [CLI ] Caught std::exception: copy_file: K乴tö estetty.: "C:\Users\OTTO~1.URP\AppData\Local\Temp\WinGet\sharkdp.bat.0.23.0\extracted\bat-v0.23.0-x86_64-pc-windows-msvc", "C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc"
2023-10-30 09:05:22.917 [CLI ] Removing directory at C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\bat-v0.23.0-x86_64-pc-windows-msvc
2023-10-30 09:05:22.937 [REPO] Opening SQLite Index for ReadWrite at 'C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe.db'
2023-10-30 09:05:22.937 [SQL ] Opening SQLite connection #10: 'C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Packages\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe\sharkdp.bat_Microsoft.Winget.Source_8wekyb3d8bbwe.db' [2, 0]
2023-10-30 09:05:22.937 [REPO] Opened Portable Index with version [1.0], last write [2023-10-30 09:05:22.000]
2023-10-30 09:05:22.939 [CORE] Install directory is not empty: C:\Users\otto.urpelainen\AppData\Local\Microsoft\WinGet\Links
2023-10-30 09:05:22.939 [CLI ] PortableARPEntry deleted.
2023-10-30 09:05:22.939 [CLI ] Terminating context: 0x8a150057 at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\PortableFlow.cpp:115

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the upgrade and uninstall commands using the sharkdp.bat 0.23.0 to 0.24.0 scenario, then inspect the PortableFlow.cpp paths reported in the logs, especially around lines 104 and 115. Done means the existing portable package can be upgraded or removed without the false modified-package failure or leftover installation directory.

Written by the indexing model from the issue text.

Assessment

Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.