From d01a7c53a34f6f8f87dc64da5d552af536900f09 Mon Sep 17 00:00:00 2001 From: Abhishek Rajput Date: Fri, 21 Aug 2026 05:49:13 -0400 Subject: [PATCH] Add 7z_x64 package for VirtIO-FS support_win_fs coverage. Installs 7-Zip x64 via install.ps1 with Start-Process -Wait and verifies C:\Program Files\7-Zip\7z.exe exists after install. Also stages the MSI under C:\7-Zip so functest support_win_fs can elevate the installer from the virtiofs share. Signed-off-by: Abhishek Rajput --- 7z_x64/.gitignore | 4 ++++ 7z_x64/config.json | 11 +++++++++++ 7z_x64/install.ps1 | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 7z_x64/.gitignore create mode 100644 7z_x64/config.json create mode 100644 7z_x64/install.ps1 diff --git a/7z_x64/.gitignore b/7z_x64/.gitignore new file mode 100644 index 0000000..353f58e --- /dev/null +++ b/7z_x64/.gitignore @@ -0,0 +1,4 @@ +* +!.gitignore +!config.json +!install.ps1 diff --git a/7z_x64/config.json b/7z_x64/config.json new file mode 100644 index 0000000..11d3e20 --- /dev/null +++ b/7z_x64/config.json @@ -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" + } +} diff --git a/7z_x64/install.ps1 b/7z_x64/install.ps1 new file mode 100644 index 0000000..9982e5b --- /dev/null +++ b/7z_x64/install.ps1 @@ -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))"