ScoopInstaller / Scoop

A command-line installer for Windows.
https://scoop.sh
Other
21.33k stars 1.41k forks source link

Feature: Option to force lessmsi #4559

Open se35710 opened 2 years ago

se35710 commented 2 years ago

Some manifest require the usage of lessmsi to extract MSI-files, for example libreoffice-fresh in Extras and ojdkbuild-full in Java.

If everyone agrees, I'll add an extra boolean property lessmsi, with a default of false if not defined.

rashil2000 commented 2 years ago

Doesn't scoop automatically install lessmsi when it needs it, for example when installing python?

se35710 commented 2 years ago

Not that I am aware of, unless I am missing something. The logic in decompress.ps1 check only for MSIEXTRACT_USE_LESSMSI, and if its not enabled or false, msiexec.exe is run.

https://github.com/ScoopInstaller/Scoop/blob/59088a9f0094ecaa0c36793eef232b3af237a59b/lib/decompress.ps1#L199-L205

Of the Python manifests, only the python27.json and -beta manifests uses MSI, and if MSIEXTRACT_USE_LESSMSI is not configured, the normal msiexec.exeis run instead. Python 2.7 does under normal circumstances install with msiexec.exe.

Trying to work around the problem with pre_install will fail, since it is run after extraction. Adding notes to the manifest to help the user understand why the installation failed will not work, as it is only shown after a successful installation.

rashil2000 commented 2 years ago

Just did a fresh install of python, and MSIEXTRACT_USE_LESSMSI is unset - it seems to install lessmsi automatically:

image

se35710 commented 2 years ago

Looking again at the Python 3 manifests, I see that we use Expand-MsiArchive (for reference, see line 57 in python.json).

When that is the case, the dependency of lessmsi is pulled in:

https://github.com/ScoopInstaller/Scoop/blob/37a886947df6cfdc76ebede44af6d1f10d426ba1/lib/depends.ps1#L64-L66

However, lessmsi is never executed, unless MSIEXTRACT_USE_LESSMSI is set to True (see comment above).

Maybe this feature could be added to #3502? Maybe we could revive the old deprecated installer.type:msi, or installer.type:lessmsi.

HUMORCE commented 2 years ago

lessmsi should be set as default msi extractor.

se35710 commented 2 years ago

Not sure about that; msiexec is available by default, so it's only in a few manifests where msiexec do not work we need lessmsi.

JTBrinkmann commented 1 year ago

Same issue with azure-cli (related issue).

As it isn't entirely clear, I assume that @se35710 suggests a new option in the app manifests to force lessmsi.

possible alternatives:

rashil2000 commented 1 year ago

Same issue with azure-cli (related issue).

As it isn't entirely clear, I assume that @se35710 suggests a new option in the app manifests to force lessmsi.

Seems like a doable idea. The manifest can contain another field called lessmsi, similar to innounp, which will use LessMSI instead of MSIExec.

Would you like to work on it?