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

ZIP Packages update autonomously but not in interactive mode #397

Closed
mdanish-kh opened this issue Jul 3, 2023 · 0 comments · Fixed by #398
Closed

ZIP Packages update autonomously but not in interactive mode #397

mdanish-kh opened this issue Jul 3, 2023 · 0 comments · Fixed by #398

Comments

@mdanish-kh
Copy link
Contributor

Brief description of your issue

Interactive update uses a call to ParsePackageAndUpdateInstallerNode() to Parse the InstallerType of an installer.

else if (!PackageParser.ParsePackageAndUpdateInstallerNode(installer, packageFile, url))

This uses the Vestris.ResourceLib to parse the installer and retrieve its InstallerType. For zip installers in interactive updates, this seem to throw a Win32 Exception and interactive update returns Failed to parse the package from [<InstallerUrl>] at:

rc.LoadFrom(path);
string installerType = rc.Manifest.DocumentElement
.GetElementsByTagName("description")
.Cast<XmlNode>()
.FirstOrDefault()?
.InnerText?
.Split(' ').First()
.ToLowerInvariant();

which is called from:

bool parseResult = ParseExeInstallerType(path, installer, newInstallers) ||
ParseMsix(path, installer, null, newInstallers) ||
ParseMsi(path, installer, null, newInstallers);

This is because the path passed to the ResourceLib is path to the ZIP archive ending in .zip and not the actual installer present in the archive.

Steps to reproduce

Unattended update: (Dummy version used to simulate update)

  1. Nested nullsoft
wingetcreate update Guru3D.Afterburner -v 18.0 --urls "https://download-eu2.guru3d.com/afterburner/[Guru3D.com]-MSIAfterburnerSetup465.zip"
  1. Nested MSI
wingetcreate update aluxnimm.outlookcaldavsynchronizer -v 18.0 --urls "https://github.com/aluxnimm/outlookcaldavsynchronizer/releases/download/v4.3.0/OutlookCalDavSynchronizer-4.3.0.zip"
  1. Nested Portable
wingetcreate update Hugo.Hugo -v 18.0 --urls "https://github.com/gohugoio/hugo/releases/download/v0.112.7/hugo_0.112.7_windows-amd64.zip" "https://github.com/gohugoio/hugo/releases/download/v0.112.7/hugo_0.112.7_windows-arm64.zip"
  1. Nested portable
wingetcreate update Istio.Istio -v 18.0 --urls "https://github.com/istio/istio/releases/download/1.17.3/istioctl-1.17.3-win.zip"

Notice they all succeed in autonomous update. Now try the same packages in interactive update i.e.,

wingetcreate update Guru3D.Afterburner -v 18.0 -i
wingetcreate update aluxnimm.outlookcaldavsynchronizer -v 18.0 -i
wingetcreate update Hugo.Hugo -v 18.0 -i
wingetcreate update Istio.Istio -v 18.0 -i

Expected behavior

Interactive update should succeed like the autonomous ones

Actual behavior

Interactive updates gives Failed to parse the package from [<InstallerUrl>] after downloading the package from URL.

Environment

Windows Package Manager Manifest Creator v1.2.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants