@letitbexai_root/lexxit-automation-framework 1.0.6 → 1.0.8
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
CHANGED
|
@@ -117,6 +117,7 @@ Copy-Item -Path (Join-Path $PSScriptRoot "*.ps1") -Destination $permanentScripts
|
|
|
117
117
|
# -- 1. The lexxit-runner account --------------------------------------------
|
|
118
118
|
$securePwd = ConvertTo-SecureString $RunnerPassword -AsPlainText -Force
|
|
119
119
|
$existingUser = Get-LocalUser -Name $RunnerUsername -ErrorAction SilentlyContinue
|
|
120
|
+
$isNewRunnerAccount = -not $existingUser
|
|
120
121
|
if (-not $existingUser) {
|
|
121
122
|
Write-Host "[lexxit] Creating local user $RunnerUsername..."
|
|
122
123
|
# New-LocalUser's -Description has a hard 48-char cap (a SAM user-account
|
|
@@ -299,22 +300,18 @@ $msiArgs = @(
|
|
|
299
300
|
# hand-rolling that obfuscation wrong fails silently into the exact same
|
|
300
301
|
# "VNC authentication failed" this script already had to debug once.
|
|
301
302
|
"SET_PASSWORD=1", "VALUE_OF_PASSWORD=$VncPassword",
|
|
302
|
-
"SET_ALLOWLOOPBACK=1", "VALUE_OF_ALLOWLOOPBACK=1"
|
|
303
|
-
#
|
|
304
|
-
#
|
|
305
|
-
#
|
|
306
|
-
#
|
|
307
|
-
#
|
|
308
|
-
#
|
|
309
|
-
#
|
|
310
|
-
#
|
|
311
|
-
#
|
|
312
|
-
#
|
|
313
|
-
#
|
|
314
|
-
# every other property above) is guaranteed to re-apply every single
|
|
315
|
-
# time this script runs, install or reinstall alike. Confirmed the hard
|
|
316
|
-
# way: a real VM's live view broke from exactly this gap.
|
|
317
|
-
"REINSTALL=ALL", "REINSTALLMODE=vomus"
|
|
303
|
+
"SET_ALLOWLOOPBACK=1", "VALUE_OF_ALLOWLOOPBACK=1"
|
|
304
|
+
# Deliberately NO REINSTALL=ALL / REINSTALLMODE here. Both were tried
|
|
305
|
+
# (see git history) and are actively harmful alongside the uninstall
|
|
306
|
+
# above: REINSTALL=ALL means "reinstall the features that are already
|
|
307
|
+
# installed", and since the /x just removed them all, that resolves to
|
|
308
|
+
# "install nothing" - which SILENTLY OVERRIDES the ADDLOCAL=Server
|
|
309
|
+
# above. Proven from an MSI verbose log on a real VM: every component
|
|
310
|
+
# came out "Request: Null; Action: Null", with "Skipping action:
|
|
311
|
+
# RegService (condition is false)" / "Skipping action: StartService
|
|
312
|
+
# (condition is false)", and msiexec still exited 0 having installed
|
|
313
|
+
# nothing at all. The uninstall above is what guarantees a genuinely
|
|
314
|
+
# fresh install, so these flags bought nothing and broke everything.
|
|
318
315
|
)
|
|
319
316
|
$installResult = Start-Process msiexec.exe -ArgumentList $msiArgs -Wait -NoNewWindow -PassThru
|
|
320
317
|
if ($installResult.ExitCode -ne 0) {
|
|
@@ -477,3 +474,31 @@ Write-Host " Agent port: $AgentPort"
|
|
|
477
474
|
Write-Host " VNC port: 5900 (TightVNC, service mode)"
|
|
478
475
|
Write-Host " Scheduled task: $taskName (At log on of $RunnerUsername)"
|
|
479
476
|
Write-Host " NOT validated against a real Windows EC2 AMI yet - test every step above before relying on it in production."
|
|
477
|
+
|
|
478
|
+
# -- 11. Reboot once, automatically, if this is a brand-new runner account --
|
|
479
|
+
# AutoAdminLogon (both the registry fallback above and Sysinternals'
|
|
480
|
+
# autologon.exe) only takes effect at Windows's own boot-time logon prompt -
|
|
481
|
+
# neither can retroactively log an already-running Windows session into a
|
|
482
|
+
# different user. So on a first-time install, lexxit-runner has never
|
|
483
|
+
# actually had an interactive desktop session, which is why Live View (VNC)
|
|
484
|
+
# shows the Windows lock/login screen instead of a usable desktop, even
|
|
485
|
+
# though the agent task itself already reports healthy (confirmed on a real
|
|
486
|
+
# VM: Start-ScheduledTask against an "At log on" trigger for a user who has
|
|
487
|
+
# never logged on still manages to run something that answers /api/health,
|
|
488
|
+
# just not inside a real lexxit-runner desktop session - so the health
|
|
489
|
+
# check above is not a reliable signal that VNC will show anything useful).
|
|
490
|
+
# One automatic reboot here closes that gap completely: the VM comes back
|
|
491
|
+
# up with lexxit-runner already logged in for real, VNC shows its actual
|
|
492
|
+
# desktop, and this never needs a human to remember "oh, it needs a
|
|
493
|
+
# reboot" again. Skipped when lexxit-runner already existed (e.g. a
|
|
494
|
+
# version/password-only re-run on an already-live agent) - no reason to
|
|
495
|
+
# bounce a VM that's already working.
|
|
496
|
+
if ($isNewRunnerAccount) {
|
|
497
|
+
Write-Host ""
|
|
498
|
+
Write-Host "[lexxit] $RunnerUsername was just created, so this VM needs one reboot for its auto-logon to"
|
|
499
|
+
Write-Host " actually take effect - that's expected, not a failure. Rebooting now; give it a"
|
|
500
|
+
Write-Host " couple of minutes, then check Lexxit -> Administration -> VM Agents - Live View"
|
|
501
|
+
Write-Host " should show a real desktop instead of the lock screen once it's back."
|
|
502
|
+
Start-Sleep -Seconds 5
|
|
503
|
+
Restart-Computer -Force
|
|
504
|
+
}
|