microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
23.33k stars 1.45k forks source link

Problems with portable applications #3085

Open kdpuvvadi opened 1 year ago

kdpuvvadi commented 1 year ago

Brief description of your issue

Portable applications are causing issues while upgrade/uninstall or after uninstall try install

Steps to reproduce

Expected behavior

Uninstall/install/upgrade properly

Actual behavior

Environment

winget --info
Windows Package Manager (Preview) v1.5.441-preview
Windows: Windows.Desktop v10.0.19045.2728
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.20.441.0
kdpuvvadi commented 1 year ago

I think this actully same or similor https://github.com/microsoft/winget-cli/issues/4879

kdpuvvadi commented 1 year ago

Logs https://gist.github.com/kdpuvvadi/1d5f6caf02d50b59f875c160a20bebb7

BrandonWanHuanSheng commented 1 year ago

Aria2 also is having the same similar issue. My Iobit Uninstaller detected the registry key, Normally it does not happen when wsusoffline extracting the file. Those portable file can be moved easily.

Registry Item: HKEY_USERS\S-1-5-21-1158146169-1040333420-3374525446-1001\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\aria2.aria2_Microsoft.Winget.Source_8wekyb3d8bbwe\SymLInkPath Affected: This cause the portable folder to lock.

I add this HKEY_CURRENT_USER\Volatile Environment\aria2c causing cmd to pop up the variable. The cmd environment is associated in this registry HKEY_CURRENT_USER\Volatile Environment It can't be creating the new registry key.

BrandonWanHuanSheng commented 1 year ago

image Screenshot (93) Screenshot (94)

BrandonWanHuanSheng commented 1 year ago

This winget set the portable symlinkpath causing it to unable to delete portable program But I recommend to set portable path to the variable program if it is cmd.

BrandonWanHuanSheng commented 1 year ago

I remember some of the windows installation file does not have symlink path. This cause 7-zip to log the error when during extracting the file. Most likely, This windows installation file is set the symlink path while during the windows 10 setup. Also, you can't delete the windows directory because some file was locked by symlink path