fix: package live probe recorder compatibility variants
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
param(
|
||||
param(
|
||||
[string]$OutputDir = "runs/live-probe-recorder-package",
|
||||
[switch]$NoZip
|
||||
)
|
||||
@@ -7,26 +7,54 @@ $ErrorActionPreference = "Stop"
|
||||
|
||||
$repo = Resolve-Path -LiteralPath (Join-Path $PSScriptRoot "..")
|
||||
$packageDir = Join-Path $repo $OutputDir
|
||||
$buildDir = Join-Path $repo "runs/live-probe-recorder-build"
|
||||
$helperExe = Join-Path $buildDir "ISphereWinHelper.exe"
|
||||
$buildRoot = Join-Path $repo "runs/live-probe-recorder-build"
|
||||
$buildX86Dir = Join-Path $repo "runs/live-probe-recorder-build-x86"
|
||||
$buildX64Dir = Join-Path $repo "runs/live-probe-recorder-build-x64"
|
||||
$helperExe = Join-Path $buildX86Dir "ISphereWinHelper.exe"
|
||||
$recorderExe = Join-Path $packageDir "ISphereLiveProbeRecorder.exe"
|
||||
$variantsDir = Join-Path $packageDir "variants"
|
||||
|
||||
if (Test-Path -LiteralPath $packageDir) {
|
||||
Remove-Item -LiteralPath $packageDir -Recurse -Force
|
||||
}
|
||||
if (Test-Path -LiteralPath "$packageDir.zip") {
|
||||
Remove-Item -LiteralPath "$packageDir.zip" -Force
|
||||
}
|
||||
New-Item -ItemType Directory -Force -Path $packageDir | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path $variantsDir | Out-Null
|
||||
|
||||
& powershell -NoProfile -ExecutionPolicy Bypass -File (Join-Path $repo "scripts\build-win-helper.ps1") -OutputDir "runs/live-probe-recorder-build"
|
||||
& powershell -NoProfile -ExecutionPolicy Bypass -File (Join-Path $repo "scripts\build-win-helper.ps1") -OutputDir "runs/live-probe-recorder-build-x86" -Platform x86
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "build-win-helper.ps1 failed with exit code $LASTEXITCODE"
|
||||
throw "build-win-helper.ps1 x86 failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
|
||||
if (-not (Test-Path -LiteralPath $helperExe)) {
|
||||
throw "built helper not found: $helperExe"
|
||||
throw "built x86 helper not found: $helperExe"
|
||||
}
|
||||
|
||||
Copy-Item -LiteralPath $helperExe -Destination $recorderExe -Force
|
||||
Copy-Item -LiteralPath $helperExe -Destination (Join-Path $variantsDir "ISphereLiveProbeRecorder-x86.exe") -Force
|
||||
|
||||
& powershell -NoProfile -ExecutionPolicy Bypass -File (Join-Path $repo "scripts\build-win-helper.ps1") -OutputDir "runs/live-probe-recorder-build" -Platform anycpu
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "build-win-helper.ps1 anycpu failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
Copy-Item -LiteralPath (Join-Path $buildRoot "ISphereWinHelper.exe") -Destination (Join-Path $variantsDir "ISphereLiveProbeRecorder-anycpu.exe") -Force
|
||||
|
||||
& powershell -NoProfile -ExecutionPolicy Bypass -File (Join-Path $repo "scripts\build-win-helper.ps1") -OutputDir "runs/live-probe-recorder-build-x64" -Platform x64
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "build-win-helper.ps1 x64 failed with exit code $LASTEXITCODE"
|
||||
}
|
||||
Copy-Item -LiteralPath (Join-Path $buildX64Dir "ISphereWinHelper.exe") -Destination (Join-Path $variantsDir "ISphereLiveProbeRecorder-x64.exe") -Force
|
||||
|
||||
@"
|
||||
ISphereLiveProbeRecorder
|
||||
|
||||
默认说明:
|
||||
- 顶层 ISphereLiveProbeRecorder.exe 是 x86 版,兼容性最好,建议优先用它。
|
||||
- variants 目录里保留 anycpu/x86/x64 备用版本。
|
||||
- 如果现场遇到 BadImageFormatException,请先确认解压后的 exe 大小和 hash,再运行 variants\ISphereLiveProbeRecorder-x86.exe。
|
||||
|
||||
使用方式:
|
||||
1. 把本目录复制到可以正常登录 iSphere/IMPlatformClient 的电脑。
|
||||
2. 先手工打开并登录 iSphere/IMPlatformClient。
|
||||
@@ -56,7 +84,7 @@ ISphereLiveProbeRecorder
|
||||
- 点击或输入;
|
||||
- 注入或 hook;
|
||||
- 修改客户端文件或数据。
|
||||
"@ | Set-Content -LiteralPath (Join-Path $packageDir "README-使用说明.txt") -Encoding UTF8
|
||||
"@ | Set-Content -LiteralPath (Join-Path $packageDir "README.txt") -Encoding UTF8
|
||||
|
||||
@"
|
||||
@echo off
|
||||
@@ -64,7 +92,34 @@ setlocal
|
||||
cd /d "%~dp0"
|
||||
ISphereLiveProbeRecorder.exe
|
||||
pause
|
||||
"@ | Set-Content -LiteralPath (Join-Path $packageDir "双击运行-采集.bat") -Encoding ASCII
|
||||
"@ | Set-Content -LiteralPath (Join-Path $packageDir "run-recorder.bat") -Encoding ASCII
|
||||
|
||||
@"
|
||||
@echo off
|
||||
setlocal
|
||||
cd /d "%~dp0"
|
||||
variants\ISphereLiveProbeRecorder-x86.exe
|
||||
pause
|
||||
"@ | Set-Content -LiteralPath (Join-Path $packageDir "run-x86-fallback.bat") -Encoding ASCII
|
||||
|
||||
@"
|
||||
@echo off
|
||||
setlocal
|
||||
cd /d "%~dp0"
|
||||
echo === Windows version ===
|
||||
ver
|
||||
echo.
|
||||
echo === File sizes ===
|
||||
dir ISphereLiveProbeRecorder.exe variants\ISphereLiveProbeRecorder-*.exe
|
||||
echo.
|
||||
echo === .NET Framework v4 runtime ===
|
||||
reg query "HKLM\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full" /v Release
|
||||
echo.
|
||||
echo === Try top-level recorder ===
|
||||
ISphereLiveProbeRecorder.exe --no-pause
|
||||
echo exit code: %ERRORLEVEL%
|
||||
pause
|
||||
"@ | Set-Content -LiteralPath (Join-Path $packageDir "check-and-run.bat") -Encoding ASCII
|
||||
|
||||
$zipPath = "$packageDir.zip"
|
||||
if (-not $NoZip) {
|
||||
@@ -78,5 +133,6 @@ if (-not $NoZip) {
|
||||
ok = $true
|
||||
package_dir = (Resolve-Path -LiteralPath $packageDir).Path
|
||||
recorder_exe = (Resolve-Path -LiteralPath $recorderExe).Path
|
||||
recorder_platform = "x86"
|
||||
zip = if (Test-Path -LiteralPath $zipPath) { (Resolve-Path -LiteralPath $zipPath).Path } else { $null }
|
||||
} | ConvertTo-Json -Depth 4 -Compress
|
||||
|
||||
Reference in New Issue
Block a user