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" (