当前位置:网站首页>Build your own PE manually from winpe of ADK
Build your own PE manually from winpe of ADK
2022-06-26 14:08:00 【lengye7】
One 、 background
all the time , I use Microsoft's official PE System to install the operating system , But officially PE The system has only a black command line , Every time you install the system, you need to use notepad Check the drive letter of the disk where the image is located , It's troublesome , therefore , I just wanted to give PE Add a explorer, This makes it easy to view resources .
Why don't I use what others have done PE?
First , Made by others on the Internet PE, Security cannot be guaranteed , Even if the producer can guarantee not to add any third-party documents , But the production tool he uses may also write some files ( After all, some people use cracked tools ). Security , This is made without using other people's PE Important reasons , After all, this is the basic tool for daily production , The installation and maintenance of the system depend on him , If it has a problem , There will be problems in the whole company's system . This is also what I have been using Microsoft's official PE Why .
second ,PE As a basic tool , Need to ensure adequate compatibility , Some of the network production PE, All kinds of fancy tools , Even the browser and the Internet have been integrated , This is bound to improve PE Requirements for hardware (PE Is completely loaded into memory ), It's true. It's not necessary . I am right. PE The requirement is that it be small enough , There are also some basic tools , These tools can meet the needs of my daily system installation 、 Backup system 、 Restore system requirements , That's enough .
Third , Microsoft official PE It already has dism,diskpart, These two tools can fully meet the needs of daily installation and backup of the operating system . But for ISO Image processing and resource viewing are not very convenient , So I'm going to join explorer and UltraISO And joining oscdimg command , To facilitate viewing system resources , see ISO Mirror image , Generate ISO Mirror image , Burn ISO Mirror image . Some other people on the Internet made it PE, Not many oscdimg This command line tool .
Two 、PE Principle
PE It's very simple , Its basic principle is to build a virtual drive letter in memory , take PE The system loads all of them on the drive letter , And then run PE System . This is the same. PE Software installed in the system , The next time you start, all the reasons disappear , Because the virtual drive letter is the operation , Memory power down , Information disappear . That's why ,PE It can maintain stability and purity during long-term use , Thus, it can be used as a basic installation environment .
ps: The machines in Internet cafes are those other than servers , The so-called diskless system , In fact, the system is completely loaded into memory through the network , and PE It is through U A disc or disc is loaded into memory , So both of them are restarted , The installed software disappeared .
3、 ... and 、 preparation
1、 Download and install ADK
2、 install PE
Check the blog posts here in the above two steps :
3、 Check out your PE edition , Then download the corresponding operating system image (explorer The file and registry are extracted from here ), Ensure the correspondence of document versions , Prevent some unexplained problems .
Check out your PE edition : Version number 10.017763.1 This version number corresponds to win1809 10 The version updated in the month .( There are two options , Subscribe yourself MSDN, Then go to Microsoft official next year 6000 many RMB; You can also go to MSDN Itellyou To download , At present, it should be a relatively safe mirror image in China , For many years . Or you can use a higher version of the image, or you can try . If the company was originally set up , The company is still very large , Or professional installation , Can buy 6000 many RMB A one-year subscription can get all windows Mirror image , A separate patch package is available , Optional feature packs , Then manually patch and add functions , And every month 10 Multiple activation codes can be used for daily installation activation ( But this is not a genuine license ).

4、windwos The running environment of the system software
windows The operation of system software often depends on three parts : Complete operation file , contain exe With all kinds of dll, Store in the right path ; Correct registry information ; Correct environment variables .
So let's add explorer In fact, it contains two parts :exe And dll And the registration form .
And increase oscdimg It also contains two parts :exe And dll And the right path Variable .
5、 Download and install RegistryWorkshop
Go directly to the official Home | www.torchsoft.com , Back RegistryWorkshop Direct abbreviation RW.
This tool is used to edit the registry , Without it , Editing is very cumbersome .
6、 Extract the original PE Mirror image
1)、 Install well ADK and PE After the relevant things , See above 1 and 2.
From the start menu, go to the deployment and imaging environment , Get a command line window .
Enter the command :copype amd64 D:\amd64 # Be careful D There must be no amd64 This folder
This will be 64 position PE All the files have been copied to D:\amd64 This folder .
ps: Use 64 position PE The reason is that windows11 You will not be able to use 32 Bit PE Deploy , In addition, the current machines are 64 position , There is no need to make 32 position PE 了 , If one day you come across one 32 Bit machine , Make a command line 32 position PE That's it .
2)、 mount PE Of boot.wim( This is PE Core document of , To add a file is to add it here )
Enter the command :dism /mount-image /imagefile:D:\amd64\media\sources\boot.wim /index:1 /mountdir:D:\Winpe64
# Be careful ,Winpe64 This directory is established in advance , And this directory must be empty .
After mounting :

3)、 To this PE Add some necessary packages to the
# Check which packages are available first
Dism /Get-Packages /Image:D:\Winpe64

# Add some packages
Write the following command as a batch script :
The script has been written , It hasn't been posted yet .
After the package is added , Carry on :
Dism /Get-Packages /Image:D:\Winpe64
See if it is added successfully : Added successfully .

# Unmount the image and save the changes
Before executing the order , Save the old boot.wim
Enter the command :
Dism /Unmoun-Image /MountDir:D\Winpe64 /Commit
After the implementation, it will be in D The disk generates a boot.wim. Here we can compare the old and new boot.wim, The new one is obviously much bigger .

# Use MakeWinpeMedia Generate a command ISO File is used for virtual drive test PE
ps:MakeWinpeMedia It's also used internally oscdimg To generate ISO Of documents , So I didn't use it directly oscdimg. By default , The command script generates ISO and UFD All support. BIOS Tradition and UEFI Dual start , This is good .
Enter the command :
MakeWinpeMedia /ISO D:\amd64 D:\PurePeBase.iso
Will get a PurePeBase.iso file , If no accident , It can be started and entered normally PE.
thus , All preparations are over .
At the same time, it has the following things :
- PurePeBase Mirror image , Later files will be added on this basis .
- Win10 edition 1809 Update the image in October ,explorer Files and dll And the registry is extracted from here .
- ADK The tool contains oscdimg Command tool , The command and related files are extracted from here .
- RW Registry editing tool
Four 、 Start really adding the tools you need
First the PurePeBase Mount it , still D:Winpe64 This directory is mounted .
1、 To add oscdimg Tools
stay ADK Find... In the tool oscdimg Tools , be located :
There is a big string ahead \Assessment and Deployment Kit\Deployment Tools
Under the table of contents , This directory can be accessed directly from the deployment and imaging tool environment , There are four directories below amd64、arm、x86、arm64, These four directories have oscdimg, Use here amd64 In the catalog , Because the tools in this directory are 64 Bit .
Enter the command line directly from the deployment and imaging tool environment
Enter the command :
md D:\Winpe64\Windows\Oscdimg
copy .\amd64\oscdimg D:\Winpe64\Windows\
Then save the changes , Packaged as a mirror test .
After testing , Find out Oscdimg Directory not added to path In the environment variables , Can not be used anywhere , So it needs to be modified path environment variable .
In the loading Directory :windows\system32\config This location is for storing PE Registry file .
Use regedit Tool to edit the following registry keys :
SYSTEM\ControlSet001\Control\Session Manager\Environment]
find path, Join in ;%SystemRoot%\Oscdimg
Then save the changes , Remake ISO Test success .
regedit How to edit the registry file : stay PE How to modify the system registry ?U disc PE Modify the local registry method -Win7 Home of systems
Write a modification method by yourself , This also specifically refers to PE, It's a little misleading .
have access to reg Command to modify the registry .
thus oscdimg Successful addition .
Get one PeOscdimg2.0.iso file .
All the following steps are in PeOscdimg2.0.iso Based on .
2、 Add the native explorer
stay PeOscdimg2.0.iso On the basis of documents .
explorer Add up to a lot dll Need to add , However, many predecessors have gone through this path , So I summarized a list of documents , So copy a corresponding document according to the previous document list . meanwhile , You can also introduce some tools to view explorer What you need dll, Then compare PE Documents in , Make up what you lack .
There is another way to be lazy , Is to compare what others have done well PE, Add only one explorer.exe go in , What other people need to add , I'll just add some files . actually , That's what I did .
The registry is in full software The registry , Delete run as=Interactive User.
About explorer I've scripted it all .
I just need to explorer The file to be added is written to the script AddFiles.txt Then you can .
3、 Add desktop shortcut ( Do not add too many )
Write a script , stay explorer.exe After starting , Then copy the corresponding shortcut to X:\Windows\System32\Config\systemprofile\desktop In the folder .
This script starts when it starts , Keep checking exeplorer.exe process , When the process starts , Copy the corresponding shortcut to the corresponding folder . however ADK Contains no tasklist This procedure , So we must put it in advance ADK in .
You can put the shortcut in a folder in advance .
Access to desktop shortcuts , My way is : First add the program to PE in , Then start PE, Enter the directory of the program , Right click to create a shortcut , Then copy the shortcut to another U Plate , Later I will start from U Disk added to PE in .
Because I already scripted , So I just need to put U The shortcut in the disk can be placed in the directory corresponding to the script .
4、 because winpeshl.ini The boot entry specified in can only be run once from top to bottom , And after the last application runs , Will continue to run the next application , in other words , If started explorer.exe, You can no longer run other programs , Therefore, it is impossible to start the machine automatically 3 The shortcut in fixes the script .
at present , I think of a way , I started with AppPath Run in cmd.exe /C startnet.cmd Script , And then in startnet.cmd Running a start cmd.exe /C desktop.cmd( The script is 3 The script in ), Thus, the machine can be started and operated 3 The script in .
I have scripted this , If there is a new one in the future, just change the script .
1234 To achieve , Fully meet daily needs , Can be used as a foundation PE, And then here PE Add program to 、 Drive, etc .
5、 The resolution of the , I prefer to write one by myself win32api A statically compiled program , So we can get very good compatibility and portability , This has not yet been implemented . Key API,GetSystemMetrics( Get screen resolution , This is the resolution set by the operating system ),GetDeviceCaps( Get screen resolution , This is the physical resolution of the display ),ChangeDisplaySettings( Change the screen resolution settings ).
Suddenly get a rundll32.exe The order of , I was thinking , Can I use this command to call this 3 A function , To achieve a cmd Version of the resolution setting program ?
6、 Add some basic tools
winrar and ultra ISO
Adding Ultra ISO When , encounter The app can't run on your PC The problem of , I guess it's because you need to run the driver , This problem seems to be more difficult , I turned to try power ISO, And then it succeeded .
PowerISO Once installed , Direct will PrograFiles A whole directory under PowerISO Pack in PE that will do .
PowerISO Solve the trial pop-up problem , It uses the registry to check whether it is registered , Purchase the registration code to register , find HLKU Below PowerISO children , Copy the... Of the child user Key value .
And then mount PE Of DEFAULT File for pe-default, stay pe-default\software Create a new subitem under subitem PowerISO, And then to PowerISO Create a new binary key value USER, Just copy the user Paste the key value under the key value , uninstall pe-default, Just pack it up .
start-up PE You should not see PowerISO The registration problem of .
WinRAR Once installed , Direct will ProgramFiles The next whole WinRAR Catalog packed into PE that will do . because WinRAR Unlimited trial , There is no need to solve the registration problem .
I have scripted these two , The version included in the script is the latest (2022 year 1 month 11 Daily installation ) edition .
7、 Network addition and file transfer
Not for the time being
8、 Write an interface to call diakpart and dism To partition and install files
Don't write for the time being
among 2346 Already scripted , After the script is executed , I just need to use the new boot.wim Replace D:\amd64\media\sources\boot.wim, And then run MakeWinPEMedia The command is packaged into a new iso File can .
After repeated testing and debugging , Finally I got one ZeroPe30.0.iso file , This is what I passed by 30 Iterations of versions get what I need PE 了 .
Due to OCD , I also eliminated the two useless options of screen resolution and personalization in the right-click menu of the desktop . This step has also been scripted .
Record the production PE The pit in which you step :
https://blog.csdn.net/lengye7/article/details/122435020
Other links :
One click script :https://pan.baidu.com/s/1rfmPlht62NlxwvIHGsJXYA Extraction code :1u75
ADK The download page :Download and install the Windows ADK | Microsoft Docs
Finished product download link : link :https://pan.baidu.com/s/1CaDnE40_Ce0ovAdSye5F_g Extraction code :ujvl
边栏推荐
- On insect classes and objects
- [wc2006] director of water management
- 7-3 minimum toll
- 网络远程访问的方式使用树莓派
- 33. Use rgbd camera for target detection and depth information output
- 7-2 the cubic root of a number
- Gurivat sprint Harbour Exchange listed: created “multiple first”, received 900 million yuan Investment from IDG capital
- Bucket of P (segment tree + linear basis)
- 9項規定6個嚴禁!教育部、應急管理部聯合印發《校外培訓機構消防安全管理九項規定》
- Calculate the distance between two points (2D, 3D)
猜你喜欢

Basic type of typescript

hands-on-data-analysis 第三单元 模型搭建和评估

Zero basics of C language lesson 7: break & continue

创建一个自己的跨域代理服务器

What is the use of index aliases in ES

Global variable vs local variable

Codeforces Global Round 21A~D

Network remote access using raspberry pie

爱可可AI前沿推介(6.26)

Detailed introduction to shell script (4)
随机推荐
Self created notes (unique in the whole network, continuously updated)
Wechat applet -picker component is repackaged and the disabled attribute is added -- below
Cloudcompare - Poisson reconstruction
Formal parameters vs actual parameters
[cqoi2015] task query system
Linear basis
Bug memory management
同花顺股票开户选哪个证券公司是比较好,比较安全的
【Proteus仿真】Arduino UNO按键启停 + PWM 调速控制直流电机转速
MongoDB系列之适用场景和不适用场景
Luogu p4513 xiaobaiguang Park
Wechat applet -picker component is repackaged and the disabled attribute is added -- above
7-1 range of numbers
The most critical elements of team management
A must for programmers, an artifact utools that can improve your work efficiency n times
Mediapipe gestures (hands)
计算两点之间的距离(二维、三维)
33、使用RGBD相机进行目标检测和深度信息输出
D check type is pointer
[jsoi2015] string tree