DiskConfiguration WillWipeDisk does not work with WillShowUI=Always  


  1. Posts : 38
    Windows
       #1

    DiskConfiguration WillWipeDisk does not work with WillShowUI=Always


    I'm trying to put together a baseline autounattend.xml for initial installation. I want the install to be as hands-free as possible, but still "safe" in the sense that I don't want a USB stick to accidentally get booted and wipe a working computer.

    So, I have the DiskConfiguration set up with the necessary partitions. In addition, I have WillWipeDisk=true on the disk and WillShowUI=Alwasy on the DiskConfiguration.

    If I keep WillShowUI=OnError, everything works fine, by which I mean:

    1. Whatever disk partitions are in place are wiped out.
    2. The partitions specified in the autounattend are created.
    3. Windows is installed.

    All hands-free.

    However, if I make the single change of setting WillShowUI=Always (what I really want), then I find the following:

    1. If there are pre-existing partitions on the disk, the UI stops at the partitioning part of setup and shows the existing (not the planned) partition table.
    2. If I just click "Next" it fails.
    3. If I delete all the partitions and click "Next" it fails.

    The failure error message is something like "Windows could not prepare the partition selected for installation."

    Then, when I click OK and it reboots, the installation proceeds the same way, this time showing the new partitions at the partitioning part of setup. When I click Next, it all works.

    How can I get it to stop at partitioning (to give someone the chance to turn off the computer and avoid destroying a working system), but if the user selects to proceed, it really does just wipe the disk and set up the partitions it needs?

    Here is the WinPE part of my autounattend.xml:

    Code:
        <settings pass="windowsPE">
            <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <SetupUILanguage>
                    <UILanguage>en-US</UILanguage>
                </SetupUILanguage>
                <InputLocale>en-US</InputLocale>
                <SystemLocale>en-US</SystemLocale>
                <UILanguage>en-US</UILanguage>
                <UILanguageFallback>en-US</UILanguageFallback>
                <UserLocale>en-US</UserLocale>
            </component>
            <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <UserData>
                    <ProductKey>
                        <Key>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</Key>
                        <WillShowUI>OnError</WillShowUI>
                    </ProductKey>
                    <AcceptEula>true</AcceptEula>
                    <FullName>RND</FullName>
                    <Organization>RND</Organization>
                </UserData>
                <EnableNetwork>false</EnableNetwork>
                <DiskConfiguration>
                    <Disk wcm:action="add">
                        <CreatePartitions>
                            <CreatePartition wcm:action="add">
                                <Order>1</Order>
                                <Size>500</Size>
                                <Type>Primary</Type>
                            </CreatePartition>
                            <CreatePartition wcm:action="add">
                                <Order>2</Order>
                                <Size>100</Size>
                                <Type>EFI</Type>
                            </CreatePartition>
                            <CreatePartition wcm:action="add">
                                <Order>3</Order>
                                <Size>16</Size>
                                <Type>MSR</Type>
                            </CreatePartition>
                            <CreatePartition wcm:action="add">
                                <Order>4</Order>
                                <Extend>true</Extend>
                                <Type>Primary</Type>
                            </CreatePartition>
                        </CreatePartitions>
                        <ModifyPartitions>
                            <ModifyPartition wcm:action="add">
                                <Order>1</Order>
                                <PartitionID>1</PartitionID>
                                <TypeID>DE94BBA4-06D1-4D40-A16A-BFD50179D6AC</TypeID>
                                <Label>WinRE</Label>
                                <Format>NTFS</Format>
                            </ModifyPartition>
                            <ModifyPartition wcm:action="add">
                                <Order>2</Order>
                                <Label>System</Label>
                                <PartitionID>2</PartitionID>
                                <Format>FAT32</Format>
                            </ModifyPartition>
                            <ModifyPartition wcm:action="add">
                                <PartitionID>3</PartitionID>
                                <Order>3</Order>
                            </ModifyPartition>
                            <ModifyPartition wcm:action="add">
                                <PartitionID>4</PartitionID>
                                <Order>4</Order>
                                <Letter>C</Letter>
                                <Label>Windows</Label>
                                <Format>NTFS</Format>
                            </ModifyPartition>
                        </ModifyPartitions>
                        <WillWipeDisk>true</WillWipeDisk>
                        <DiskID>0</DiskID>
                    </Disk>
                    <WillShowUI>Always</WillShowUI>
                </DiskConfiguration>
                <ImageInstall>
                    <OSImage>
                        <InstallFrom>
                            <MetaData wcm:action="add">
                                <Key>/IMAGE/INDEX</Key>
                                <Value>2</Value>
                            </MetaData>
                        </InstallFrom>
                        <InstallTo>
                            <DiskID>0</DiskID>
                            <PartitionID>4</PartitionID>
                        </InstallTo>
                        <WillShowUI>OnError</WillShowUI>
                    </OSImage>
                </ImageInstall>
            </component>
        </settings>
    Thanks in advance for any help/insight.
      My Computer


  2. Posts : 3,764
    Windows 11 Pro, 22H2
       #2

    dpengel3,

    I know exactly how to do what you are looking for. Unfortunately, I'm a little short on time and I want to make sure I give you a complete explanation so it will be tonight or tomorrow morning (in the US Central Time Zone) before I get a chance to give you all the details.

    Just to make sure that we are on the same page, please confirm whether I have the details of what you want to do correct here. Correct me in anything I have wrong...

    The goal is to create a fully automated installation of Windows BUT you want to pause installation just prior to wiping out the HD just in case someone accidentally boots from the installation media. Is that correct?

    If so, that is exactly what I do with my automated installation. There is also another side benefit to doing it this way: Normally, when you perform an automated installation, Windows will NOT place the recovery partition last on the drive. However, Microsoft suggests placing it last on the drive. The process of holding up before the disk is wiped also has the added benefit of creating the recovery partition last. It also has another benefit in that it allows the same answer file to be used regardless of whether the installation is on an old legacy BIOS based system or on a UEFI based system.

    I'll explain in more detail when I respond again with all the details.

    In the meantime, please just confirm that my understanding was correct.
      My Computers


  3. Posts : 3,764
    Windows 11 Pro, 22H2
       #3

    Sorry, a couple more questions:

    Is your current answer file as posted one that already works (minus the pause to stop full auto installation), or is it a work in progress?

    I didn't look in great detail but I see a couple things that seem off to me already. I see that the product key does not look like a generic key - but that is what it should be. In other words, it should NOT be a key used for activating Windows.

    I also see no reference to a time zone in the answer file.

    If you wish, I can provide a complete sample answer file. I would just need to know the following:

    What edition of Windows (Home, Pro, Pro for Workstations, etc.) do you want to install?

    What time zone should we configure?

    Will this be used to deploy only Windows 10, or do you want to use it to deploy Windows 11 as well? If you are planning on using it with Win 11, does your system meet Windows 11 requirements or do you want me to configure the answer file to bypass the Windows 11 requirements?

    Thanks!
      My Computers


  4. Posts : 38
    Windows
    Thread Starter
       #4

    hsehestedt,

    Thank you for responding. Here are some answers to your questions:

    The goal is to create a fully automated installation of Windows BUT you want to pause installation just prior to wiping out the HD just in case someone accidentally boots from the installation media. Is that correct?

    Yes, that is correct. And, to be sure, the answer file I have does that, but if there is already an existing system and I want to wipe that system and proceed, it requires an extra reboot. (The install fails, and then when clicking "OK" on the failure message dialog, it reboots, comes back to the partitioning step, and that time the install works.) I'm just trying to get it to not take that extra "fail-then-reboot" step.

    I didn't look in great detail but I see a couple things that seem off to me already. I see that the product key does not look like a generic key - but that is what it should be. In other words, it should NOT be a key used for activating Windows

    Oops! I shouldn't have included that product key in what I posted! (Yikes!) If they enable me to edit my posts (I couldn't when I first signed upon this form site), I'll go edit that out.

    For the answers to the rest of your questions, I'll give you a little context: This is for Windows IoT Enterprise LTSC. I'm working out a generic process for my company for developing OS Images for clients who make Windows-based devices. Generally, these devices are locked down in kiosk mode and the user is not even aware that it's Windows running underneath.

    This OS image is documented in a specification that includes all the individual steps in generating it.

    This initial installer is for the purpose of putting Windows on a target device so that hardware-specific drivers can be installed and then captured with dism for adding to the distribution set, which will later be used to generate a more complete baseline image specific to a given project. But doing it this way, and using the same initial answer file, I can cut out twenty minutes of work that might be performed multiple times for a single client (before getting everything right) and remove about 20 pages of specification. Using a non-activating product key, I suspect we could even just use the same initial installer, regardless of client or platform.

    What I posted is not the whole answer file - it's just the WinPE part, since that's what I'm having trouble with. My answer file has a timezone set in the specialize pass. (Not sure if I need to repeat that in the oobe pass, but it's not critical at this stage in the game, anyway.)

    Also, because these are fielded devices, with tightly controlled access to the regular desktop and application-controlled update processes (even OS updates), we are not interested in a growable recovery partition. That's why I'm keeping it at the front instead of putting it at the end.

    Again, thank you for any help you can offer on my specific question, and any help understanding what's going on under the hood at this point.
      My Computer


  5. Posts : 3,764
    Windows 11 Pro, 22H2
       #5

    My apologies: This process is actually far simpler than I had recalled. I was mixing it up with something that required a whole lot more work. Had I recalled how simple this was, I could have quickly responded yesterday. Again, sorry for the mixup.

    Here is all that you need to do:

    NOTE: These steps assume that you are using the Windows System Image Manager (WSIM) to modify your autounattend.xml answer file.

    1) Omit the entire Setup > DiskConfiguration section in your answer file (in Pass 1 windowsPE).

    2) Expand Setup > ImageInstall > OSImage in the Answer File pane of the WSIM and select InstallFrom.

    Set path to \install.wim.

    NOTE: Normally, you would NOT have InstallFrom configured in your answer file, but when the DiskConfiguration section is omitted, it becomes necessary to add this.

    It's as simple as that.

    The behavior will now be that Setup will start, but it will stop at the screen when you select a disk to which Windows should be installed. Because we are no longer automating this step, this makes your answer file "universal" in that the same answer file can now be used on both legacy BIOS (MBR) systems, and UEFI (GPT) based systems.

    As noted previously, the recovery partition will now also be created last, which is the preferred configuration.

    If you have any questions regarding this, do let me know.
      My Computers


  6. Posts : 210
    Windows 7
       #6

    If you don't have the original installers, pnputil can export the current driver files (W10 and later).
    pnputil /export-driver * C:\backup
      My Computer


  7. Posts : 38
    Windows
    Thread Starter
       #7

    Thank you, hsehestedt. That does, indeed, work, and I can use it for the initial installer. For the final installer, I still need to control the disk configuration because I don't want the recovery partition at the end, where it can grow: I want to keep it at the front to constrain it.
      My Computer


  8. Posts : 18,154
    Windows 11 Pro
       #8

    dpengel3 said:
    Thank you, hsehestedt. That does, indeed, work, and I can use it for the initial installer. For the final installer, I still need to control the disk configuration because I don't want the recovery partition at the end, where it can grow: I want to keep it at the front to constrain it.
    You do know that a Windows major version upgrade will just create a new Recovery Partition at the end if it can't grow the old one and you will end up with multiple recovery partitions. What you really need to do is delete the recovery partition altogether and let the recovery environment reside in C:\Recovery.

    I've seen installs with 3 or 4 recovery partitions because that's what Windows upgrades do.
      My Computer


  9. Posts : 38
    Windows
    Thread Starter
       #9

    NavyLCDR said:
    You do know that a Windows major version upgrade will just create a new Recovery Partition at the end if it can't grow the old one and you will end up with multiple recovery partitions. What you really need to do is delete the recovery partition altogether and let the recovery environment reside in C:\Recovery.

    I've seen installs with 3 or 4 recovery partitions because that's what Windows upgrades do.
    There won't be any major version upgrades. These are medical devices, and every upgrade is curated by the manufacturer and then rolled out as in-app upgrade processes. That's also why it's LTSC: to prevent being forced to move to a new version without sufficient planning.

    But thanks for the heads-up: That's good information that I did not know!
      My Computer


  10. Posts : 3,764
    Windows 11 Pro, 22H2
       #10

    dpengel3 said:
    There won't be any major version upgrades. These are medical devices, and every upgrade is curated by the manufacturer and then rolled out as in-app upgrade processes. That's also why it's LTSC: to prevent being forced to move to a new version without sufficient planning.

    But thanks for the heads-up: That's good information that I did not know!
    Also, be aware that the partition will only grow with a major version upgrade, so you don't have to worry about it randomly growing on you.

    But, given your scenario, it's perfectly fine for the partition to not be the last one.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 02:29.
Find Us




Windows 10 Forums