Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


balubeto

Create an custom Windows PE CD

Recommended Posts


If you need the tools to load into RAM so that you can access them in Windows PE without media, you must copy them to the mount directory. In the walk-through:

c:\winpe_x86\mount

Otherwise you can copy them to the iso directory, in which case they will be available to Windows PE from the boot-medium. In the walk-through:

c:\winpe_x86\iso

Given the above, you must follow the rest of the Walk-Through - unmounting, replacing the default boot.wim, and creating the .iso accordingly.

Regards

Share this post


Link to post
Share on other sites

After I mount the WIM, I usually put any "tools" (aka programs I want in there) in the Windows folder.

Share this post


Link to post
Share on other sites

The \mount\Windows or \mount\Windows\System32 is OK if you have are planning a customization with one or two extra tools. Without a GUI shell and shortcuts, they're in the PATH to find and execute from the command prompt.

To keep things in order, I reproduce full Windows and create a "Program Files" directory and sub-directories in the root of the RAM drive, i. e. "\mount\Program Files\etc." when building. For Programs to run from the medium, "\iso\Program Files\etc." If I don't use a GUI shell with shortcuts, I set the PATH to the all the executables.

Regards

Share this post


Link to post
Share on other sites
The \mount\Windows or \mount\Windows\System32 is OK if you have are planning a customization with one or two extra tools. Without a GUI shell and shortcuts, they're in the PATH to find and execute from the command prompt.

To keep things in order, I reproduce full Windows and create a "Program Files" directory and sub-directories in the root of the RAM drive, i. e. "\mount\Program Files\etc." when building. For Programs to run from the medium, "\iso\Program Files\etc." If I don't use a GUI shell with shortcuts, I set the PATH to the all the executables.

Regards

So if I add a Tools directory to \mount\Windows or \mount\Windows\System32 with the various no-GUI utilities grouped in directories, these utilities work on any working current directory or not?

It is more correct to use the directory \mount\Windows\Tools or \mount\Windows\System32\Tools to do this work or is it the same?

THANKS

BYE

Share this post


Link to post
Share on other sites

It does not matter where you put the files. I would recommend that you do not use a relative path to your files from your scripts or other programs. This will make things easier for you in troubleshooting I think.

Share this post


Link to post
Share on other sites
So if I add a Tools directory to \mount\Windows or \mount\Windows\System32 with the various no-GUI utilities grouped in directories, these utilities work on any working current directory or not?

It is more correct to use the directory \mount\Windows\Tools or \mount\Windows\System32\Tools to do this work or is it the same?

By default Windows PE boots to the cmd prompt with the current directory, Windows\system32\. From there, you can't execute anything in customized sub-directories unless you change directories or set the PATH accordingly. With cmd as the Shell, use startnet.cmd to set the PATH to all the extra Programs at startup.

Personally, I think it more correct to create the custom directories and sub-directories in the root of the drive - either RAM or medium - just like a full Windows OS. For the WAIK Tools, I actually create a 'Tools' directory too. For the RAM Drive, the situation when booted is:

X:\Windows

X:\Program Files

X:\Tools

... all created in the root of your mount directory when building the image.

If not run from RAM because of memeory restrictions, do the same except in the iso directory. Take care that not all Programs are able to run from read-only media. RAM is writeable.

AFAIK, the 'Servicing' directory needs to be in a relative path to pkgmgr. For example:

mount\Tools\pkgmgr

mount\Tools\Servicing\

Regards

Share this post


Link to post
Share on other sites

The guide that is stickied at the top of the PE forum gives you step by step instructions and info on creating a PE cd.

Share this post


Link to post
Share on other sites

For a ready-made script and the brilliant scripting-engine, Winbuilder, download the following .zip, extract it to a path without spaces, double-click winbuilder, choose from a selection of shells and programs, and press 'PLAY'! ... :D ...

The two scripts are not much more than 100KB. Everything is either downloaded from the web or copied from an installed Windows AIK directory, extracted and installed directly into a mounted winpe.wim (or into the iso directory if selected to not run Programs and/or Tools from RAM).

The resulting bootable WinPE .iso will be located in the <Winbuilder Base Directory>\ISO folder, ready to burn to CD. For USB/HDD booting, the iso files are located in <Winbuilder Base Directory>\Temp\pe2\ISO folder. For any other purpose such as dual-booting simply from a .wim, use the <Winbuilder Base Directory>\Temp\pe2\ISO\sources\boot.wim file.

Requires Windows AIK 1.1 (released for Vista SP1) installed in the conventional 'Program Files' location - alternatively select a less-conventional location under the 'Source Directory' Tab in Winbuilder.

http://pe2.winbuilder.net/pe21.003/pe21.003d/pe21.003d.zip

It's the lazy way! ... :D ...

Edited by allanf

Share this post


Link to post
Share on other sites

In conclusion, I have to edit the startnet.cmd file and write the various additional directories where I put the additional tools that need to be able to work on any working current directory. Correct?

Mounting the winpe.wim file on a directory, where you find the startnet.cmd file?

THAMKS

BYE

Share this post


Link to post
Share on other sites
In conclusion,

This is just the beginning of a long road. ... :) ...

startnet.cmd is in your mount\windows\system32

The one default entry should be 'wpeinit', to initialiize PNP and Network support at startup. It can take a few moments.

Add:

SET PATH=%PATH%;<Path to your custom directory>

If you like add:

@ECHO OFF

to the very first line, followed by the above line, then to the next line add:

ECHO Path has been set to <Path to your added exe>.

This will remind you what is available.

Leave wpeinit til the last line. It may be better to start it in a separate process so you don't need to wait for access to the cmd prompt.

... something like that anyway.

Regards

Share this post


Link to post
Share on other sites
In conclusion,

This is just the beginning of a long road. ... :) ...

startnet.cmd is in your mount\windows\system32

The one default entry should be 'wpeinit', to initialiize PNP and Network support at startup. It can take a few moments.

Add:

SET PATH=%PATH%;<Path to your custom directory>

If you like add:

@ECHO OFF

to the very first line, followed by the above line, then to the next line add:

ECHO Path has been set to <Path to your added exe>.

This will remind you what is available.

Leave wpeinit til the last line. It may be better to start it in a separate process so you don't need to wait for access to the cmd prompt.

... something like that anyway.

Regards

Hi I am new to winPE.

I am making one application that execute on winPE to do that I make ISO image file and burn it on a CD and boot my machine with this CD.

I go through following steps while making ISO:

command-1: copype.cmd x86 G:\madan

command-2: imagex /mountrw G:\madan\winpe.wim 1 g:\madan\mount

Now I copy myApplication.exe to g:\madan\mount\windows\System32

command-3- peimg /install=winPE-HTA-Package g:\madan\mount\windows

command-4- peimg /install=winpe-MDAC-Package g:\madan\mount\windows

command-5- peimg /install=winpe-Scripting-Package g:\madan\mount\windows

command-6- peimg /install=winpe-XML-Package g:\madan\mount\windows

Now I create Winpeshl.ini having following lines and paste it to g:\madan\mount\windows\syetm32\

[LaunchApp]

AppPath = %SYSTEMROOT%\System32\myApplication.exe

[LaunchApps]

command-7- peimg /prep g:\madan\mount\windows

command-8- imagex /boot /compress max /capture g:\madan\mount g:\madan\boot.wim "My_Image"

command-9- imagex /unmount g:\madan\mount /commit

command-10- copy g:\madan\boot.wim g:\madan\ISO\sources\boot.wim

command-11- oscdimg -n -bg:\madant\etfsboot.com g:\madan\ISO g:\madan\madan.iso

After burning madan.iso on to a Cd I am able to boot the machine with this and myApplication.exe get executes.

If I execute myApplication.exe in any machine that has XP or VISTA then I can easily access the share files from network or from ftp server because NETWORK connection is configured in that machine(XP or VISTA). But the same exe when get executed through above ISO then I am not able to get connected to network(LAN or ftp). That is because the NETWORK connection is not configured in WinPE iso.

After some googling I got some points like there are some .inf and .sys files required for network connectivity.

After executing command-2 while making ISO image file I see these in g:\madan\mount\Windows\inf(all .inf files are here) and g:\madan\mount\Windows\System32\drivers(all .sys files are here). But I do not have any idea that how can I make these files effective to my final ISO image?

Should I need to execute some extra commands to do that?

(Waiting for your comments)

Thanks

Madan Chauhan

Share this post


Link to post
Share on other sites

@mdnchauhan,

Firstly, thanks for the clear details.

Your command-8 seems an unnecessary step. The WinPE Users Guide describes the following:

imagex /unmount c:\winpe_x86\mount /commit
copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim

That is all that is required.

However, for a more streamlined boot.wim, you can use:

imagex /unmount c:\winpe_x86\mount /commit
delete the default boot.wim in: c:\winpe_x86\ISO\sources\boot.wim
imagex /export c:\winpe_x86\mount\winpe.wim * c:\winpe_x86\ISO\sources\boot.wim

From the Guide:

You can also optimize an image by exporting to a new image file. When you modify an image, ImageX stores additional resource files that increase the overall size of the image. Exporting the image will remove unnecessary resource files.

It is necessary to delete the existing boot.wim. Otherwise you will be adding/appending a second image to the the existing boot.wim.

Secondly, do you have network connectivity at all when you boot WinPE, or are you having trouble connecting to a share? The network drivers in the WinPE image should all be installed by default. You may need to install specific device drivers for the Network Adaptors of the system on which you boot WinPE. In which case, use:

peimg /inf=<path> c:\winpe_x86\mount\Windows

Regards

Edited by allanf

Share this post


Link to post
Share on other sites
@mdnchauhan,

Firstly, thanks for the clear details.

Your command-8 seems an unnecessary step. The WinPE Users Guide describes the following:

imagex /unmount c:\winpe_x86\mount /commit
copy c:\winpe_x86\winpe.wim c:\winpe_x86\ISO\sources\boot.wim

That is all that is required.

However, for a more streamlined boot.wim, you can use:

imagex /unmount c:\winpe_x86\mount /commit
delete the default boot.wim in: c:\winpe_x86\ISO\sources\boot.wim
imagex /export c:\winpe_x86\mount\winpe.wim * c:\winpe_x86\ISO\sources\boot.wim

From the Guide:

You can also optimize an image by exporting to a new image file. When you modify an image, ImageX stores additional resource files that increase the overall size of the image. Exporting the image will remove unnecessary resource files.

It is necessary to delete the existing boot.wim. Otherwise you will be adding/appending a second image to the the existing boot.wim.

Secondly, do you have network connectivity at all when you boot WinPE, or are you having trouble connecting to a share? The network drivers in the WinPE image should all be installed by default. You may need to install specific device drivers for the Network Adaptors of the system on which you boot WinPE. In which case, use:

peimg /inf=<path> c:\winpe_x86\mount\Windows

Regards

Thanks for your support.

In my application that execute on WinPE through ISO image I have a tree control in that I display all the drives name of Hard drive(like C,D,E) and "Network"(if the NETWORK is configured in that OS that I get in XP or in VISTA). But when I boot my machine with WinPE iso image all the drives of hard drive are there in the tree but "network" is not there the reason behind it (as I think) is it is not getting necessary network drivers.

As you told me to install specific device drivers for the network adapter, I was trying to install these with the following command (after command-2 that I was executing before)-

peimg /inf=G:\madan\mount\windows\inf\1394.inf G:\madan\mount\windows

This command is successfully executing.

I have some confusion here:

1- There are more than 20 .inf files in "G:\madan\mount\windows\inf" like 1394.inf, acpi.inf etc. Should I need to install all of these one by one?

2- If yes then do I need to execute command-2(imagex /mountrw G:\madan\winpe.wim 1 G:\madan\mount) each time after installing each .inf file?

Well I will try it out after your reply

Thanks

Madan Chauhan

Share this post


Link to post
Share on other sites

Use a similar command as this:

peimg /inf=G:\madan\mount\windows\inf\*.inf G:\madan\mount\windows

But ah, you don't need your source path to be in the mount. You should import your drivers from somewhere else because it does not install all of the files. Plus now you technically have duplicate files in your ISO image. My command is like this, besides obvious drive letter difference:

peimg /inf=d:\drivers\win32\*.inf c:\winpe_x86\mount\windows

Note the wildcard there. PEIMG will try to install all the INF files it can find in that folder.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...