russellbanks / Komac

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

[Feature/Idea]: Better Way to Determine the Architecture of Installers #243

Closed CoolPlayLin closed 1 year ago

CoolPlayLin commented 1 year ago

What would you like to see changed/added?

Reason

Some software publishers may name installer in non-standard way. we cannot determine architecture of installer or determine in incorrect if we only analyze one installer. Just like these installers: image They were going to generate incorrect manifest:

Viable Solutions

It is possible to combine several installers to determine its schema, or to have the user specify the schema of an installer to resolve the issue

russellbanks commented 1 year ago

Komac gets the architecture from an installer by:

  1. Checking the URL for an architecture. As above that would be arm64 and ia32 (x86).
  2. If there is no architecture in the URL, check the binary.

One issue with this is that it's common for the binary of executables to be different to what the manufacturer says it is. For example, the installer binary saying it's x86 when the manufacturer says it's x64.

This becomes an issue with installer matching when using the --urls parameter because we have to match the information we have on the installer to the previous installers. In this case, the exe with no architecture is likely being identified as x86.

Related to #215

CoolPlayLin commented 1 year ago

@russellbanks What about let the user specify it?

russellbanks commented 1 year ago

This is for parameters specifically, which are usually used in automation where it cannot be provided. Also, this theoretically can be matched based on deduction, etc. I have been working on this in improve-installer-matching branch. This isn't perfect yet but currently produces a better result for Fndroid.ClashForWindows than current.

CoolPlayLin commented 1 year ago

@russellbanks What about let the user specify it?

Feels like the best solution (puts the onus on the user)

russellbanks commented 1 year ago

I've pushed a new update to the branch which fixes this issue. It takes into account whether the URL has a definite architecture in it or not. This produces the correct result for Fndroid.ClashForWindows. I want to make sure that this covers edge cases but otherwise this will be part of 1.9.0.

CoolPlayLin commented 1 year ago
CoolPlayLin commented 1 year ago

@russellbanks You could add dev or nightly channel so that users who like new feature will able to use the newest feature

russellbanks commented 1 year ago

@russellbanks You could add dev or nightly channel so that users who like new feature will able to use the newest feature

Nightly releases are available at https://github.com/russellbanks/Komac/releases/tag/nightly