none
Export Registry Key, Refresh OS, then Re-Import the Registry Key RRS feed

  • Question

  • Using MDT 2010, I have added several "Run Command Line" tasks to the Preinstall TS section. These tasks do the following:

    1. Use Reg.exe to load the SOFTWARE hive from the machine's OS drive - reg.exe load "HLKLM\LOCALSOFTWARE" "D:\Windows\system32\config\SOFTWARE"
    2. Use Reg.exe to export a Key to a file on the WinPE RAMDisk (X:) - reg.exe export "HKLM\LOCALSOFTWARE\..." x:\Regfile.txt
    3. Run an AutoIt script (from %SCRIPTROOT%) to edit the Reg Key Path from "HKLM\LOCALSOFTWARE\..." to "HKLM\SOFTWARE\..." so it will import correctly and save it to the WinPE RAMDisk (X:) as Regfile2.txt

    After the OS install, in the Postinstall TS section and before the machine boots to Windows 7, I run another AutoIt script (again from %SCRIPTROOT%) that copies the Regfile2.txt to C:\MININT as Regfile2.reg.

    Finally, just before the Install Applications TS section, I run a final AutoIt script (from %SCRIPTROOT%), that imports c:\MININT\Regfile2.reg into the registry.

    This process seemed to work, initially, on a VM.  So I tried on an actual machine.  At that point, the OS Install portion began to fail during the process of expanding Windows stating "Windows cannot install required files. Make sure all files required for installation are available, and restart the installation."  The error only occurs during a deployment where there was a pre-existing OS (i.e. - if I wipe the disk first so that there is no registry data to capture, the process has no problem).  Also, if I disable all of these related tasks, the deployment has no issue.

    The files on X: are getting created and edited properly and initially the file copy to c:\MININT looked to be happening correctly but now it doesn't get that far. I have tried moving the tasks around a bit, but nothing has worked.

    Keith...

    Tuesday, January 28, 2014 8:01 PM

Answers

  • I have a solution... I found that I was not unloading the registry hive from the existing machine when I had completed the registry export.  Once I added a registry hive unload task, the process has been performing as I'd hoped.

    Thanks for you attention to this issue and your suggestions.

    Keith...

    • Marked as answer by kellis002 Saturday, February 8, 2014 4:04 AM
    Saturday, February 8, 2014 4:04 AM

All replies

  • Hi Keith,

    Have you verified the file exists in the ramdisk post install?  This would be the first place I would look, I don't think that file is going to stay persistent through to the post install process.  You could also test to a directory you know is persistent, say %scriptroot%\regfile.txt.  Hope this helps.

    Ryan

    Wednesday, January 29, 2014 9:08 PM
  • Thanks for the reply, Ryan.

    Yes, the files are getting created on the ram disk.  The scripted edit to the file on the ram disk is working properly, and (if I move the task ahead of the Windows install in the Task Sequence) the file gets copied to the c: drive correctly.  But, if any of this task process is used, the Windows install fails with "Windows cannot install required files. Make sure all files required for installation are available, and restart the installation."  I will get the actual error code and add to the post.

    I was concerned that having the files on the ram disk at the time of the install might be causing the issue, so I have a task delete them after the copy to c:... still no luck.  For the same reasons, I tried having the files copy after the Windows install, but the error is occurring during the install process, so it never got that far.

    I don't need the files to stay persistent any longer than it takes to edit it and copy it to the local drive.  However, I have not tried having it copy it to the Deployment Share.  Copying it to the Deployment Share is not ideal as our Help Desk technicians do not have write permissions there, anyway.

    Monday, February 3, 2014 7:06 PM
  • Architecturally this question makes no sense to me.

    I have no idea what this is about, what files you are editing, why you need to do this.

    Techncally, the MDT Task Sequence is broken down into several sections, all clearly labeled. The Pre-Install section is run while in WinPE, just before we apply the OS to an empty disk. There is nothing of value in the registry of WinPE, so I can't fathom why you would want to export this registry data to a file, and why you would want to import that information in the full OS. Perhaps you mean to say the "State Capture" section, yet you are talking about a ramdisk so I am confused.

    What is going on here?


    Keith Garner - keithga.wordpress.com

    Tuesday, February 4, 2014 7:10 AM
    Moderator
  • Keith, thank you for your response.

    Essentially, I have a bit of current Windows system registry data (a machine specific Identifier)(not from WinPE) that I want to capture from a machine.  Save this data temporarily while the machine is re-imaged using MDT (in either a Refresh or New Computer process).  And then re-apply to the registry prior to the Application Install portion of the Task Sequence.

    During the Preinstall portion of the Task Sequence, I load the original system's Windows Software hive, extract the desired data, saving it to a file on the ramdisk (X:).  All this is working.  Actually the whole process is working if I boot from media rather than launching the process from LiteTouch.vbs and running a Refresh.

    However, when the new Windows Install begins, it gets to a point of expanding the Windows files and stops with an error "Windows cannot install required files. Make sure all files required for installation are available, and restart the installation."  The LiteTouch deployment summary shows "A device attached to the system is not functioning. (Error: 0000001F; Source: Windows)"  Non-zero return code by LTIApply, rc = 31  The deployment stops while applying our custom WIM.

    During the Postinstall I have it set to copy the registry file from X: to C:.  This also worked as a test where I had the task prior to the Windows install. But because of the error above it never gets this far.

    Then, finally, the registry file gets imported to the re-imaged Windows machine during the State Restore Task Sequence portion.  This part has worked manually, but again, the process is halted by the error before it gets to that point.

    If I disable the Preinstall portion of the tasks for this process, the re-image will occur without issue. Obviously, then, my intended outcome is not achieved.

    Tuesday, February 4, 2014 9:01 PM
  • OK, I see. <meh>

    Architecturally, the recommended method is to put the registry gather within the "state capture" phase, and do a Refresh rather than new computer.

    As for the error, you need to dig into what the problem is with LTIApply/imagex. Have you tried running imagex.exe manually? what is the output from the program?

    MDT 2012 has code to automatically capture the imagex.exe output and save to bdd.log.


    Keith Garner - keithga.wordpress.com

    Wednesday, February 5, 2014 2:34 AM
    Moderator
  • I have a solution... I found that I was not unloading the registry hive from the existing machine when I had completed the registry export.  Once I added a registry hive unload task, the process has been performing as I'd hoped.

    Thanks for you attention to this issue and your suggestions.

    Keith...

    • Marked as answer by kellis002 Saturday, February 8, 2014 4:04 AM
    Saturday, February 8, 2014 4:04 AM