microsoft / winget-create

The Windows Package Manager Manifest Creator command-line tool (aka wingetcreate)
MIT License
489 stars 84 forks source link

wingetcreate update fails while there is a version number in the zip archive #414

Closed lonnywong closed 1 year ago

lonnywong commented 1 year ago

Brief description of your issue

The zip archive file tssh_0.1.8_windows_x86_64.zip having tssh_0.1.8_windows_x86_64\tssh.exe in it.

The version number 0.1.8 causes wingetcreate update to fail.

Steps to reproduce

wingetcreate update --urls `
https://github.com/trzsz/trzsz-ssh/releases/download/v0.1.8/tssh_0.1.8_windows_x86_64.zip `
https://github.com/trzsz/trzsz-ssh/releases/download/v0.1.8/tssh_0.1.8_windows_aarch64.zip `
https://github.com/trzsz/trzsz-ssh/releases/download/v0.1.8/tssh_0.1.8_windows_i386.zip `
--version 0.1.8 trzsz.tssh

Expected behavior

wingetcreate update success.

Actual behavior

Retrieving latest manifest for trzsz.tssh
Downloading and parsing: https://github.com/trzsz/trzsz-ssh/releases/download/v0.1.8/tssh_0.1.8_windows_x86_64.zip...
Nested installer not found in zip archive: tssh_0.1.7_windows_x86_64\tssh.exe

Environment

Windows Package Manager Manifest Creator v1.2.8.0
Windows Package Manager v1.5.1881
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.22621.1992
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.20.1881.0

Winget Directories
-------------------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages

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                        Enabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
ryfu-msft commented 1 year ago

@lonnywong,

It looks like the format of the zip installer changed from v0.1.7 to v0.1.8. When I download both, the v0.1.8 has an extra folder enclosing the nested installer. Wingetcreate uses the relative file path of the existing manifest (/tssh.exe) to try to locate the nested installer, but in this case it should be /tssh_0.1.7_windows_x86_64/tssh.exe (enclosing folder changes depending on the installer). As we currently have no way to override the relative file path, I would use the new command to create a new manifest with the correct relative filepath for this package. Then, in the future, the updates should work to point to the correct relative file path (assuming that the format of your zip does not change).

lonnywong commented 1 year ago

@ryfu-msft Thanks for your help.

mdanish-kh commented 1 year ago

Resolved in WinGet-Create 1.5.1.0 in PR #415

cc @denelon / @ryfu-msft if this can be marked as completed

lonnywong commented 1 year ago

@mdanish-kh Thanks.

wingetcreate 1.5.1.0 works.