5

I am trying to add a complex Windows 7 x64 product to WinPE.

This same product had a utility to build a WinPE bootable CD in an older version, but not in the current one, so I'm currently trying to upgrade the old .WIM file. In other words, I'm trying to incorporate the new version into the old WinPE image.

If I export all the files the program uses and paste them in WinPE, would that work?

I've also exported all the registry keys the program uses, but I don't know how to include them in WinPE. Is it possible to run the .reg file in WinPE, or how do I otherwise do that?

With all these problems, I am starting to question the feasibility of this task.
Is there any utility that can help?

harrymc
  • 455,459
  • 31
  • 526
  • 924
FernandoSBS
  • 1,963
  • 10
  • 32
  • 43

1 Answers1

2

Utilities

One utility that helps create a WinPE image is WinBuilder. See this article for a tutorial :
Building a boot USB, DVD or CD based on Windows 7 with WinBuilder and Win7PE SE Tutorial.

Another utility is Win7PE SE.

Updating a WinPE image

Much information is available on the Internet on how to create or modify a WinPE image (.wim). Basically, you mount it as a folder on the computer and then modify the folder and its contained registry as you would, then dismount. The concept is simple enough, yet too long to describe here.

A short explaining article is :
Creating a customised Windows PE 3.0 image.

Microsoft's own documentation is found in these articles :
Customize Windows PE: Add drivers, packages, and more
Extending Windows PE

A somewhat disorderly but possible useful example can be seen in :
Creating a WinPE 3.0 Boot CD/DVD.

Updating the WinPE image registry

The above example explains how to update the WinPE registry, once you have captured all the updates in a .reg file:

  1. Open the Deployment Tools Command Prompt by Start > Programs > Microsoft Windows AIK > Deployment Tools Command Prompt (a normal Command Prompt with administrator privileges might possibly work too)
  2. Mount the .wim image as (for example) folder c:\WinPE by entering :
    dism /Mount-Wim /WimFile:c:\path\to\my.wim /index:1 /MountDir:c:\WinPE
  3. Mount the WinPE SYSTEM registry hive as HKLM_WinPE_SYSTEM by :
    reg load HKLM\WinPE_SYSTEM C:\WinPE\x86\mount\windows\system32\config\SYSTEM
    (the above x86 is for 32-bit, for 64-bit it might be something else.)
  4. Mount the WinPE SOFTWARE registry hive as HKLM\WinPE_SOFTWARE using the following command :
    reg load HKLM\WinPE_SOFTWARE C:\WinPE\x86\Mount\windows\system32\config\SOFTWARE
  5. Edit the .reg file, substituting HKLM\SYSTEM with HKLM\WinPE_SYSTEM, and the same for SOFTWARE
  6. Double-click on the .reg file to load it into the mounted registry hives
  7. Unmount the registry hives by :
    reg unload HKLM\WinPE_SYSTEM
    reg unload HKLM\WinPE_SOFTWARE
  8. Unmount the WinPE image by :
    dism /Unmount-Wim /MountDir:c:\WinPE /commit

Capturing an installation

For a complex product, you may need to "capture" the entire installation including installed files and registry changes. Some products that can help here are :

InstallRite (freeware - old product, but works well for 32-bit)
Advanced Installer (shareware, tutorial here)
InstallAware (shareware, help here)
Total Uninstall (shareware)

It is best to capture the setup on a very virgin computer, perhaps a virtual machine.

harrymc
  • 455,459
  • 31
  • 526
  • 924
  • 1
    yeah, I know about winBuilder and Win7PE. I'm afraid the question is not about that basic principle, it's more complex. About moving a non-portable program to WinPE. thanks anyway – FernandoSBS Sep 17 '13 at 21:05
  • If you know which files go where and which registry entries to add, then can I ask what is the problem? – harrymc Sep 18 '13 at 05:41
  • 1
    The files yes, I can know which ones are needed. But it's far more complex than that, for ex, it uses C++ redistributable. How to install in WinPE? Is it compatible? Also, as I've mentioned in the OP, the registry are different between the two. How to export the registry stuff to the WinPE isntall? – FernandoSBS Sep 18 '13 at 12:15
  • Handling the registry is well described in the article "Creating a customised Windows PE 3.0 image": regedit.exe / Click on hive / menu Load Hive / image's registry file in the mounted system32\config folder (example c:\winpe\mount\windows\system32\config). My last link shows how to modify the .reg file so that it goes into that loaded hive rather than the system. You can also "capture" a complex installation - see above. – harrymc Sep 18 '13 at 12:53
  • We are making progress here. I just don't follow the instructions to modify the registry very well. I've used Total Uninstaller to capture all the files like you said, and then I've pasted those files in the similar folders of winPE mounted image. Problem is I've installed in a different path in Win7 than it will be in WinPE. But I believe changing the registry to the correct path would fix that right. So I'm left with how to migrate the registry. – FernandoSBS Sep 18 '13 at 17:03
  • 1
    I have added inside the answer how to update in the .wim image the hives HKLM\SYSTEM and HKLM\SOFTWARE (hopefully I have no errors). – harrymc Sep 18 '13 at 18:51
  • where is it sorry? – FernandoSBS Sep 18 '13 at 22:12
  • I have added above a title for it : "Updating the WinPE image registry". – harrymc Sep 19 '13 at 05:39
  • Ok now I see it! I will check everything! Do you know if WinPE has/can support C++ Redistributable, and MS Framwork? – FernandoSBS Sep 19 '13 at 12:15
  • You can also capture their installation in the same way, which is why I counseled doing that on a computer or VM on which they are not already installed. – harrymc Sep 19 '13 at 13:06
  • Ah, i understand. I will write you back. Thanks! – FernandoSBS Sep 19 '13 at 22:05
  • I still have some open points in this question but you are rewarded because of your commitment to help me. thanks, and keep helping me here :) – FernandoSBS Sep 23 '13 at 16:11
  • ok I've tried now but I've problems. The application install some kernelmode components. So the programs i've tried to capture the installation don't support that. What now? – FernandoSBS Oct 06 '13 at 11:55
  • Which tool have you used and for which components didn't it work? Once you capture an installation, it should become just another installation. – harrymc Oct 06 '13 at 13:36
  • I've tried both cameyo and thinapp, they both fail to capture kernelmode drivers/installs. The only programs that are able to do that (like symantec's) requires that you install some Client to run the "portable" app. Cameyo and ThinAPP doesn't, but then they don't capture the kernelmode drivers. – FernandoSBS Oct 06 '13 at 18:29
  • These products capture portable apps, which isn't your case. You should use a product that captures all changes, files and registry including system, then apply them to the image. Do not use a 32-bit such product on 64-bit Windows, since it cannot capture everything. – harrymc Oct 06 '13 at 18:46
  • which program are you suggesting? – FernandoSBS Oct 06 '13 at 19:11
  • You will need to try and see. For Windows 32-bit you could start with InstallRite that I have used quite a few years ago. Otherwise, just go in the order of my list above (sorted more or less by product reputation). For the registry, be a bit critical. Don't include for example the performance counters found in `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib` (although I suppose they won't hurt). – harrymc Oct 06 '13 at 19:27
  • Man it's either the program working with kernelmode drivers or don't. I will not loose more time trying a program that is docummented that don't work with kernelmode drivers. So, do you know if that program works with kernelmode drivers? – FernandoSBS Oct 07 '13 at 02:24
  • I know that InstallRite scans and compares the entire disk and registry before and after, but it's 32-bit. The others I haven't tried. System modules are nothing else than files in C:\Windows plus some registry entries, so can be captured. – harrymc Oct 07 '13 at 05:49
  • Ok I will give it a try. – FernandoSBS Oct 08 '13 at 16:40