Skip to content
Open
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
4 changes: 4 additions & 0 deletions 7z_x64/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*
!.gitignore
!config.json
!install.ps1
11 changes: 11 additions & 0 deletions 7z_x64/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"download_url": "https://github.com/ip7z/7zip/releases/download/26.02/7z2602-x64.msi",
"file_name": "7z-x64.msi",
"install_cmd": "powershell",
"install_args": "-ExecutionPolicy Bypass -File @sw_path@\\install.ps1 -MsiPath @sw_path@\\@file_name@",
"install_dest": "client",
"install_time": {
"kit": "after",
"driver": "before"
}
}
34 changes: 34 additions & 0 deletions 7z_x64/install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
param(
[Parameter(Mandatory = $true)]
[String]$MsiPath
)

$ErrorActionPreference = 'Stop'

if (-not (Test-Path -LiteralPath $MsiPath)) {
throw "7z MSI not found: $MsiPath"
}

# Keep a copy for support_win_fs (elevate installer from virtiofs share).
$stageDir = 'C:\7-Zip'
New-Item -ItemType Directory -Force -Path $stageDir | Out-Null
Copy-Item -Force -LiteralPath $MsiPath -Destination (Join-Path $stageDir '7z-x64.msi')

$log = Join-Path $env:TEMP '7z-install.log'
$p = Start-Process -FilePath 'msiexec.exe' -Wait -PassThru -ArgumentList @(
'/i', $MsiPath,
'/l*v', $log,
'/qn',
'/norestart'
)

if ($p.ExitCode -ne 0 -and $p.ExitCode -ne 3010) {
throw "msiexec 7z failed: exit $($p.ExitCode) (log=$log)"
}

$sevenZipExe = 'C:\Program Files\7-Zip\7z.exe'
if (-not (Test-Path -LiteralPath $sevenZipExe)) {
throw "7z.exe missing after MSI install (expected $sevenZipExe, log=$log)"
}

Write-Output "PASS: 7z installed at $sevenZipExe; MSI staged at $stageDir\7z-x64.msi (msiexec exit $($p.ExitCode))"