Pre-installation environment mirror image installation method and device, equipment and storage medium
By automatically formatting and copying the pre-installed environment startup media and installing the mirror source files, errors and inefficiency problems caused by manual operations in the prior art are solved, and the accuracy and efficiency of WinPE mirror installation are improved.
Patent Information
- Application Number
- CN202411266746.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-13
AI Technical Summary
The existing WinPE production method requires manual formatting of partitions and mounting of WIM files, which are prone to formatting partition errors and editing errors, which are inefficient.
By obtaining the pre-installed environment startup media and installing the mirror source file, calculate the file size to determine the target mobile disk, automatically format the partition, and copy the file to the target partition. After verifying the partition, compile the script to install the image according to the file format type.
Reduces errors caused by manual operations, improves the accuracy and efficiency of formatted partitions, and improves the success rate of pre-installed environment mirror installation.
Smart Images

Figure CN119127235A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pre-installation environments, and in particular to a pre-installation environment image installation method, device, equipment and storage medium. Background Art
[0002] WinPE (Windows Preinstallation Environment) is a minimal Win32 subsystem with limited services, based on Windows 3.x and above kernels running in a full Windows environment or protected mode. Such systems are generally very small. It includes the minimum functionality required to run Windows installation programs and scripts, connect to network shares, automate basic processes, and perform hardware verification.
[0003] The existing method of making WinPE requires manual formatting and partitioning of mobile disks and pre-installation of drivers, as well as mounting and unmounting of WIM files (WIM (Windows Imaging Format) files are a file format used to store and manage images of Windows operating systems. It was developed by Microsoft and is mainly used to deploy Windows operating systems and related software). This requires certain script editing capabilities and professional knowledge reserves to perform. Manual operations may also result in formatting partition errors and editing errors and are inefficient. Summary of the invention
[0004] The present invention provides a pre-installation environment image installation method, device, equipment and storage medium, which are used to solve the technical problem that formatting partition errors and editing errors may occur during manual operation and the efficiency is low.
[0005] The present invention provides a pre-installation environment image installation method, comprising:
[0006] Obtain the pre-installation environment boot media and installation image source files;
[0007] Calculating the file sizes of the pre-installation environment startup medium and the installation image source file, and determining the target mobile disk according to the file sizes;
[0008] Formatting the target mobile disk into different target partitions;
[0009] Copying the pre-installation environment boot medium and the installation image source file to the corresponding target partition;
[0010] Verifying the target partition, and when the verification passes, obtaining a file format type from the installation image source file;
[0011] Compiling a script of the pre-installation environment startup medium according to the file format type;
[0012] The script is used to perform image installation on the target device.
[0013] Optionally, the step of formatting the target mobile disk into different target partitions includes:
[0014] Formatting the target mobile disk into different partitions and generating drive letters for each partition;
[0015] Determine whether the partition is created successfully according to the drive letter;
[0016] If not, return to the step of formatting the target mobile disk into different partitions;
[0017] If so, the partition is output as the target partition.
[0018] Optionally, the step of verifying the target partition and obtaining the file format type from the installation image source file when the verification passes includes:
[0019] A hash value of the target partition is calculated, and when the hash value meets a preset condition, a file format type is obtained from the installation image source file.
[0020] Optionally, the step of calculating the hash value of the target partition and obtaining the file format type from the installation image source file when the hash value meets a preset condition includes:
[0021] Calculate a first hash value of a file in a target partition corresponding to the pre-installation environment boot medium;
[0022] Calculate a second hash value of a file in the target partition corresponding to the installation image source file;
[0023] Obtaining a third hash value of the pre-installation environment boot medium;
[0024] Obtaining a fourth hash value of the installation image source file;
[0025] Determine whether the first Hash value is the same as the third Hash value, or whether the second Hash value is the same as the fourth Hash value;
[0026] If they are different, return to the step of copying the pre-installation environment boot medium and the installation image source file to the corresponding target partition;
[0027] If they are the same, updating the driver of the pre-installation environment boot medium;
[0028] When the driver update is completed, the file format type is obtained from the installation image source file.
[0029] Optionally, the step of updating the driver of the pre-installation environment boot medium includes:
[0030] Check if the preset specified folder is empty;
[0031] If yes, determining that the pre-installation environment boot medium does not need to add a driver;
[0032] If not, the driver is loaded into the pre-installation environment startup medium.
[0033] The present invention also provides a pre-installation environment image installation device, comprising:
[0034] A pre-installation environment boot medium and installation image source file acquisition module, used to acquire the pre-installation environment boot medium and installation image source file;
[0035] A target mobile disk determination module, used to calculate the file size of the pre-installation environment startup medium and the installation image source file, and determine the target mobile disk according to the file size;
[0036] A partition module, used for formatting the target mobile disk into different target partitions;
[0037] A copy module, used to copy the pre-installation environment boot medium and the installation image source file to the corresponding target partition;
[0038] A file format type acquisition module, used to verify the target partition, and when the verification passes, obtain the file format type from the installation image source file;
[0039] A compiling module, used for compiling a script of the pre-installation environment startup medium according to the file format type;
[0040] The installation module is used to use the script to perform image installation on the target device.
[0041] Optionally, the partitioning module includes:
[0042] A drive letter generation submodule, used for formatting the target mobile disk into different partitions and generating drive letters for each partition;
[0043] A judgment submodule, used to judge whether the partition is successfully created according to the drive letter;
[0044] A first return submodule, for returning to the step of formatting the target mobile disk into different partitions if no;
[0045] The target partition output submodule is used to output the partition as the target partition if so.
[0046] Optionally, the file format type acquisition module includes:
[0047] The file format type acquisition submodule is used to calculate the hash value of the target partition, and when the hash value meets a preset condition, obtain the file format type from the installation image source file.
[0048] The present invention also provides an electronic device, the device comprising a processor and a memory:
[0049] The memory is used to store program code and transmit the program code to the processor;
[0050] The processor is used to execute the pre-installation environment image installation method as described in any one of the above items according to the instructions in the program code.
[0051] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store program code, and the program code is used to execute the pre-installation environment image installation method as described in any one of the above items.
[0052] It can be seen from the above technical scheme that the present invention has the following advantages: the present invention discloses a method for installing a pre-installation environment image, which can specifically include: obtaining a pre-installation environment startup medium and an installation image source file; calculating the file size of the pre-installation environment startup medium and the installation image source file, and determining the target mobile disk according to the file size; formatting the target mobile disk into different target partitions; copying the pre-installation environment startup medium and the installation image source file to the corresponding target partition; verifying the target partition, and when the verification passes, obtaining the file format type from the installation image source file; compiling the script of the pre-installation environment startup medium according to the file format type; and using the script to perform image installation on the target device. The present invention automatically formats the partition after screening the target mobile disk, and detects whether the pre-installation environment startup medium and the installation image source file are successfully copied to the target partition, thereby reducing the errors caused by manual operation to format the partition; the present invention also compiles the script of the pre-installation environment startup medium according to the file format type in the installation image source file, thereby improving the compilation success rate and improving the efficiency of pre-installation environment image installation. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0054] Figure 1 A flowchart of the steps of a pre-installation environment image installation method provided by an embodiment of the present invention;
[0055] Figure 2 A flowchart of the steps of a pre-installation environment image installation method provided by another embodiment of the present invention;
[0056] Figure 3 A schematic diagram of a partition formatting and file copying process provided by an embodiment of the present invention;
[0057] Figure 4 A schematic diagram of a driver update process provided by an embodiment of the present invention;
[0058] Figure 5 A schematic diagram of a script compilation process provided by an embodiment of the present invention;
[0059] Figure 6 A structural block diagram of a pre-installation environment image installation device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The embodiments of the present invention provide a pre-installation environment image installation method, device, equipment and storage medium, which are used to solve the technical problem that formatting partition errors and editing errors may occur during manual operation and the efficiency is low.
[0061] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0062] See also Figure 1 , Figure 1 A flowchart of the steps of a pre-installation environment image installation method provided by an embodiment of the present invention.
[0063] The present invention provides a method for installing a pre-installation environment image, which may specifically include the following steps:
[0064] Step 101, obtaining the pre-installation environment boot medium and the installation image source file;
[0065] Preinstallation Environment, or WinPE, is a minimal Win32 subsystem with limited services, based on the Windows 3.x and above kernel running in full Windows environment or protected mode. Such systems are generally small. It includes the minimum functionality required to run Windows installation programs and scripts, connect to network shares, automate basic processes, and perform hardware verification.
[0066] In the embodiment of the present invention, the absolute paths of the pre-installation environment startup medium and the installation image source file may be searched, and the pre-installation environment startup medium and the installation image source file may be acquired from the absolute paths.
[0067] In the specific implementation, after obtaining the absolute path, first determine whether the absolute path contains the pre-installation environment boot medium and the installation image source file. If the file does not exist, the program terminates and prompts an error message; if the file exists, proceed to step 102.
[0068] Step 102, calculating the file sizes of the pre-installation environment boot medium and the installation image source file, and determining the target mobile disk according to the file sizes;
[0069] When the pre-installation environment startup medium and the installation image source file are found in the absolute path, the file sizes of the pre-installation environment startup medium and the installation image source file are calculated, and the user is prompted to select a target mobile disk with a suitable capacity to insert into the device.
[0070] Step 103, formatting the target mobile disk into different target partitions;
[0071] In the embodiment of the present invention, disk.exe can be used to format the target mobile disk into different target partitions, such as partition A of FAT32 and partition B of NTFS.
[0072] Step 104, copying the pre-installation environment boot medium and the installation image source file to the corresponding target partition;
[0073] After completing the formatting partition of the target mobile disk and verifying that the formatting partition is successful, you can copy the pre-installation environment boot media and the installation image source file to the corresponding target partition.
[0074] In an example, the pre-installation environment boot medium may be copied to the root directory of the A partition, and the installation image source file may be copied to the root directory of the B partition.
[0075] Step 105, verifying the target partition, and when the verification passes, obtaining the file format type from the installation image source file;
[0076] Step 106, compile a script of the pre-installation environment boot medium according to the file format type;
[0077] In the embodiment of the present invention, it can be determined whether the pre-installation environment boot medium and the installation image source file are successfully copied to the target partition. If the copy is successful, the file format type can be obtained from the installation image source file to compile the script of the pre-installation environment boot medium according to the file format type.
[0078] Step 107: Use a script to perform mirror installation on the target device.
[0079] In the embodiment of the present invention, after the script of the pre-installation environment startup medium is compiled, the script can be used to perform mirror installation on the target device.
[0080] The present invention reduces errors caused by manual operation of formatting partitions by automatically formatting partitions after screening the target mobile disk and by detecting whether the pre-installation environment startup medium and the installation image source file are successfully copied to the target partition; the present invention also compiles the script of the pre-installation environment startup medium according to the file format type in the installation image source file, thereby improving the compilation success rate and improving the efficiency of pre-installation environment image installation.
[0081] See also Figure 2 , Figure 2 A flowchart of a method for installing a pre-installation environment image is provided in another embodiment of the present invention. Specifically, the following steps may be included:
[0082] Step 201, obtaining the pre-installation environment boot medium and the installation image source file;
[0083] Step 202, calculating the file sizes of the pre-installation environment boot medium and the installation image source file, and determining the target mobile disk according to the file sizes;
[0084] Steps 201-202 are the same as steps 101-102. For details, please refer to the description of steps 101-102, which will not be repeated here.
[0085] Step 203, formatting the target mobile disk into different partitions and generating drive letters for each partition;
[0086] Step 204, judging whether the partition is created successfully according to the drive letter;
[0087] Step 205, if not, return to the step of formatting the target mobile disk into different partitions;
[0088] Step 206, if yes, output the partition as the target partition;
[0089] In one example, if Figure 3As shown in the figure, after the target mobile disk is inserted, it can automatically identify the inserted target mobile disk and mark the disk number, and then use Disk.exe to format the marked disk into FAT32 and NTFS. The program will mark the drive letters of the two target partitions respectively and detect whether the two partitions are successfully created; if the detection fails, it will try to format the partition again and set the upper limit of the number of retries (such as three times); if the three retries are still unsuccessful, an error will be reported through the disk partition unit and the program will be terminated.
[0090] Step 207, copying the pre-installation environment boot medium and the installation image source file to the corresponding target partition;
[0091] Step 208, calculating the hash value of the target partition, and when the hash value meets the preset condition, obtaining the file format type from the installation image source file;
[0092] In the embodiment of the present invention, after completing the formatting partition of the target mobile disk and verifying that the formatting partition is successful, the pre-installation environment boot medium and the installation image source file can be copied to the corresponding target partition. And the hash value is used to determine whether the pre-installation environment boot medium and the installation image source file are successfully copied to the target partition.
[0093] In one example, step 208 may include the following sub-steps:
[0094] S81, calculating a first hash value of a file in a target partition corresponding to the pre-installation environment boot medium;
[0095] S82, calculating a second hash value of a file in the target partition corresponding to the installation image source file;
[0096] S83, obtaining a third hash value of the pre-installation environment boot medium;
[0097] S84, obtaining a fourth hash value of the installation image source file;
[0098] S85, determining whether the first Hash value is the same as the third Hash value, or whether the second Hash value is the same as the fourth Hash value;
[0099] S86, if different, return to the step of copying the pre-installation environment boot medium and the installation image source file to the corresponding target partition;
[0100] In the specific implementation, Figure 3As shown, after the pre-installation environment boot medium and the installation image source file are copied to the corresponding target partition, the first hash value of the file in the target partition corresponding to the pre-installation environment boot medium and the second hash value of the file in the target partition corresponding to the installation image source file can be calculated; and the first hash value is compared with the third hash value of the corresponding pre-installation environment boot medium, and the second hash value is compared with the fourth hash value of the corresponding installation image source file. When both are the same, the representation file is copied correctly, and the copy process ends at this time and enters the next link. When either of the two is different, the representation file is copied incompletely and needs to be copied again; in order to avoid continuous repeated copying, the number of retries can be set, and the number of retries can be judged at each retry; when the number of retries is within the preset number, a retry is performed, and when the number of retries exceeds the preset number, an error is reported and the program ends.
[0101] S87, if they are the same, updating the driver of the pre-installation environment boot medium;
[0102] In actual scenarios, before entering the WinPE environment, a terminal (such as a computer) sometimes needs to add necessary drivers to the pre-installation environment boot media to enable certain functions. Therefore, when making WinPE, you need to add the required loaded drivers to the specified folder.
[0103] In one example, step S87 may include the following sub-steps:
[0104] S871, checking whether the preset designated folder is empty;
[0105] S872: If yes, it is determined that the pre-installation environment boot medium does not need to add a driver;
[0106] S873: If not, load the driver in the pre-installation environment startup medium.
[0107] In the specific implementation, Figure 4 As shown, first check whether the specified folder is empty; if the file is empty, the program automatically determines that no driver needs to be added; if the folder is not empty, traverse and install the drivers one by one. After the installation is complete, record the installed drivers and check whether these drivers already exist in the WinPE boot image. If the driver already exists, the module ends. If the driver does not exist, it is judged that the detection failed and the driver is reloaded until the maximum number of retries is reached. If the number of retries is exhausted and still unsuccessful, an error message is thrown and the relevant program is terminated.
[0108] S88, when the driver update is completed, the file format type is obtained from the installation image source file.
[0109] When the driver update is completed, the file format type can be obtained from the installation image source file to compile a script of the pre-installation environment startup medium according to the file format type.
[0110] Step 209, compile the script of the pre-installation environment boot medium according to the file format type;
[0111] like Figure 5 As shown, the file format may include WIM, FUU and others. If the file format type is detected to be WIM or FUU, the corresponding installation script is compiled according to the corresponding type; if it is detected not to be WIM or FUU, it is determined to be unsupported and the process ends.
[0112] Step 210: Use a script to perform mirror installation on the target device.
[0113] The present invention reduces errors caused by manual operation of formatting partitions by automatically formatting partitions after screening the target mobile disk and by detecting whether the pre-installation environment startup medium and the installation image source file are successfully copied to the target partition; the present invention also compiles the script of the pre-installation environment startup medium according to the file format type in the installation image source file, thereby improving the compilation success rate and improving the efficiency of pre-installation environment image installation.
[0114] See also Figure 6 , Figure 6 A structural block diagram of a pre-installation environment image installation device provided by an embodiment of the present invention.
[0115] An embodiment of the present invention provides a pre-installation environment image installation device, comprising:
[0116] A pre-installation environment boot medium and installation image source file acquisition module 601 is used to acquire a pre-installation environment boot medium and an installation image source file;
[0117] The target mobile disk determination module 602 is used to calculate the file size of the pre-installation environment boot medium and the installation image source file, and determine the target mobile disk according to the file size;
[0118] Partition module 603, used for formatting the target mobile disk into different target partitions;
[0119] A copy module 604 is used to copy the pre-installation environment boot medium and the installation image source file to the corresponding target partition;
[0120] The file format type acquisition module 605 is used to verify the target partition, and when the verification passes, obtain the file format type from the installation image source file;
[0121] A compiling module 606, used to compile a script of the pre-installation environment boot medium according to the file format type;
[0122] The installation module 607 is used to perform image installation on the target device using a script.
[0123] In the embodiment of the present invention, the partition module 603 includes:
[0124] The drive letter generation submodule is used to format the target mobile disk into different partitions and generate drive letters for each partition;
[0125] The judgment submodule is used to judge whether the partition is created successfully according to the drive letter;
[0126] A first return submodule, for returning to the step of formatting the target mobile disk into different partitions if no;
[0127] The target partition output submodule is used to output the partition as the target partition if yes.
[0128] In the embodiment of the present invention, the file format type acquisition module 605 includes:
[0129] The file format type acquisition submodule is used to calculate the hash value of the target partition, and when the hash value meets a preset condition, obtain the file format type from the installation image source file.
[0130] In an embodiment of the present invention, the file format type acquisition submodule includes:
[0131] A first hash value calculation unit, used to calculate a first hash value of a file in a target partition corresponding to the pre-installation environment boot medium;
[0132] A second hash value calculation unit, used to calculate a second hash value of a file in a target partition corresponding to the installation image source file;
[0133] A third Hash value obtaining unit, used to obtain a third Hash value of the pre-installation environment boot medium;
[0134] A fourth Hash value obtaining unit, used to obtain a fourth Hash value of the installation image source file;
[0135] A hash value determination unit, used to determine whether the first hash value is the same as the third hash value, or whether the second hash value is the same as the fourth hash value;
[0136] A second returning unit is used for returning to the step of copying the pre-installation environment boot medium and the installation image source file to the corresponding target partition if they are different;
[0137] A driver updating unit, used for updating the driver of the pre-installation environment boot medium if they are the same;
[0138] The file format type obtaining unit is used to obtain the file format type from the installation image source file after the driver update is completed.
[0139] In an embodiment of the present invention, a driver update unit includes:
[0140] The check subunit is used to check whether the preset specified folder is empty;
[0141] A determination subunit, for determining that if yes, no driver needs to be added to the pre-installation environment boot medium;
[0142] The loading subunit is used to load the driver in the pre-installation environment startup medium if not.
[0143] An embodiment of the present invention further provides an electronic device, the device comprising a processor and a memory:
[0144] The memory is used to store the program code and transmit the program code to the processor;
[0145] The processor is used to execute the pre-installation environment image installation method of the embodiment of the present invention according to the instructions in the program code.
[0146] The embodiment of the present invention further provides a computer-readable storage medium, which is used to store program codes, and the program codes are used to execute the pre-installation environment image installation method of the embodiment of the present invention.
[0147] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0148] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0149] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0150] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0151] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0152] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0153] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0154] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0155] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for installing a pre-installation environment image, characterized in that: include: Obtain the pre-installation environment boot media and installation image source files; Calculating the file sizes of the pre-installation environment startup medium and the installation image source file, and determining the target mobile disk according to the file sizes; Formatting the target mobile disk into different target partitions; Copying the pre-installation environment boot medium and the installation image source file to the corresponding target partition; Verifying the target partition, and when the verification passes, obtaining a file format type from the installation image source file; Compiling a script of the pre-installation environment startup medium according to the file format type; The script is used to perform image installation on the target device.
2. The method according to claim 1, characterized in that The step of formatting the target mobile disk into different target partitions comprises: Formatting the target mobile disk into different partitions and generating drive letters for each partition; Determine whether the partition is created successfully according to the drive letter; If not, return to the step of formatting the target mobile disk into different partitions; If so, the partition is output as the target partition.
3. The method according to claim 1, characterized in that: The step of verifying the target partition and obtaining the file format type from the installation image source file when the verification passes includes: A hash value of the target partition is calculated, and when the hash value meets a preset condition, a file format type is obtained from the installation image source file.
4. The method according to claim 3, characterized in that The step of calculating the hash value of the target partition and obtaining the file format type from the installation image source file when the hash value meets a preset condition includes: Calculate a first hash value of a file in a target partition corresponding to the pre-installation environment boot medium; Calculate a second hash value of a file in the target partition corresponding to the installation image source file; Obtaining a third hash value of the pre-installation environment boot medium; Obtaining a fourth hash value of the installation image source file; Determine whether the first Hash value is the same as the third Hash value, or whether the second Hash value is the same as the fourth Hash value; If they are different, return to the step of copying the pre-installation environment boot medium and the installation image source file to the corresponding target partition; If they are the same, updating the driver of the pre-installation environment boot medium; When the driver update is completed, the file format type is obtained from the installation image source file.
5. The method according to claim 4, characterized in that The step of updating the driver of the pre-installation environment boot medium includes: Check if the preset specified folder is empty; If yes, determining that the pre-installation environment boot medium does not need to add a driver; If not, the driver is loaded into the pre-installation environment startup medium.
6. A pre-installation environment image installation device, characterized in that: include: A pre-installation environment boot medium and installation image source file acquisition module, used to acquire the pre-installation environment boot medium and installation image source file; A target mobile disk determination module, used to calculate the file size of the pre-installation environment startup medium and the installation image source file, and determine the target mobile disk according to the file size; A partition module, used for formatting the target mobile disk into different target partitions; A copy module, used to copy the pre-installation environment boot medium and the installation image source file to the corresponding target partition; A file format type acquisition module, used to verify the target partition, and when the verification passes, obtain the file format type from the installation image source file; A compiling module, used for compiling a script of the pre-installation environment startup medium according to the file format type; The installation module is used to use the script to perform image installation on the target device.
7. The device according to claim 6, characterized in that The partition module comprises: A drive letter generation submodule, used for formatting the target mobile disk into different partitions and generating drive letters for each partition; A judgment submodule, used to judge whether the partition is successfully created according to the drive letter; A first return submodule, for returning to the step of formatting the target mobile disk into different partitions if no; The target partition output submodule is used to output the partition as the target partition if so.
8. The device according to claim 6, characterized in that The file format type acquisition module includes: The file format type acquisition submodule is used to calculate the hash value of the target partition, and when the hash value meets a preset condition, obtain the file format type from the installation image source file.
9. An electronic device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the pre-installation environment image installation method according to any one of claims 1-4 according to the instructions in the program code.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program code, and the program code is used to execute the pre-installation environment image installation method according to any one of claims 1 to 4.
