Solved The Unattend answer file contains an invalid product key

Dyingcrow

New member
Local time
1:05 AM
Messages
5
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 > NUL 2>&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>
<cpi:offlineImage cpi:source="catalog:g:/latest_wim&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 My Computer

At a glance

Windows 7 Pro x64 - Windows 8.1 Pro x64
Computer type
PC/Desktop
OS
Windows 7 Pro x64 - Windows 8.1 Pro x64
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 My Computer

At a glance

x64 (6.3.9600) Win8.1 Pro & soon dual boot x6...AMD A6-3420M APU with Radeon(tm) HD Graphics6.00 GBAMD Radeon(TM) HD 6520G
Computer type
Laptop
Computer Manufacturer/Model Number
HP Pavilion dv6-6c10us
OS
x64 (6.3.9600) Win8.1 Pro & soon dual boot x64 (6.1.7601) Win7_SP1 HomePrem
CPU
AMD A6-3420M APU with Radeon(tm) HD Graphics
Motherboard
Hewlett-Packard 1805
Memory
6.00 GB
Graphics Card(s)
AMD Radeon(TM) HD 6520G
Sound Card
(1) AMD High Definition Audio Device (2) IDT High Definiti
Monitor(s) Displays
HP W2072a 20" LCD (1600 x 900) @ 60 Hz
Screen Resolution
1366 x 768 x 32 bits (4294967296 colors) @ 60 Hz
Hard Drives
ST640LM0 00 HM641JI SATA Disk Device
Keyboard
Logitech k520 wireless KB
Mouse
Logitech m320 wireless mouse (bundled with KB)
Internet Speed
15/5 | 54 MB Wireless 'n'
Antivirus
Realtime: Defender or Avast | On-demand: Malwarebytes, ESET
Browser
IE 11 on Win8, IE 10 on win 7
Other Info
Media: [Gimp, Audacity, VLC] || Comm: [WEmail 2012, Skype] || Productivity: [OpenOffice,| Textpad] || Utils: [Sysinternals, cCleaner, Speccy, Defraggler]
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 My Computer

At a glance

Windows 10 Pro x64 EN-GB1.6 GHz Intel Core i7-720QM Processor6 GBATI Mobility Radeon HD 5850 Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
HP ENVY 17-1150eg
OS
Windows 10 Pro x64 EN-GB
CPU
1.6 GHz Intel Core i7-720QM Processor
Memory
6 GB
Graphics Card(s)
ATI Mobility Radeon HD 5850 Graphics
Sound Card
Beats sound system with integrated subwoofer
Monitor(s) Displays
17" laptop display, 22" LED and 32" Full HD TV through HDMI
Screen Resolution
1600*900 (1), 1920*1080 (2&3)
Hard Drives
Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
External: 2TB for backups, 3TB USB3 network drive for media
Cooling
As Envy runs a bit warm, I have it on a Cooler Master pad
Keyboard
Logitech diNovo Media Desktop Laser (bluetooth)
Mouse
Logitech Performance Mouse MX
Internet Speed
50/10 Mbps VDSL
Antivirus
Windows Defender 4.3.9431.0
Browser
Maxthon 3.5.2., IE11
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 :rolleyes:. Sysprep weirdness, i guess. Oh, wait, sysprep weirdness, what's that :sarc:

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 My Computer

At a glance

Windows 7 Pro x64 - Windows 8.1 Pro x64
Computer type
PC/Desktop
OS
Windows 7 Pro x64 - Windows 8.1 Pro x64
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 :sarc:
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:

My Computer My Computer

At a glance

Windows 7 Pro x64 - Windows 8.1 Pro x64
Computer type
PC/Desktop
OS
Windows 7 Pro x64 - Windows 8.1 Pro x64
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 My Computer

At a glance

Windows 7 Pro x64 - Windows 8.1 Pro x64
Computer type
PC/Desktop
OS
Windows 7 Pro x64 - Windows 8.1 Pro x64
A strange issue, really clever workarounds :).
 

My Computer My Computer

At a glance

Windows 10 Pro x64 EN-GB1.6 GHz Intel Core i7-720QM Processor6 GBATI Mobility Radeon HD 5850 Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
HP ENVY 17-1150eg
OS
Windows 10 Pro x64 EN-GB
CPU
1.6 GHz Intel Core i7-720QM Processor
Memory
6 GB
Graphics Card(s)
ATI Mobility Radeon HD 5850 Graphics
Sound Card
Beats sound system with integrated subwoofer
Monitor(s) Displays
17" laptop display, 22" LED and 32" Full HD TV through HDMI
Screen Resolution
1600*900 (1), 1920*1080 (2&3)
Hard Drives
Internal: 2 x 500 GB SATA Hard Disk Drive 7200 rpm
External: 2TB for backups, 3TB USB3 network drive for media
Cooling
As Envy runs a bit warm, I have it on a Cooler Master pad
Keyboard
Logitech diNovo Media Desktop Laser (bluetooth)
Mouse
Logitech Performance Mouse MX
Internet Speed
50/10 Mbps VDSL
Antivirus
Windows Defender 4.3.9431.0
Browser
Maxthon 3.5.2., IE11
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 My Computer

At a glance

Windows 7 Pro x64 - Windows 8.1 Pro x64
Computer type
PC/Desktop
OS
Windows 7 Pro x64 - Windows 8.1 Pro x64
Back
Top