diff --git a/lib/images/windows/templates/generalize.nix b/lib/images/windows/templates/generalize.nix index 3e43a93..3b4d3fe 100644 --- a/lib/images/windows/templates/generalize.nix +++ b/lib/images/windows/templates/generalize.nix @@ -336,6 +336,17 @@ in { del /q C:\Windows\Panther\unattend.xml 2>nul del /q C:\Windows\Panther\Unattend\unattend.xml 2>nul del /q C:\Windows\System32\Sysprep\Panther\unattend.xml 2>nul + ${lib.optionalString (dataDisk != null) '' + :: Lay the data disk out here, in Audit Mode, rather than leaving it to the + :: specialize pass alone. Component order within a pass is not guaranteed, + :: and FolderLocations is applied by Shell-Setup while the disk is prepared + :: by Deployment -- so relocation can be evaluated before the volume it + :: names exists, which silently leaves profiles on C:. Audit Mode is a + :: fully booted OS with the disk already attached, so this always works. + :: The specialize copy stays as a letter re-assertion after generalize + :: clears MountedDevices. + call C:\vmix-init-data-disk.cmd + ''} C:\Windows\System32\Sysprep\sysprep.exe /generalize /oobe ${if delayOobeRun then "/shutdown" else "/reboot"} /quiet /unattend:C:\oobe-unattend.xml ''; }