Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions bucket/7zip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"##": "TODO: Associations, context menu",
"version": "22.00",
"description": "File archiver with a high compression ratio",
"homepage": "https://www.7-zip.org",
"license": {
"identifier": "Freeware,LGPL-2.0-only,BSD-3-Clause",
"url": "https://www.7-zip.org/license.txt"
},
"architecture": {
"64bit": {
"url": "https://stor.shovel.ash258.com/7zip/7z2200-x64.zip",
"hash": "ad1f1b07cfa1d31f79faf2aa52796352608808d0dde1e0b1f3cb8e4dbac2d99f",
"extract_dir": "7z2200-x64"
},
"32bit": {
"url": "https://stor.shovel.ash258.com/7zip/7z2200.zip",
"hash": "7ff18a66f11dcd9cd0df9bf9632405c0b3abd3e22f358881b5f437f98eccdfe2",
"extract_dir": "7z2200"
},
"arm64": {
"url": "https://stor.shovel.ash258.com/7zip/7z2200-arm64.zip",
"hash": "451bb472c02681807fe17afced6ff5f1cade4960c44b53366aeea544d00d1aa8",
"extract_dir": "7z2200-arm64"
}
},
"bin": "7z.exe",
"shortcuts": [
[
"7zFM.exe",
"7-Zip"
]
],
"checkver": "\\s+([\\d.]+)\\s+\\(\\d+",
"autoupdate": {
"archive": true,
"architecture": {
"64bit": {
"url": "https://stor.shovel.ash258.com/7zip/7z${cleanVersion}-x64.zip",
"extract_dir": "7z${cleanVersion}-x64"
},
"32bit": {
"url": "https://stor.shovel.ash258.com/7zip/7z${cleanVersion}.zip",
"extract_dir": "7z${cleanVersion}"
},
"arm64": {
"url": "https://stor.shovel.ash258.com/7zip/7z${cleanVersion}-arm64.zip",
"extract_dir": "7z${cleanVersion}-arm64"
}
}
}
}
7 changes: 7 additions & 0 deletions support/7zip/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 7-zip repacked as zip

Zero dependency zip package of 7-zip mainly for NanoServer installations and use for Shovel installer.

All archives were built by [script](https://github.com/shovel-org/Base/main/support/7zip/repack.ps1) using 7zip.

Original site, source code and artifacts are available at <https://www.7-zip.org>
65 changes: 65 additions & 0 deletions support/7zip/repack.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/env pwsh
param([Parameter(Mandatory)] [String] $Version, [String] $ScpTarget)

$ProgressPreference = 'SilentlyContinue'

Start-Transcript "$PSScriptRoot/log.txt"

$_v = $Version -replace '\.'

# Download first all the files
@('', '-arm64', '-x64') | ForEach-Object {
$url = "https://www.7-zip.org/a/7z${_v}${_}.exe"
Write-Output "Downloading '$url'"
Invoke-WebRequest $url -OutFile (Join-Path $PSScriptRoot (($url -split '/')[-1]))
}

# Download source code
Write-Host 'Downloading source code'
Invoke-WebRequest "https://www.7-zip.org/a/7z${_v}-src.tar.xz" -OutFile "$PSScriptRoot/7z${_v}-src.tar.xz"

Set-Content "$PSScriptRoot/README.md" @'
# 7-zip repacked as zip

Zero dependency zip package of 7-zip mainly for NanoServer installations and use for Shovel installer.

All archives were built by [script](https://github.com/shovel-org/Base/main/support/7zip/repack.ps1) using 7zip.

Original site, source code and artifacts are available at <https://www.7-zip.org>
'@ -Encoding 'utf8'

$7zPath = (Get-Command -Name '7z' -CommandType 'Application').Source

# Extract original 7-zips
Get-ChildItem -LiteralPath $PSScriptRoot -Include '*.exe' -File | ForEach-Object {
$checksum = (Get-FileHash -LiteralPath $_.FullName -Algorithm 'SHA256').Hash

Write-Output "Original '$($_.Name)' checksum: $checksum"

& $7zPath x -y -o"$PSScriptRoot/$($_.BaseName)/" $_.FullName

Remove-Item -LiteralPath $_.FullName -Force -Recurse
}

# Create new zips
Get-ChildItem -LiteralPath $PSScriptRoot -Directory | ForEach-Object {
Write-Output "Repacking '$($_.BaseName).zip'"

Copy-Item "$PSScriptRoot/7z${_v}-src.tar.xz" $_.FullName
& $7zPath a "$PSScriptRoot/$($_.BaseName).zip" $_.FullName

$zipHash = (Get-FileHash -LiteralPath "$($_.FullName).zip" -Algorithm 'SHA256').Hash
Write-Output "New '$($_.BaseName).zip' checksum: $zipHash"

Remove-Item $_.Fullname -Force -Recurse
}

if ($ScpTarget) {
Write-Output 'Copying all required files to server'
scp "$PSScriptRoot/*" $ScpTarget

# Remove all temporary files
Get-ChildItem -LiteralPath $PSScriptRoot -Exclude '*.ps1', '*.txt', 'README.md' | Remove-Item -Force -Recurse
}

Stop-Transcript