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
22.96k stars 1.43k forks source link

Allow versions to be defined by .exe metadata in manifest file #3134

Open JustMyGithub opened 1 year ago

JustMyGithub commented 1 year ago

Description of the new feature / enhancement

I suggest to allow manifestst to reference metadata of installed software. As mentioned in https://github.com/microsoft/winget-cli/issues/3133 not every tool has the proper registry value that winget seems to reference, however I noticed that often the installed applications .exe has metadata like "file version" or "product version". As users cannot select the patch for winget setups, it would be easy for a manifest developer to point to a .exe, define a metadata field like "product version" and thereby get the required information of the version currently installed.

Proposed technical implementation details

No response

Trenly commented 1 year ago

How would the location of the installed exe be determined? Many installers allow users to change the install location, and some even place the exe in non-standard locations by default.

What about when an installer creates multiple exe's? How would the correct one be determined?

I'm not saying that its impossible, but there are several challenges to overcome. The best practice is for publishers to update their installers to record the application version to the registry, but I know that isn’t possible in all cases.

JustMyGithub commented 1 year ago

How does winget know the path in registry? (the %something% in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\%something%\DisplayVersion) That just needs to be defined in the manifest.

For all setups on winget I have used, the setup was unattended - the user cannot change the path, so it is just the default path.

Trenly commented 1 year ago

How does winget know the path in registry? (the %something% in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall%something%\DisplayVersion) That just needs to be defined in the manifest.

Winget simply uses all the information in CurrentVersion\Uninstall to try and map to a package that is available from one or more of the users configured sources.

For all setups on winget I have used, the setup was unattended - the user cannot change the path, so it is just the default path.

Some packages in winget support use of -l to change the install location. Users can also specify -i for an interactive install. Or, they may have even installed the application outside of winget.