The Unattend answer file contains an invalid product key


  1. Posts : 5
    Windows 7 Pro x64 - Windows 8.1 Pro x64
       #1

    The Unattend answer file contains an invalid product key


    I am responsible for building, updating, converting, building a sysprepped Windows 7 Pro master and deploy it on my company's computers. The final result is a build that includes full recovery capability, as most of these computers are used outside the office, some in remote locations.

    To achieve this, i have a "master" VHD that was built with a genuine iso dowloaded from the Microsoft VLSC, and is regularly updated with Windows and specific software updates. I copy this VHD somewhere else, and Sysprep/shutdown the copy. This copy is mounted and captured to WIM
    using DISM, and added drivers for all the many different Lenovo computer models and machine types we have out there, both Desktops and Laptops.

    Having a "Master" WIM, and for the sake of keeping the Unattend.xml file as simple as possible, i use my own script to deploy the WIM to a Hard Drive with this configuration: System reserved+WinRE-Recovery-Windows7. The Recovery partition being before the Windows partition is due to the fact that this will be deployed to hard drives of sizes ranging from 80GB to 1TB+. This deployment is then imaged with other Imaging software, for quick deployment (things can get pretty hectic and i need to shave off as much time as possible). Before sending the computers to the field, they are booted, updated with any missing drivers/model specific OEM software and other specific licensed Software, last minute updates, specific user configuration, and extend Windows partition to accommodate the whole drive.

    Ive been using the same VHD Master and Unattend.xml file for months, everything was working fine until recently. I was doing a routine check on a deployed image, and for my surprise the Recovery failed with the dreaded error "The Unattend answer file contains an invalid product key". I use the same bulk MAK key, and haven't ran out.

    The Unattend.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="generalize">
    <component name="Microsoft-Windows-Security-SPP" 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">
    <SkipRearm>1</SkipRearm>
    </component>
    </settings>
    <settings pass="specialize">
    <component name="Microsoft-Windows-Security-SPP-UX" 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">
    <SkipAutoActivation>true</SkipAutoActivation>
    </component>
    <component name="Microsoft-Windows-Deployment" 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">
    <RunSynchronous>
    <RunSynchronousCommand wcm:action="add">
    <Credentials>
    <Username>USER</Username>
    </Credentials>
    <Order>1</Order>
    <Path>Net Accounts /maxpwage:unlimited</Path>
    </RunSynchronousCommand>
    </RunSynchronous>
    </component>
    </settings>
    <settings pass="oobeSystem">
    <component name="Microsoft-Windows-International-Core" 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">
    <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-Shell-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">
    <OOBE>
    <HideEULAPage>true</HideEULAPage>
    <NetworkLocation>Work</NetworkLocation>
    <ProtectYourPC>1</ProtectYourPC>
    <HideWirelessSetupInOOBE>false</HideWirelessSetupInOOBE>
    <SkipMachineOOBE>true</SkipMachineOOBE>
    <SkipUserOOBE>false</SkipUserOOBE>
    </OOBE>
    <RegisteredOrganization>COMPANY</RegisteredOrganization>
    <ShowWindowsLive>false</ShowWindowsLive>
    <RegisteredOwner>COMPANY</RegisteredOwner>
    <DisableAutoDaylightTimeSet>false</DisableAutoDaylightTimeSet>
    <DoNotCleanTaskBar>true</DoNotCleanTaskBar>
    <FirstLogonCommands>
    <SynchronousCommand wcm:action="add">
    <CommandLine>CSCRIPT //NOLOGO slmgr.vbs -rearm &gt; NUL 2&gt;&amp;1</CommandLine>
    <RequiresUserInput>false</RequiresUserInput>
    <Order>1</Order>
    </SynchronousCommand>
    <SynchronousCommand wcm:action="add">
    <CommandLine>/REBOOT</CommandLine>
    <Order>2</Order>
    <RequiresUserInput>false</RequiresUserInput>
    </SynchronousCommand>
    </FirstLogonCommands>
    </component>
    </settings>
    <cpifflineImage cpi:source="catalog:g:/latest_wim&amp;vhd/win7_wim/current/install_windows7.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" />

    I am not, by any means, very knowledgeable of the intricacies of this xml build shenanigans, as i don't have much time to fiddle and experiment with it. The above was put together by trial, error, and adapted bits and pieces gather from the web.
    I basically want it to skip everything OOBE and go straight to the user login, which is already set up as default for everyone. The Windows key was NEVER added to the XML.
    ------------------------------------------------------------------------------------------------------
    As for now, i'm pretty much stuck.
    I've already tried everything i could think of. Associating the XML with both the original WIM and the captured WIM, reactivating the master, etc... but there might be something silly i'm not aware of?

    Any ideas for both a possible solution and improving the XML file are welcome.
      My Computer


  2. Posts : 6,458
    x64 (6.3.9600) Win8.1 Pro & soon dual boot x64 (6.1.7601) Win7_SP1 HomePrem
       #2

    For future reference: Windows 7 | Deploy, Download, Forums, Help, Events, XP | TechNet

    The only interesting thing I found was a reference to disabling the floppy drive.
    The unattend answer file contains an invalid product key
    Sunyata Group said:
    Once you have verified that the product key is valid ("genuine product" | "full product" | "upgrade product") for the type of installation that you are doing . . . Then try this:

    Start the installation/set-up process again, and wait for the error message to appear.

    Locate the "Settings" menu in the installation menu bar.

    Under the "Settings" window -> Select "Removable Devices" --> Double-click the "Floppy" icon => Turn off "Enable Floppy Drive".

    Now hit the "OK" button in the error message box. If that does not work straight away, Restart the installation process.

    This should work on a number of products.

    Good luck!

    Edited by Sunyata Group Saturday, December 29, 2012 4:40 PM
    That might be one of the silly things you're looking for. Other than that I won't be much help - you seem to have a firm grasp on the process, more so than I have.

    There are some members who know this stuff fairly well - hang in for their input.

    Good luck,

    Bill
    .
      My Computer


  3. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #3

    The answer file seems OK, read it through several times and cannot find any errors, only one small detail which I would change: You have the user Welcome Center enabled (<SkipUserOOBE>false</SkipUserOOBE>), I personally find it annoying and would disable it (<SkipUserOOBE>true</SkipUserOOBE>). But, this is a matter of taste and habits, no arguing :).

    That floppy trick Slartybart above told seems to be all over the net, I would recommend testing it. Also, to be absolutely sure the key is not somehow "hidden", open your answer file with Windows System Image Manager and check the both places where it might be found, WindowsPe > Microsoft-Windows-Setup and Specialize > Microsoft-Windows-Shell-Setup.

    An important thing to do is validation; check the answer file with SIM validator and read warnings carefully.

    Kari
      My Computer


  4. Posts : 5
    Windows 7 Pro x64 - Windows 8.1 Pro x64
    Thread Starter
       #4

    Tks for the replies so far.
    I did check on that Floppy issue, it really is all over the web, but it's always been disabled (by default).

    @Kari
    "You have the user Welcome Center enabled (<SkipUserOOBE>false</SkipUserOOBE>), I personally find it annoying and would disable it (<SkipUserOOBE>true</SkipUserOOBE>)"
    The only reason for having it enabled is because, along with SkipMachineOOBE=true it WILL prompt me to create a new account, which i don't want to, instead of going straight to the login screen . Sysprep weirdness, i guess. Oh, wait, sysprep weirdness, what's that

    I guess that i could just forget all about it and start fresh, which would be very painfully time consuming, as it is painful to just ignore this, not understand why it's causing it and how to prevent it
      My Computer


  5. Posts : 5
    Windows 7 Pro x64 - Windows 8.1 Pro x64
    Thread Starter
       #5

    Found the issue.
    Booted up with F8+repair and opened up a command prompt. In the rot of X:\ there's an unattend.xml file. With a key in it, which is bbbbb-bbbbb-bbbbb...
    Editing the XML and removing the key lets the recovery run no problem. Now, isn't that silly
    The next issue is where the damn unattend.xml's coming from. I opened both WinRe.wim (windows and recovery partition) and there were no signs of any unattend.xml. Saved both WIM with a clean unattend.xml, copy of that with no shenanigans key (the WIM in the recovery partition is registered) so i'd guess it's being generated, but not retrieving the key properly? Though the bbbbb key will still be there even if i SLMGR they key out of Windows. That silly unattend.XML always seems to take precedence.
    Maybe the WinRe.wim is messed up, i'll try to replace it and see what happens.
    One way or the other, it's better then nothing.
    Last edited by Dyingcrow; 15 Oct 2014 at 08:24.
      My Computer


  6. Posts : 5
    Windows 7 Pro x64 - Windows 8.1 Pro x64
    Thread Starter
       #6

    For closure on this thread, i'll relate to another post

    Solved How do I find my Product Key? - Page 4

    I am using a MAK key, with regular activation. Wonder if activating through a KMS server would make any difference (?), but in this context it serves no purpose. And indeed, there is no key stored in the registry, just 00s. Reason why the key being retrieved is a bunch of BBBBB. Why Setup generates the Unattend.xml with such heresy, which will cause 100% fail, is beyond my comprehension.

    By simply running slmgr/upk and slmgr/ipk to inject a valid OEM key (and skipping activation, of course), running the recovery from within Windows 7 works properly. Problem solved.
    As for running the recovery from F8-Repair your computer, my solution was to make a copy of the generated Unattend.xml file on the root of X:\ and remove the key entry; then mount the WinRE.wim image, copy the modified Unattend.xml file to the mounted image, along with a script that will replace the generated xml with this modified (to simplify things), save changes and dismount.
    To run the recovery, F8-command line, run the script from the command line, then run Reinstall Windows.
    After Windows boots up for the first time, inject the MAK key and activate.
    Problems solved.

    -----------------------------------------------------------------
    Maybe there is another, less clumsy way to do all this? Nevertheless, it will be quite easy to script patch my computers with this method using only a batch with a few lines, and that was my objective.
      My Computer


  7. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #7

    A strange issue, really clever workarounds :).
      My Computer


  8. Posts : 5
    Windows 7 Pro x64 - Windows 8.1 Pro x64
    Thread Starter
       #8

    Adding to my last post, it's not necessary to add a OEM key at all to run the recovery from windows. I tried it because i had one available and wanted to see if that reflected on the Unattend.xml file, which does. The key is there, instead of the BBBBB stuff.
    Deleting the ProductId key is enough (not necessary deleting the ProductIdx64), the recovery will run from within Windows. This might solve the problem for OEM computer users that don't have Media available for a fresh install and need to restore from the OEM recovery partition, using the provided recovery tool, and run into the same "The Unattend answer file contains an invalid product key" wall.
    Extracting the BIOS embedded Windows key from newer computers for further activation might be necessary (whaaa no Windows sticker???????), RW Portable from RWEverything | Read & Write Everything is a lifesaver.

    I hope this helps someone someday, i read through so many forum threads related to the same, or very similar issue, and none have a concrete answer.
      My Computer


 

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

© Designer Media Ltd
All times are GMT -5. The time now is 19:03.
Find Us