fullcourtdefense-cli 1.25.0 → 1.25.2
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/dist/commands/daemon.js +15 -3
- package/dist/version.json +1 -1
- package/package.json +1 -1
package/dist/commands/daemon.js
CHANGED
|
@@ -1528,22 +1528,34 @@ function startDaemonNowWindows(viaTask = false) {
|
|
|
1528
1528
|
}
|
|
1529
1529
|
}
|
|
1530
1530
|
catch { /* not running */ }
|
|
1531
|
-
if (viaTask) {
|
|
1531
|
+
if (viaTask && !windowsTaskRunsInteractive(TASK_NAME)) {
|
|
1532
1532
|
// Start through the scheduled task so the daemon runs with the task's
|
|
1533
1533
|
// LIMITED (non-elevated) token. Launching directly from an elevated MSI
|
|
1534
1534
|
// custom action would leave an elevated daemon that a normal-user CLI can
|
|
1535
1535
|
// never stop or supersede.
|
|
1536
|
+
//
|
|
1537
|
+
// ONLY when the task is windowless (S4U): starting an InteractiveToken
|
|
1538
|
+
// task runs node.exe on the interactive desktop, and since the daemon
|
|
1539
|
+
// never exits, that console window stays OPEN on the user's screen — the
|
|
1540
|
+
// "open console at the end of installation" customer complaint. Fresh
|
|
1541
|
+
// unelevated installs register InteractiveToken (S4U needs elevation), so
|
|
1542
|
+
// those take the hidden WMI path below instead; the MSI's SYSTEM-context
|
|
1543
|
+
// migration flips the task to S4U moments later, and every subsequent
|
|
1544
|
+
// task start is windowless. Elevation is not a concern here: when the
|
|
1545
|
+
// caller IS elevated, S4U registration succeeded and this branch is taken.
|
|
1536
1546
|
const run = (0, child_process_1.spawnSync)('schtasks', ['/Run', '/TN', TASK_NAME], { stdio: 'ignore', windowsHide: true, timeout: 20_000 });
|
|
1537
1547
|
if (run.status === 0)
|
|
1538
1548
|
return;
|
|
1539
1549
|
}
|
|
1540
1550
|
// WMI process creation escapes the MSI job object. Runs node.exe DIRECTLY —
|
|
1541
|
-
// no wscript/VBS (Defender's Commando.A!ml heuristic)
|
|
1551
|
+
// no wscript/VBS (Defender's Commando.A!ml heuristic). Win32_ProcessStartup
|
|
1552
|
+
// ShowWindow=0 (SW_HIDE) is REQUIRED: without it Win32_Process.Create gives
|
|
1553
|
+
// the console app a visible window on the interactive desktop.
|
|
1542
1554
|
const nodeEsc = process.execPath.replace(/'/g, "''");
|
|
1543
1555
|
const entryEsc = cliEntry().replace(/'/g, "''");
|
|
1544
1556
|
(0, child_process_1.spawnSync)('powershell', [
|
|
1545
1557
|
'-NoProfile', '-NonInteractive', '-Command',
|
|
1546
|
-
|
|
1558
|
+
`$si = New-CimInstance -ClassName Win32_ProcessStartup -ClientOnly -Property @{ ShowWindow = [uint16]0 }; Invoke-CimMethod -ClassName Win32_Process -MethodName Create -Arguments @{ CommandLine = ('\"' + '${nodeEsc}' + '\" \"' + '${entryEsc}' + '\" daemon'); ProcessStartupInformation = $si } | Out-Null`,
|
|
1547
1559
|
], { stdio: 'ignore', windowsHide: true, timeout: 20_000 });
|
|
1548
1560
|
}
|
|
1549
1561
|
function installWindows() {
|
package/dist/version.json
CHANGED