Skip to content

Keep the previous exe or portable installer type on update - #2017

Open
russellbanks wants to merge 1 commit into
mainfrom
keep-exe-portable-type-on-update
Open

russellbanks wants to merge 1 commit into
mainfrom
keep-exe-portable-type-on-update

Conversation

@russellbanks

Copy link
Copy Markdown
Owner

Fixes #1992, where update changed InstallerType: exe to portable for Maxon.MaxonApp and Microsoft.WindowsAppRuntime.1.8.

Cause

An exe that isn't detected as Advanced Installer, Burn, Inno, NSIS or Squirrel gets its type from keywords in its OriginalFilename and FileDescription. If neither contains installer, setup, 7zs.sfx or 7zsd.sfx, it's treated as portable.

  • Maxon App's description is Maxon Self-Extracting Installer, and the keywords were matched case-sensitively.
  • Windows App Runtime's strings only contain Install.

update replaces the installers with the analyzed ones, and optimize() then moved the new portable to the root over the previous exe.

Changes

  • The keywords are matched ignoring case with AsciiExt::contains_ignore_ascii_case. This also applies to new and analyze.
  • On update, when an analyzed installer is exe or portable and the previous installer of the same architecture was too, the previous type is kept. A zip's nested installer type is handled the same way in carry_over_nested_installer.
  • previous_zip_installer is now a wrapper around a general previous_installer, which matches the architecture first and otherwise uses the only matching installer.

The rule applies to any exe or portable, not only to a type that was guessed. A detected Squirrel or Advanced Installer exe, or a portable NSIS installer, would keep a previous portable or exe if a package switched between them across versions. That seemed too unlikely to pass a "guessed" flag through Analyzer and the zip analysis.

Testing

  • New tests cover the previous type at the root and on the installer, matching by architecture, previous types that aren't exe or portable, detected types, and a zip's nested type.
  • Both commands from the issue now write InstallerType: exe with --dry-run.

new still guesses portable for the Windows App Runtime files, as there's no previous manifest to use.

A generic exe's type is guessed from keywords in its version info, which
were matched case-sensitively and missed descriptions such as "Maxon
Self-Extracting Installer". The keywords are now matched ignoring case.

As the guess can still be wrong, update keeps the previous installer's
type when both the new and previous types are exe or portable, and does
the same for a zip's nested installer type.

Fixes #1992

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: update switches InstallerType from exe to portable when the installer keyword check does not match

1 participant