From 48123ed9ab25afd3b4cc7a44f90ddee14e4babeb Mon Sep 17 00:00:00 2001 From: Git Sagar Date: Mon, 8 Jun 2026 21:30:40 +0530 Subject: [PATCH] fix TSforge switch: /Z-Windows not /Z- Co-Authored-By: Claude Opus 4.6 (1M context) --- lib/images/windows/templates/essentials/windows-update.nix | 7 ++++--- lib/images/windows/templates/generalize.nix | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/images/windows/templates/essentials/windows-update.nix b/lib/images/windows/templates/essentials/windows-update.nix index b45eb69..2e4d76e 100644 --- a/lib/images/windows/templates/essentials/windows-update.nix +++ b/lib/images/windows/templates/essentials/windows-update.nix @@ -91,8 +91,9 @@ if %ROUND% LSS %MAX_ROUNDS% ( echo Reboot required, scheduling round %NEXT_ROUND%... echo %NEXT_ROUND% > "%ROUND_FILE%" - :: Re-register ourselves for after reboot - reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v vmixUpdate /t REG_SZ /d "C:\vmix-audit-script.cmd" /f + :: Copy script to a path the wrapper won't delete + copy /y "%~f0" "C:\vmix-update-continue.cmd" >nul + reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v vmixUpdate /t REG_SZ /d "cmd /c C:\vmix-update-continue.cmd" /f :: Immediate reboot (preempts wrapper shutdown) shutdown /r /f /t 0 exit /b @@ -102,8 +103,8 @@ ) :: Done — clean up and shutdown - :: (shutdown here handles both wrapper-invoked and RunOnce-invoked cases) del /q "%ROUND_FILE%" 2>nul + del /q "C:\vmix-update-continue.cmd" 2>nul echo === vmix: Windows Update complete === shutdown /s /f /t 10 /c "vmix: windows-update complete" ''; diff --git a/lib/images/windows/templates/generalize.nix b/lib/images/windows/templates/generalize.nix index 3a28df6..9b2a222 100644 --- a/lib/images/windows/templates/generalize.nix +++ b/lib/images/windows/templates/generalize.nix @@ -83,7 +83,7 @@ in :: Activate Windows using TSforge (hardware-independent, survives VM migration) if exist C:\MAS_AIO.cmd ( - echo. | call C:\MAS_AIO.cmd /Z- + echo. | call C:\MAS_AIO.cmd /Z-Windows ) :: Activate Office using Ohook method (if Office is installed) if exist "C:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE" (