Files
inquiry_robot/deploy/_remote_install_poi412_verified.ps1
T

38 lines
1.7 KiB
PowerShell

# Force install local-built POI412 jar that contains QuoteTemplateController
$ErrorActionPreference = 'Stop'
$Src = 'C:\Users\ytd_extdev_0903\incoming\jeecg-system-start-3.5.3.POI412.jar'
$Incoming = 'C:\Users\ytd_extdev_0903\incoming\jeecg-system-start-3.5.3.jar'
$Fat = 'E:\wwwroot\inquiry-new\jeecg-system-start-3.5.3.jar'
$Expect = 170763133
if (-not (Test-Path $Src)) { throw "missing $Src" }
$len = (Get-Item $Src).Length
Write-Host ("src_bytes=" + $len)
if ($len -ne $Expect) { Write-Host ("WARN size expect=" + $Expect + " got=" + $len) }
$work = Join-Path $env:TEMP 'verify-qt-class'
if (Test-Path $work) { Remove-Item $work -Recurse -Force }
New-Item -ItemType Directory $work | Out-Null
$jarCmd = 'C:\yutongda\tools\jdk8\bin\jar.exe'
Push-Location $work
& $jarCmd xf $Src 'BOOT-INF/lib/jeecg-module-inquiry-3.5.3.jar'
$has = (& $jarCmd tf 'BOOT-INF/lib/jeecg-module-inquiry-3.5.3.jar' | Select-String 'InquiryQuoteTemplateController').Count
Write-Host ("src_has_QuoteTemplateController=" + ($has -gt 0))
if ($has -lt 1) { throw 'source jar missing QuoteTemplateController' }
Pop-Location
Get-CimInstance Win32_Process | ForEach-Object {
if ($_.CommandLine -and ($_.CommandLine -like '*inquiry-new*jeecg*' -or $_.CommandLine -like '*run-ledger*')) {
Write-Host ("killing=" + $_.ProcessId)
Stop-Process -Id $_.ProcessId -Force -ErrorAction SilentlyContinue
}
}
Start-Sleep -Seconds 3
Copy-Item $Src $Incoming -Force
Copy-Item $Src $Fat -Force
Write-Host ("fat_bytes=" + (Get-Item $Fat).Length)
Write-Host 'COPIED_POI412_VERIFIED'
powershell -NoProfile -ExecutionPolicy Bypass -File C:\Users\ytd_extdev_0903\incoming\_remote_wmi_start_ledger.ps1
Write-Host 'INSTALL_VERIFIED_DONE'