Wednesday, 13 April 2011

Possible fix for torn SP1 machines

Update 16/05/2011 - There's now a supported fix for machines in this state.

Edit 05/05/2011 - Having run this on all of my machines, I can't see anything to show that they're not now fully working. Also, setting the permissions (the long winded stage 4) doesn't seem to be necessary.

Yesterday I came up with a possible fix for getting SP1 correctly installed on a torn machine. I posted a very brief overview of what I'd done over on The Windows Servicing Guy's blog. Here are a more in-depth set of steps and instructions for those who are interested.

Part 1 - Ascertaining if you've got the same problem I did

  1. On a torn PC try to install SP1 from the the full file available at
  2. When it fails, check the log at %windir%\Logs\CBS\CBS.log. If you've got the same error I have on all of my torn machines you should see something similar to this towards the end of the log:

Part 2 - Get the missing folder
  1. Get hold of your original Windows 7 Installation media.
  2. Download 7zip and install.
  3. In 7zip file manager navigate to the sources folder on your installation media and double click install.wim. 7zip will expand the wim file.
  4. You'll now see a few folders and an xml file. The xml file will tell you which folder you need for your version of windows. In my case folder 3 is Windows 7 Pro
  5. Browse to the FileRepository folder in the appropriate image and copy out the missing folder to a usb drive. In my case this would be the atiilhag.inf_amd64_neutral_951c1812f542740a folder in D:\sources\install.wim\3\Windows\System32\DriverStore\FileRepository\. I made sure that the ati folder was in its own sub folder on the usb drive as I'm lazy and it made it easier copying it in the next part.
Part 3 - Get the missing folder back in place
  1. Boot from your Windows 7 media into recovery console.
  2. Plug in your USB drive.
  3. Ascertain the drive letters you're gong to be working with. (If you're a GUI person you can always launch notepad.exe from the command prompt to look at drive letters).
  4. From the command prompt use xcopy to put the atiilhag.inf_amd64_neutral_951c1812f542740a folder back into the FileRepository folder. As an example, I executed the following commands:

    cd \windows\system32\driverstore\filerepository
    cd \atidriver
    xcopy *.* /e d:
  5. exit and restart into windows.
Part 4 - Set the permissions

(Long winded. If anyone would like to send me a shorter way to achieve this, please do!)
  1. Browse to %windir%\System32\DriverStore\FileRepository
  2. Open the properties for the atiilhag.inf_amd64_neutral_951c1812f542740a folder.
  3. On the security tab click Advanced, then Owner then the Edit button.
  4. Change the owner to Administrators, check "Replace Owner on subcontainers & objects".
  5. Click OK 3 times.
  6. (Back in the Security tab now) Click Edit then Add.
  7. Change the location to your local PC.
  8. Type the following into the "Enter object names to select" box: Administrators; Users; NT SERVICE\TrustedInstaller
  9. Click OK then give TrustedInstaller Full Control.
  10. Click OK and then Yes.
  11. Click Advanced and then Change permissions.
  12. Uncheck "Include inheritable permissions..." then click the Add button.
  13. Remove permissions for the Everyone group. Click OK and then Yes.
  14. Back on the Owner Tab click Edit then click Other users and groups.
  15. Change the location to the local PC, Enter NT SERVICE\TrustedInstaller into the "Enter object names to select" box and click OK.
  16. Check "Replace Owner on subcontainers..." and click OK

    Phew! That's the Files in the folder all now set with the right permissions. Nearly there...
  17. Click Edit again.
  18. Change the owner to Administrators and click OK and OK again (NOTE: do NOT appy to subcontainers!)
  19. On the Permissions tab click Change Permissions.
  20. Check "Include Inheritable..." and then click Apply and Yes followed by Continue 19 times (as it can't and shouldn't apply to any of the files)
  21. Remove all of the "<not inherited>" permissions, Click OK, Yes and then Continue 19 times again.
  22. Back on the Owner tab click Edit and then Other users or Groups.
  23. Click Location, change it to the Local PC and click OK.
  24. Enter SYSTEM in the "Enter object names to select" box and then click OK 5 times until all properties windows are closed.
Part 5 - Remove the partially installed Service Pack

  1. Launch an administrative command prompt (Right-click on Command Prompt in the Start Menu and click "Run as Administrator")
  2. At the prompt type dism /online /remove-package /packagename:Package_for_KB976932~31bf3856ad264e35~amd64~~
  3. Hit enter.
  4. After a while you'll be prompted to reboot. Type Y to do so.
Part 6 - Install Service Pack 1

  1. Launch the SP install from the file you downloaded back in Part 1. With a bit of luck, all should be well.
That's it it's worked on every machine I've tried it on so far. Fingers crossed it helps you too!


  1. Hey Kelvin,

    I've been trying to fix my torn system here with your instructions. I already copied the right ati folder back and the rebooted back to Windows. When i am trying to remove the partially installe Service Pack with admin cmd im getting this:

    (Sorry it's Finnish version of OS) It's saying that the wanted "Package is not proper Windows package"

    After that i tried to run Sp1 install .exe, it's saying again and again that you need to reboot the system. Here's snapshot of the CBS log:

    Ideas? Thank you!

  2. Looking at your CBS log, it would appear that your package has a slightly different name (by only one number!). I'm guessing that this is something to do with it being the Finnish version of the OS. Try running the DISM command with the "ad264" part changed to "ad364" like this...

    dism /online /remove-package /packagename:Package_for_KB976932~31bf3856ad364e35~amd64~~

    Let me know how you get on!


  3. Excellent, it works. After the DISM command and reboot i installed SP1 and everything went smooth.

    Still have 10 systems to do :]

    Thanks again,


  4. Glad it worked out for you - thanks for letting me know.

    Good luck with the rest of the systems.


  5. Kevin,

    I was going to try your solution, however, I couldnt install 7zip, I'm getting message: The windows installer service could not be accessed.

    I also tried a supported fix, but it seems like my expand amd64 is not working. Is any way around this problem? Thanks

  6. Hi Mark1872

    Sorry for the delay in getting back to you - I've been away from my computer for a couple of days.

    With regards to you Windows Installer error, is it possible that the service is disabled? You could check by running services.msc and checking the Startup Type of the "Windows Installer" service.

    What happens when you try to expand your amd64 version of the SP1 file for the supported fix?