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

Multiple nested installers are handled improperly #371

Closed
mdanish-kh opened this issue May 10, 2023 · 1 comment
Closed

Multiple nested installers are handled improperly #371

mdanish-kh opened this issue May 10, 2023 · 1 comment

Comments

@mdanish-kh
Copy link
Contributor

mdanish-kh commented May 10, 2023

Brief description of your issue

The current master build has a very odd behavior in case of multiple nested installers where it prompts for PortableCommandAlias nestedInstallers.Count number of times and creates an incorrect manifest.
image

Even if you select separate architecture for each of the nested installer, the final manifest will contain only a single installer because of how winget-create handles nested installers in the code (if you change one property of a nested installer object, it'll get modified in all of them so the final architecture selected by the user will be propagated in all installers)

Steps to reproduce

  1. Select same architecture for all of the nested installers
  2. Select different architectures for all of the nested installers

Examples

From Microsoft.Sysinternals.ZoomIt (3 nested portables all with different architecture)

wingetcreate new https://download.sysinternals.com/files/ZoomIt.zip

From PyPy.PyPy.3.9 (4 nested portables all with same architecture)

wingetcreate new https://downloads.python.org/pypy/pypy3.9-v7.3.11-win64.zip

From yelosan.PH-UKL.TglgQRTY (17 nested installers of different InstallerTypes i.e., portable, MSI)

wingetcreate new https://codeberg.org/attachments/7adf84ee-84a4-41d7-adb0-9f2d4aa979d5

From Git.MinGit (two URLs, same arch for each URL)

wingetcreate new https://github.com/git-for-windows/git/releases/download/v2.40.1.windows.1/MinGit-2.40.1-64-bit.zip https://github.com/git-for-windows/git/releases/download/v2.40.1.windows.1/MinGit-2.40.1-32-bit.zip

Expected behavior

  1. User should be displayed name of nested installer entry in the prompt for Is this a portable package? and should be prompted once about PortableCommandAlias if applicable
  2. If you choose same architecture for any two of the nested portables from same InstallerUrl, the two nested installers should be combined into a single installer node in the manifest as:
- Architecture: <arch>
  InstallerType: zip
  InstallerUrl: <url>
  InstallerHash: <hash>
  NestedInstallerType: portable
  NestedInstallerFiles:
  - RelativeFilePath: <path_to_nested_installer_file1>
  - RelativeFilePath: <path_to_nested_installer_file2>
  1. If you select different architecture, multiple installer nodes should be created

Actual behavior

image

  1. User isn't shown which portable installer winget-create is asking them about and is prompted multiple times for PortableCommandAlias
  2. Manifest created with validation errors.
  3. All nested installers from a single URL have the same arch

Environment

wingetcreate 1.2.5.0 currently does not prompt the user asking to confirm whether the package is portable as it was added in PR #355 so I chose the master build for testing
@mdanish-kh
Copy link
Contributor Author

Resolved in #372

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