Skip to content

Commit e6baace

Browse files
committed
fix: 修复ntldr引导错误
1 parent c11a944 commit e6baace

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/view/controller/Install/toUDisk.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { checkIsReady, getHotPEDriveLetter } from "./check"
77
import { ReactNode } from "react"
88
import { getUsableLetter } from "../../utils/disk/diskInfo"
99
import { migrateHPM } from "../hpm/hpm"
10-
const fs = window.require('fs')
10+
const fs = window.require('fs') as typeof import('fs')
1111

1212
const tempPath = roConfig.path.clientTemp + 'install\\peFiles\\'
1313

@@ -17,13 +17,18 @@ const pecmdPath = roConfig.path.tools + 'PECMD.exe'
1717
const fbplusPath = roConfig.path.tools + 'fbplus.exe'
1818

1919
async function xPartFiles(ISOPath: string, xEFIPath: string, xDataPath: string) {
20-
const EFI_List: string[] = ["EFI", "Boot", "HotPE\\Boot.wim", "bootmgr", "bootmgr.efi", "ventoy.dat"]
20+
const EFI_List: string[] = ["EFI", "Boot", "HotPE\\Boot.wim", "bootmgr", "bootmgr.efi", "ntldr", "ventoy.dat"]
2121
const Data_List: string[] = ["HotPE -xr!Boot.wim", "HotProgMods", "AUTORUN.INF", "HotPE.ico"]
2222

23-
//解压ISO文件
23+
//解压ISO文件EFI 分区
2424
for (const tList of EFI_List) {
2525
await unZipFile(ISOPath, xEFIPath, tList)
2626
}
27+
if (!fs.existsSync(xEFIPath + 'ntldr')) {
28+
await copyFile(xEFIPath + 'bootmgr', xEFIPath + 'ntldr')
29+
}
30+
31+
//解压ISO文件Data 分区
2732
for (const tList of Data_List) {
2833
await unZipFile(ISOPath, xDataPath, tList)
2934
}

0 commit comments

Comments
 (0)