wingetcreate doesn't support multiple nodes from single installer
Brief description of your issue
wingetcreate doesn't support multiple nodes from a single installer.
The PostgreSQL.pgAdmin v5.6 installer manifest for example contains two installer nodes with the same URL, one for user and machine scope each, as advised here.
When trying to update this manifest to the latest version, I get the error message "The number of new installer packages must match the number of existing installer packages.".
Steps to reproduce
Run the following to update the PostgreSQL.pgAdmin manifest to the latest version.
wingetcreate update PostgreSQL.pgAdmin --version 5.7 --urls https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v5.7/windows/pgadmin4-5.7-x64.exe
Expected behavior
Update the manifest to the latest version as specified.
Actual behavior
Error message: "The number of new installer packages must match the number of existing installer packages."
Environment
Windows Manifest Creator v0.3.0.6
Hey @dpprdan,
Thanks for filing this issue. We don't currently support updating multiple nodes from a single installer as it is not always clear which nodes should be updated with the new installer. However, we just published our newest release of Winget-Create v4.0.3.0 which has a new interactive feature for the update command. You can now manually input the installer url you want to update a given installer node with. Hopefully that resolves your issue.
Thanks!
The interactive flag solves this for my use-case above. It obviously doesn't for non-interactive ones (e.g. CI), so I am leaving this open.
FWIW I am also running into this issue with a CI scenario. Matching on Scope seems the most obvious choice for making this work, but unfortunately I haven't found a way to specify that when building my Inno installers.
My team is really trying to use wingetcreate so that we can move off our custom tooling for publishing to winget. However, if this particular issue isn't resolved it's hard for us to justify using winget at all (given all the modifications we'd now have to make to our custom tooling for the multi-file manifest).
It seems like wingetcreate could have a special case for this by checking if multiple of the same URL exist in the current manifest, then at least one of the installer URLs passed must be able to replace all of those.
Note that our URLs are slightly different (one uses the name gcmcoreuser and the other gcmcore). For example:
https://github.com/microsoft/Git-Credential-Manager-Core/releases/download/v2.0.567/gcmcore-win-x86-2.0.567.18224.exe https://github.com/microsoft/Git-Credential-Manager-Core/releases/download/v2.0.567/gcmcoreuser-win-x86-2.0.567.18224.exe
In the exe manifest (at least for Inno Setup, I don't know if everyone cleanly sets this), this key stuck out to me:
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
It determines whether the process is to be elevated. Couldn't we use this to determine scope?
I will admit, I'd only looked at the metadata in the .iss file when I came to that conclusion. I can investigate this - although of course it would require changes on the wingetcreate side to detect this and use it in the installer logic.