@geekbeer/minion 3.11.0 → 3.11.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/win/minion-cli.ps1 +36 -2
package/package.json
CHANGED
package/win/minion-cli.ps1
CHANGED
|
@@ -819,10 +819,23 @@ function Invoke-Setup {
|
|
|
819
819
|
}
|
|
820
820
|
|
|
821
821
|
if ($wslAvailable) {
|
|
822
|
+
# Grant target user read+execute access to the package directory
|
|
823
|
+
# so the schtask (running as target user) can access the entry script
|
|
824
|
+
if ($targetUserName -ne $env:USERNAME) {
|
|
825
|
+
try {
|
|
826
|
+
icacls $minionPkgDir /grant "${targetUserName}:(OI)(CI)RX" /T /Q 2>$null | Out-Null
|
|
827
|
+
Write-Detail "Granted $targetUserName read access to package directory"
|
|
828
|
+
} catch {
|
|
829
|
+
Write-Warn "Could not grant package directory access to $targetUserName"
|
|
830
|
+
}
|
|
831
|
+
}
|
|
822
832
|
Remove-ScheduledTaskSilent "MinionWSL"
|
|
823
833
|
$wslTR = "'$nodePath' '$wslServerJs'"
|
|
824
|
-
schtasks /Create /TN "MinionWSL" /TR $wslTR /SC ONLOGON /RL
|
|
825
|
-
Write-Detail "WSL session server registered as logon task (user
|
|
834
|
+
schtasks /Create /TN "MinionWSL" /TR $wslTR /SC ONLOGON /RU $targetUserName /RL LIMITED /F | Out-Null
|
|
835
|
+
Write-Detail "WSL session server registered as logon task (user: $targetUserName)"
|
|
836
|
+
# Start immediately (ONLOGON only triggers on next login)
|
|
837
|
+
schtasks /Run /TN "MinionWSL" 2>$null | Out-Null
|
|
838
|
+
Write-Detail "WSL session server started"
|
|
826
839
|
} else {
|
|
827
840
|
Write-Warn "WSL not detected. WSL session server not registered."
|
|
828
841
|
Write-Detail "Install WSL and re-run setup to enable WSL sessions."
|
|
@@ -1470,6 +1483,27 @@ function Invoke-Configure {
|
|
|
1470
1483
|
Write-Detail "minion-websockify started"
|
|
1471
1484
|
}
|
|
1472
1485
|
Start-MinionService
|
|
1486
|
+
# Start WSL session server if token exists (task was registered during setup)
|
|
1487
|
+
$wslTokenFile = Join-Path $DataDir '.wsl-session-token'
|
|
1488
|
+
if (Test-Path $wslTokenFile) {
|
|
1489
|
+
$wslAlreadyRunning = $false
|
|
1490
|
+
try {
|
|
1491
|
+
Invoke-RestMethod -Uri "http://127.0.0.1:7682/api/wsl/health" -TimeoutSec 2 -UseBasicParsing | Out-Null
|
|
1492
|
+
$wslAlreadyRunning = $true
|
|
1493
|
+
} catch {}
|
|
1494
|
+
if ($wslAlreadyRunning) {
|
|
1495
|
+
Write-Detail "WSL session server already running"
|
|
1496
|
+
} else {
|
|
1497
|
+
try {
|
|
1498
|
+
$wslServerJs = Join-Path $CliDir 'win\bin\wsl-session-entry.js'
|
|
1499
|
+
$wslNodePath = (Get-Command node).Source
|
|
1500
|
+
Start-Process -FilePath $wslNodePath -ArgumentList "`"$wslServerJs`"" -WindowStyle Hidden
|
|
1501
|
+
Write-Detail "WSL session server started"
|
|
1502
|
+
} catch {
|
|
1503
|
+
Write-Detail "WSL session server not started: $($_.Exception.Message)"
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1473
1507
|
|
|
1474
1508
|
# Health check
|
|
1475
1509
|
Write-Step $totalSteps $totalSteps "Health check..."
|