fix: vendor wcf python deps for isolated profile
This commit is contained in:
@@ -2,6 +2,7 @@ $ErrorActionPreference = "Stop"
|
||||
|
||||
$Root = "C:\UniDesk\personal-wechat"
|
||||
$WcfRoot = Join-Path $Root "wcf\v39.5.2"
|
||||
$PythonSite = Join-Path $WcfRoot "python-site"
|
||||
$StateRoot = Join-Path $Root "wcf-state"
|
||||
$DataRoot = Join-Path $Root "data\profile"
|
||||
$AppData = Join-Path $DataRoot "AppData\Roaming"
|
||||
@@ -15,7 +16,7 @@ $Stdout = Join-Path $StateRoot "wcf-host.stdout.log"
|
||||
$Stderr = Join-Path $StateRoot "wcf-host.stderr.log"
|
||||
$Runner = Join-Path $StateRoot "wcf-host-runner.cmd"
|
||||
|
||||
New-Item -ItemType Directory -Force $StateRoot,$DataRoot,$AppData,$LocalAppData,$Documents,$TempRoot | Out-Null
|
||||
New-Item -ItemType Directory -Force $StateRoot,$DataRoot,$AppData,$LocalAppData,$Documents,$TempRoot,$PythonSite | Out-Null
|
||||
|
||||
function Get-WcfProcessByPidFile {
|
||||
if (!(Test-Path -LiteralPath $PidFile)) { return $null }
|
||||
@@ -53,11 +54,13 @@ Start-Sleep -Seconds 2
|
||||
|
||||
Remove-Item -Force (Join-Path $StateRoot "status.json") -ErrorAction SilentlyContinue
|
||||
Remove-Item -Force (Join-Path $WcfRoot "injector.log") -ErrorAction SilentlyContinue
|
||||
Remove-Item -Force $PidFile -ErrorAction SilentlyContinue
|
||||
|
||||
@"
|
||||
@echo off
|
||||
set WCF_COMMAND_PORT=10086
|
||||
set WCF_STATE_ROOT=$StateRoot
|
||||
set PYTHONPATH=$PythonSite
|
||||
set USERPROFILE=$DataRoot
|
||||
set APPDATA=$AppData
|
||||
set LOCALAPPDATA=$LocalAppData
|
||||
@@ -88,6 +91,7 @@ if (Test-Path -LiteralPath $PidFile) {
|
||||
stderr = $Stderr
|
||||
status = (Join-Path $StateRoot "status.json")
|
||||
dataRoot = $DataRoot
|
||||
pythonSite = $PythonSite
|
||||
appData = $AppData
|
||||
localAppData = $LocalAppData
|
||||
} | ConvertTo-Json -Depth 6
|
||||
|
||||
Reference in New Issue
Block a user