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

Feature: Option to force lessmsi #4559

Open
se35710 opened this issue Dec 4, 2021 · 8 comments
Open

Feature: Option to force lessmsi #4559

se35710 opened this issue Dec 4, 2021 · 8 comments
Assignees

Comments

@se35710
Copy link
Contributor

se35710 commented Dec 4, 2021

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.

@se35710 se35710 changed the title feat(manifest): Option to force lessmsi Feature: Option to force lessmsi Dec 4, 2021
@rashil2000
Copy link
Member

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

@se35710
Copy link
Contributor Author

se35710 commented Dec 5, 2021

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.

Scoop/lib/decompress.ps1

Lines 199 to 205 in 59088a9

if ((get_config MSIEXTRACT_USE_LESSMSI)) {
$MsiPath = Get-HelperPath -Helper Lessmsi
$ArgList = @('x', "`"$Path`"", "`"$DestinationPath\\`"")
} else {
$MsiPath = 'msiexec.exe'
$ArgList = @('/a', "`"$Path`"", '/qn', "TARGETDIR=`"$DestinationPath\\SourceDir`"")
}

Of the Python manifests, only the python27.json and -beta manifests uses MSI, and if MSIEXTRACT_USE_LESSMSI is not configured, the normal msiexec.exe is 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
Copy link
Member

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

image

@se35710
Copy link
Contributor Author

se35710 commented Dec 5, 2021

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:

Scoop/lib/depends.ps1

Lines 64 to 66 in 37a8869

if($script -like '*Expand-MsiArchive *' -or $script -like '*extract_msi *') {
$deps += 'lessmsi'
}

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
Copy link
Member

HUMORCE commented Dec 5, 2021

lessmsi should be set as default msi extractor.

@se35710
Copy link
Contributor Author

se35710 commented Dec 5, 2021

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
Copy link

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:

  • if msi extraction with msiexec fails, scoop retries with lessmsi automatically
  • if msi extraction with msiexec fails, scoop prompts the user to retry with lessmsi

@rashil2000
Copy link
Member

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?

@se35710 se35710 self-assigned this Oct 18, 2024
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

No branches or pull requests

4 participants