1 parent
41599fa82f
commit
0dd6bef715
12 files changed
+161
-64
No files matched your search
@@ -6,9 +6,9 @@
|
||||
# лаунчер запускается без окна и через 10 секунд ещё жив, а в логе нет ошибок
|
||||
# загрузки модулей.
|
||||
#
|
||||
# На Windows лаунчер берёт папку профиля у системы, а не из переменных окружения,
|
||||
# поэтому работает в настоящей %APPDATA%\BiLauncher учётной записи раннера. Если
|
||||
# её до запуска не было, скрипт убирает её за собой.
|
||||
# QDir::homePath() на Windows берёт профиль у системы и USERPROFILE не читает,
|
||||
# поэтому лаунчер запускается с BILAUNCHER_HOME на временную папку (см.
|
||||
# launcherpaths.h) — настоящая %APPDATA%\BiLauncher раннера не трогается.
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory = $true)][string]$Prefix,
|
||||
@@ -28,14 +28,17 @@ if (-not (Get-ChildItem (Join-Path $Prefix "bin\tls") -Filter "*.dll" -ErrorActi
|
||||
Fail "нет TLS-плагина (bin\tls) — лаунчер не сможет ходить по https"
|
||||
}
|
||||
|
||||
$profileRoot = Join-Path $env:APPDATA "BiLauncher"
|
||||
$existedBefore = Test-Path $profileRoot
|
||||
$realProfile = Join-Path $env:APPDATA "BiLauncher"
|
||||
$realExisted = Test-Path $realProfile
|
||||
|
||||
$log = Join-Path $env:TEMP ("bilauncher-smoke-" + [guid]::NewGuid().ToString("N"))
|
||||
$sandbox = Join-Path $env:TEMP ("bilauncher-smoke-" + [guid]::NewGuid().ToString("N"))
|
||||
$log = Join-Path $sandbox "log"
|
||||
New-Item -ItemType Directory -Force $log | Out-Null
|
||||
$stdout = Join-Path $log "stdout.log"
|
||||
$stderr = Join-Path $log "stderr.log"
|
||||
$profileRoot = Join-Path $sandbox "AppData\Roaming\BiLauncher"
|
||||
|
||||
$env:BILAUNCHER_HOME = $sandbox
|
||||
$env:QT_QPA_PLATFORM = "offscreen"
|
||||
$env:QT_FORCE_STDERR_LOGGING = "1"
|
||||
$env:QTWEBENGINE_CHROMIUM_FLAGS = "--disable-gpu"
|
||||
@@ -58,9 +61,9 @@ try {
|
||||
Fail "в логе ошибки загрузки модулей"
|
||||
}
|
||||
if (-not (Test-Path (Join-Path $profileRoot "settings.json"))) { Fail "лаунчер не создал $profileRoot\settings.json" }
|
||||
if (-not $realExisted -and (Test-Path $realProfile)) { Fail "лаунчер создал настоящую $realProfile мимо BILAUNCHER_HOME" }
|
||||
Write-Host "SMOKE OK: $bin"
|
||||
}
|
||||
finally {
|
||||
Remove-Item -Recurse -Force $log -ErrorAction SilentlyContinue
|
||||
if (-not $existedBefore) { Remove-Item -Recurse -Force $profileRoot -ErrorAction SilentlyContinue }
|
||||
Remove-Item -Recurse -Force $sandbox -ErrorAction SilentlyContinue
|
||||
}
|
||||
Reference in new issue
Block a user