russellbanks / Komac

The Community Manifest Creator for WinGet
GNU General Public License v3.0
213 stars 16 forks source link

[Bug]: Invalid Scope on package upgrade #709

Closed a-mnich closed 2 months ago

a-mnich commented 3 months ago

Is there an existing issue for this?

What happened?

In some cases the installer scope gets changed to an invalid one when performing a package upgrade which thean leads to a "No applicable upgrade found" situation.

E.g. in the latest Neovim upgrade the scope got changed from machine to user while the package actually only supports machine installation.

komac update Neovim.Neovim --version 0.10.1 --urls https://github.com/neovim/neovim/releases/download/v0.10.1/nvim-win64.msi
russellbanks commented 3 months ago

This is because the MSI data changed from being defined as a machine install scope to user install scope from neovim 0.10.0 to 0.10.1.

See ALLUSERS property documentation for reference.

neovim 0.10.0:

In neovim 0.10.0, there is an ALLUSERS value of 1 which defines a per-machine install scope.

An ALLUSERS property value of 1 specifies the per-machine installation context.

image

neovim 0.10.1:

In neovim 0.10.1, there is no ALLUSERS value. From Microsoft's documentation, if ALLUSERS is not specified, it defaults to an empty string "", which is defined as per-user installation.

An ALLUSERS property value of an empty string ("") specifies the per-user installation context.

If ALLUSERS is not set, the installer does a per-user installation.

image


I'm not sure whether this is intentional that the value was removed in neovim 0.10.1 but komac is correctly identifying the install scope from the MSI data as per the documentation.

a-mnich commented 3 months ago

Hi @russellbanks, Thanks a lot for the quick response and clarification! I will go ahead and open an issue in the Neovim repository.

Would you consider implementing a feature that detects "faulty installers" like this one? When a package has only one installer and it changes the scope, it’s likely that something is wrong. In such cases, a warning message or an option to completely exit the upgrade process could be helpful.

Unrelated: What tool did you use for the analysis of the installers with the provided screenshots? It looks quite handy to me.

russellbanks commented 3 months ago

Would you consider implementing a feature that detects "faulty installers" like this one? When a package has only one installer and it changes the scope, it’s likely that something is wrong. In such cases, a warning message or an option to completely exit the upgrade process could be helpful.

komac has some things like this already but I wouldn't have expected the ALLUSERS value to change so I can add something around that.

Unrelated: What tool did you use for the analysis of the installers with the provided screenshots? It looks quite handy to me.

Orca! The installer for it is in the Windows SDK.

russellbanks commented 2 months ago

https://github.com/neovim/neovim/issues/29885 is resolved.