Windows, 7-Zip: Check multiple program folders before giving up


The current code for finding 7-Zip contains a list of multiple source
folders, but it only checks whether the first folder is non-null for
whether it might hold 7-Zip. This means we do not search all the
folders.

This patch changes this logic to search all the possible program
folders in order to find 7-Zip. It also moves the logic for finding
7-Zip into a dedicated function.

This patch makes it easier to run this function on a local machine.

As a drive-by, we fix some quotation issues in how 7-zip is invoked
to allow filepaths that contain whitespaces.

Pick-to: 6.12
Change-Id: I0e9487f3a27d775545a0671238f9bfbc4fe03598
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
commiteb5b9a0dbc13b492d228ec5b0fac650333ddc874
parent397258285c82a49e73a9ae1fa0228a8f0cc1ad9f
authorNils Petter Skålerud <nils.petter.skalerud@qt.io>
committerNils Petter Skålerud <nils.petter.skalerud@qt.io>
commit timeSat, 26 Sep 2026 07:20:27 +0000