Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot update manifests with multiple installers with the same URL #377

Closed
filips123 opened this issue May 18, 2023 · 3 comments
Closed

Comments

@filips123
Copy link

Brief description of your issue

I have a package that is automatically updated using wingetcreate update from GitHub Actions. This worked fine, however, recently, the package manifest got updated to allow both per-user and per-machine installs (microsoft/winget-pkgs#103854). Because my installers support both scopes, this was done by duplicating an entry for each installer (there are two installers, one for 32-bit and one for 64-bit) and specifying each install scope once. So, there are now four installer entries with two different URLs.

This means that apparently the package cannot be updated with wingetcreate update anymore...

Steps to reproduce

First try, an existing command that was used for all previous versions:

VERSION=2.6.0
INSTALLER_64BIT="https://github.com/filips123/PWAsForFirefox/releases/download/v$VERSION/firefoxpwa-$VERSION-x86_64.msi"
INSTALLER_32BIT="https://github.com/filips123/PWAsForFirefox/releases/download/v$VERSION/firefoxpwa-$VERSION-x86.msi"

wingetcreate.exe update -s filips.FirefoxPWA -u $INSTALLER_64BIT $INSTALLER_32BIT -v $VERSION -t TEST

So, I tried to specify all four URLs in the same order as they are specified in the manifest:

VERSION=2.6.0
INSTALLER_64BIT="https://github.com/filips123/PWAsForFirefox/releases/download/v$VERSION/firefoxpwa-$VERSION-x86_64.msi"
INSTALLER_32BIT="https://github.com/filips123/PWAsForFirefox/releases/download/v$VERSION/firefoxpwa-$VERSION-x86.msi"

wingetcreate.exe update -s filips.FirefoxPWA -u $INSTALLER_64BIT $INSTALLER_32BIT $INSTALLER_64BIT $INSTALLER_32BIT -v $VERSION -t TEST

Expected behavior

wingetcreate update should upload all installers and create an updated manifest.

Actual behavior

wingetcreate update does not upload installers and create a manifest.

When only passing two (different) installer URLs (first command):

Retrieving latest manifest for filips.FirefoxPWA
Downloading and parsing: https://github.com/filips123/PWAsForFirefox/releases/download/v2.6.0/firefoxpwa-2.6.0-x86_64.msi...
Downloading and parsing: https://github.com/filips123/PWAsForFirefox/releases/download/v2.6.0/firefoxpwa-2.6.0-x86.msi...
The number of new installer packages must match the number of existing installer packages.

When passing all four installers URLs (second command):

Retrieving latest manifest for filips.FirefoxPWA
Downloading and parsing: https://github.com/filips123/PWAsForFirefox/releases/download/v2.6.0/firefoxpwa-2.6.0-x86_64.msi...
Downloading and parsing: https://github.com/filips123/PWAsForFirefox/releases/download/v2.6.0/firefoxpwa-2.6.0-x86.msi...
Downloading and parsing: https://github.com/filips123/PWAsForFirefox/releases/download/v2.6.0/firefoxpwa-2.6.0-x86_64.msi...
Downloading and parsing: https://github.com/filips123/PWAsForFirefox/releases/download/v2.6.0/firefoxpwa-2.6.0-x86.msi...
Each new installer URL must have a single match to an existing installer based on installer type and architecture. The following installers failed to match an existing installer:
No matches found for X64 Wix installer detected from url: https://github.com/filips123/PWAsForFirefox/releases/download/v2.6.0/firefoxpwa-2.6.0-x86_64.msi
No matches found for X86 Wix installer detected from url: https://github.com/filips123/PWAsForFirefox/releases/download/v2.6.0/firefoxpwa-2.6.0-x86.msi
No matches found for X64 Wix installer detected from url: https://github.com/filips123/PWAsForFirefox/releases/download/v2.6.0/firefoxpwa-2.6.0-x86_64.msi
No matches found for X86 Wix installer detected from url: https://github.com/filips123/PWAsForFirefox/releases/download/v2.6.0/firefoxpwa-2.6.0-x86.msi

Environment

[winget --info]
Windows Package Manager (Preview) v1.5.441-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.2965
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.20.441.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

User Settings: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled

[wingetcreate version]
WingetCreateCLI 1.2.5.0
Copyright (C) 2023 WingetCreateCLI
@mdanish-kh
Copy link
Contributor

mdanish-kh commented May 18, 2023

Fixed with the introduction of scope override syntax in PR #367

In the upcoming release of winget-create, you would be able to execute the following command to fulfill your requirement

wingetcreate.exe update -s filips.FirefoxPWA -u "$INSTALLER_64BIT|x64|machine" "$INSTALLER_32BIT|x86|machine" "$INSTALLER_64BIT|x64|user" "$INSTALLER_32BIT|x86|user" -v $VERSION -t TEST

@mdanish-kh
Copy link
Contributor

@filips123 This should be resolved in WinGet-Create 1.2.6.0 (although I understand your use case is no longer valid as the scopes were removed from the package)

@filips123
Copy link
Author

Yeah, I'll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants