Optimize-Offline icon indicating copy to clipboard operation
Optimize-Offline copied to clipboard

[BUG] Unattend.xml not applied to ISO

Open cyannade opened this issue 4 years ago • 2 comments

The script does not apply the unattend.xml to the image.

I generated an autounattend.xml using https://www.windowsafg.com, imported it into System Image Manager, remedied the errors and exported it to an unattend.xml placed in the Content/Additional/Unattend folder.

The logged error:

Index : 0 Exception : Cannot create a file when that file already exists.

Category : NotSpecified: (:) [Use-WindowsUnattend], COMException ErrorID : Microsoft.Dism.Commands.UseWindowsUnattendCommand Target : Command : [Void](Use-WindowsUnattend @ApplyUnattendParams) Script : C:\Optimize-Offline\Optimize-Offline.psm1 Line : 1463 Column : 13

Image Name: Windows 10 LTSC Image Build: 17763 Host Environment: Windows 10 LTSC 17763 Parameters Passed:

{ "_Info": [ "This is a JSON based Configuration file for Optimize-Offline.", "Ensure proper formatting is used when editing the JSON parameter values.", "Boolean parameter values use true and false. String parameter values must be enclosed in double-quotes." ], "SourcePath": path to iso, "WindowsApps": "All", "SystemApps": true, "Capabilities": true, "Packages": true, "Features": true, "DeveloperMode": false, "WindowsStore": false, "MicrosoftEdge": false, "Win32Calc": true, "Dedup": false, "DaRT": [], "Registry": true, "Additional": { "Setup": true, "Wallpaper": false, "SystemLogo": false, "LockScreen": false, "RegistryTemplates": true, "LayoutModification": false, "Unattend": true, "Drivers": false, "NetFx3": false }, "ISO": "No-Prompt" }

cyannade avatar Nov 09 '20 12:11 cyannade

That error tends to occur if an unattend.xml already exists in the image. Is this a captured image you're trying to apply an answer file to or an OEM image?

DrEmpiricism avatar Dec 07 '20 04:12 DrEmpiricism

I have attempted numerous integrations of multiple different types of answer files and have not been able to reproduce the error you have received on OEM images that have been updated offline to the latest builds. I have integrated answer files that simply boot the device into Audit Mode and others have do a substantive amount of additional changes. The actual error exception that is being returned for you is 'Cannot create a file when that file already exists,' which again makes my previous response more curious.

DrEmpiricism avatar Dec 11 '20 00:12 DrEmpiricism