Created
July 31, 2025 17:34
-
-
Save rrmistry/49dadd099b85cf5c204ca6356c64e770 to your computer and use it in GitHub Desktop.
Setup Scoop with portable 7zip installer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Download lessmsi | |
| Invoke-WebRequest -Uri "https://github.com/activescott/lessmsi/releases/download/v2.7.3/lessmsi-v2.7.3.zip" -OutFile "lessmsi-v2.7.3.zip" -Verbose | |
| # Expand lessmsi | |
| Expand-Archive -Path "lessmsi-v2.7.3.zip" -Destination ".\lessmsi" -Force -Verbose | |
| # Get 7zip MSi installer | |
| Invoke-WebRequest -Uri "https://7-zip.org/a/7z2500-x64.msi" -OutFile "7z2500-x64.msi" -Verbose | |
| # Expand 7zip MSI installer to local folder | |
| & .\lessmsi\lessmsi.exe x "7z2500-x64.msi" | |
| # Copy extracted MSi files into local folder | |
| Copy-Item -Path ".\7z2500-x64\SourceDir\Files\7-Zip\*" -Destination ".\" -Recurse -Force -Verbose | |
| # # Set environment variable to make 7z accessible | |
| # [System.Environment]::SetEnvironmentVariable("PATH", [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::User) + ";$PWD;", [System.EnvironmentVariableTarget]::User) | |
| # [System.Environment]::SetEnvironmentVariable("PATH", [System.Environment]::GetEnvironmentVariable("PATH", [System.EnvironmentVariableTarget]::User) + ";$PWD;", [System.EnvironmentVariableTarget]::Process) | |
| # Configure scoop to use external 7zip | |
| scoop config 7ZIPEXTRACT_USE_EXTERNAL true | |
| scoop config user_lessmsi true | |
| scoop config use_external_7zip true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment