-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
winget upgrade does not respect the scope used on installation #5099
Comments
Updating with the First installation
After updating
|
@litmowise that's a side effect of the issue described above. |
@JanDeDobbeleer Thank you, I know. |
This is a known issue with MSI / WiX installers where they would put uninstall entries in |
I was actually going to make an issue for this @denelon as I have this issue described with oh-my-posh as well as with other installations. I've been waiting until I had an example where I could submit to the Feedback Hub. However, this might extend further into an issue of Winget not respecting paths and custom install locations, even sometimes failing to install into a custom directory using winget commands as it will just default back the installers preferred default location. Will try and get an example soon! |
@mdanish-kh is there anything I can change to the installer to force the identification? |
Unfortunately, I don't think there's much you can do if you want to include both scopes in the manifest, unless you can tweak the user-scoped MSI installer to put the uninstall entries to Alternatives
|
#3011 (comment) or https://stackoverflow.com/questions/32273217/how-and-why-installation-per-user-manages-to-write-to-hklm may offer some more hints |
I should also mention that here you'll have to explicitly target the user scope installer, as by default WinGet will assume the current installation is so: |
@mdanish-kh shouldn't that also work without the |
@JanDeDobbeleer No - Scope is treated as a requirement (instead of a preference) to be matched in case of upgrade. If WinGet detects current installation as |
@mdanish-kh Tried
|
@Dilant same for me, this is a really annoying bug TBH. @mdanish-kh this issue has been open for almost 2 years and seems rather fundamental for a package manager to get right. I would expect that when using @denelon something we can do about this? I would be bummed to have to go back to the Inno installer simply because of this bug. |
I'll talk with the team about this "class" of issue today I'll put some notes over in: |
@denelon if there's something we can do installer side to facilitate the correct detection, let me know. Registry values can be set rather easily. That way it doesn't matter if the user installed using winget, upgraded manually etc... |
@JanDeDobbeleer yes, you should be able to get the installer to write the keys to HKCU for user and to HKLM for a system wide install. The package manifest would need to have two "installers" one with each scope. For an initial "install" flow, WinGet would default to "user" unless the scope was passed to WinGet. For the upgrade flow, WinGet would inspect the registry to run the upgrade flow appropriately afterwards to match the currently installed scope. |
@denelon I'm trying to hack this in, but even when adding the registry information to |
Brief description of your issue
When using winget install in a non-elevated terminal, the installation is done with
scope: user
. However, when using upgrade immediately after in the same terminal window, the scope is identified assystem
.Steps to reproduce
Install v27.17.0
Upgrade to latest
Expected behavior
It should also identify
Installer [Arm64,msi,User,] is current best choice
on upgrade.Actual behavior
It identifies
Installer [Arm64,msi,Machine,] is current best choice
.Full logs below.
WinGet-2024-12-28-17-26-54.424.log
WinGet-2024-12-28-17-24-39.755.log
Environment
The text was updated successfully, but these errors were encountered: