|
与vboot相关部分的代码:
--导入vboot的注册表
File.Run(SessionVar.Expand("reg load hklm\\111 \""..VHD_LETTER..":\\windows\\system32\\config\\system\" "), "", "", SW_MINIMIZE, true);
File.Run(SessionVar.Expand("reg add HKLM\\111\\ControlSet001\\Control\\CriticalDeviceDatabase\\gen_scsiadapter /f "), "", "", SW_MINIMIZE, true);
File.Run(SessionVar.Expand("reg add HKLM\\111\\ControlSet001\\Control\\CriticalDeviceDatabase\\gen_scsiadapter /v Service /t REG_SZ /d vbootdsk /f "), "", "", SW_MINIMIZE, true);
File.Run(SessionVar.Expand("reg add HKLM\\111\\ControlSet001\\Control\\CriticalDeviceDatabase\\gen_scsiadapter /v ClassGUID /t REG_SZ /d {4D36E97B-E325-11CE-BFC1-08002BE10318} /f "), "", "", SW_MINIMIZE, true);
File.Run(SessionVar.Expand("reg add HKLM\\111\\ControlSet001\\Control\\CriticalDeviceDatabase\\gen_scsitest /v Type /t REG_dword /d 1 /f "), "", "", SW_MINIMIZE, true);
File.Run(SessionVar.Expand("reg add HKLM\\111\\ControlSet001\\Services\\vbootdsk /f"), "", "", SW_MINIMIZE, true);
File.Run(SessionVar.Expand("reg add HKLM\\111\\ControlSet001\\Services\\vbootdsk /v Type /t REG_dword /d 1 /f "), "", "", SW_MINIMIZE, true);
File.Run(SessionVar.Expand("reg add HKLM\\111\\ControlSet001\\Services\\vbootdsk /v Start /t REG_dword /d 0 /f "), "", "", SW_MINIMIZE, true);
File.Run(SessionVar.Expand("reg add HKLM\\111\\ControlSet001\\Services\\vbootdsk /v ErrorControl /t REG_dword /d 1 /f "), "", "", SW_MINIMIZE, true);
File.Run(SessionVar.Expand("reg add HKLM\\111\\ControlSet001\\Services\\vbootdsk /v ImagePath /t REG_SZ /d \"system32\\drivers\\vbootdsk.sys\" /f "), "", "", SW_MINIMIZE, true);
File.Run(SessionVar.Expand("reg delete HKLM\\111\\MountedDevices /v \\DosDevices\\C: /f "), "", "", SW_MINIMIZE, true);
File.Run(SessionVar.Expand("reg unload hklm\\111 "), "", "", SW_MINIMIZE, true);
--复制 vboot的驱动
File.Copy(_TempLaunchFolder.."\\VBOOTDSK.SYS", VHD_LETTER..":\\windows\\system32\\drivers\\VBOOTDSK.SYS", true, true, false, true, nil); |
|