winget-create icon indicating copy to clipboard operation
winget-create copied to clipboard

wingetcreate doesn't support multiple nodes from single installer

Open dpprdan opened this issue 4 years ago • 7 comments

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

dpprdan avatar Sep 13 '21 15:09 dpprdan

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!

ryfu-msft avatar Sep 15 '21 22:09 ryfu-msft

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.

dpprdan avatar Oct 29 '21 07:10 dpprdan

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).

ldennington avatar Nov 03 '21 16:11 ldennington

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.

jedieaston avatar Nov 03 '21 18:11 jedieaston

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

ldennington avatar Nov 03 '21 19:11 ldennington

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?

jedieaston avatar Nov 03 '21 19:11 jedieaston

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.

ldennington avatar Nov 03 '21 20:11 ldennington