无忧启动论坛

标题: [分享]不用第三方软件实现自动安装HAL [打印本页]

作者: chaiyw    时间: 2005-9-16 11:50
标题: [分享]不用第三方软件实现自动安装HAL
[这个贴子最后由chaiyw在 2005/09/16 01:35pm 第 1 次编辑]

不用第三方软件实现自动安装HAL
SYSPREP封装安装完成后;windows下生成一个setupact.log的日志.里面包含硬件信息.
我们只要找 acpiapic_up 这类电源标识,再用RUNDLL32来安装.
下面两种方法任选一种.第一种有出现安装盘提示,按取消就可以了.
修改sysprep.inf
1、
[Unattended]
    OemSkipEula=Yes
    DriverSigningPolicy=Ignore
    InstallFilesPath=C:\sysprep\i386
    TargetPath=\WINDOWS
注:安装结束后运行sysprep\i386\$oem$\cmdlines.txt中指定的程序;
程序应在同一目录,不在同目录则指定路径;
cmdlines.txt内容如:
[Commands]
"sethal.cmd"
2、
[GuiRunOnce]
    Command0=%SystemRoot%\sethal.cmd
注:%SystemRoot%即windows,这是第一次启动运行.
将下面存为 sethal.cmd
@echo off
REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E966-E325-11CE-BFC1-08002BE10318}\0000" /f
REG DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E966-E325-11CE-BFC1-08002BE10318}\0001" /f
REG DELETE "HKLM\SYSTEM\ControlSet001\Control\Class\{4D36E966-E325-11CE-BFC1-08002BE10318}\0000" /f
REG DELETE "HKLM\SYSTEM\ControlSet001\Control\Class\{4D36E966-E325-11CE-BFC1-08002BE10318}\0001" /f
REG DELETE "HKLM\SYSTEM\CurrentControlSet\Enum\Root\ACPI_HAL" /f
REG DELETE "HKLM\SYSTEM\CurrentControlSet\Enum\Root\PCI_HAL" /f
find /i "ACPIPIC_UP" %windir%\setupact.log && goto ACPI
find /i "ACPIAPIC_UP" %windir%\setupact.log && goto APICUP
find /i "ACPIAPIC_MP" %windir%\setupact.log && goto APICMP
find /i "MPS_UP" %windir%\setupact.log && goto MPSUP
find /i "MPS_MP" %windir%\setupact.log && goto MPSMP
find /i "SYSPRO_MP" %windir%\setupact.log && goto SYSPROMP
find /i "E_ISA_UP" %windir%\setupact.log && goto EISAUP
goto EISAUP
:ACPI
rundll32.exe setupapi,InstallHinfSection ACPIPIC_UP_HAL 131 %windir%\inf\hal.inf
goto end
:APICUP
rundll32.exe setupapi,InstallHinfSection ACPIAPIC_UP_HAL 131 %windir%\inf\hal.inf
goto end
:APICMP
rundll32.exe setupapi,InstallHinfSection ACPIAPIC_MP_HAL 131 %windir%\inf\hal.inf
goto end
:MPSUP
rundll32.exe setupapi,InstallHinfSection MPS_UP_HAL 131 %windir%\inf\hal.inf
goto end
:MPSMP
rundll32.exe setupapi,InstallHinfSection MPS_MP_HAL 131 %windir%\inf\hal.inf
goto end
:SYSPROMP
rundll32.exe setupapi,InstallHinfSection SYSPRO_MP_HAL 131 %windir%\inf\hal.inf
goto end
:EISAUP
rundll32.exe setupapi,InstallHinfSection E_ISA_UP_HAL 131 %windir%\inf\hal.inf
goto end
:end
@exit
====================================================================================
REG DELETE 段删除原有电源信息;find /i段查找日志中的电源信息; rundll32 段安装电源驱动;
确保windows\Driver Cache\i386\driver.cab和SP*.cab 这两个文件;
====================================================================================
附:
在还原安装运行前手动选择电源模式方法:
上面sethal.cmd fing /i 段参考wbat.com的菜单方式修改;
文件名为sethal.bat保存sysprep目录;
封装后;
REG EXPORT HKLM\SYSTEM\Setup %SystemDrive%\sysprep\reg.bak
REG ADD HKLM\SYSTEM\Setup /v CmdLine /t REG_MULTI_SZ /d "%SystemDrive%\sysprep\sethal.bat" /f
sethal.bat中前段加
REG IMPORT %SystemDrive%\sysprep\reg.bak
自动模式保存sethal.cmd至windows;
手动模式保存sethal.bat_wbat.cmd_w.bat 至sysprep;
附件hal.rar里有sethal.bat和sethal.cmd作为参考;[UploadFile=hal_1126842649.rar]
作者: fxb117    时间: 2005-9-16 12:06
提示: 作者被禁止或删除 内容自动屏蔽
作者: roy123    时间: 2005-9-16 13:06
标题: [分享]不用第三方软件实现自动安装HAL
太烦琐
作者: willsion    时间: 2005-9-21 19:51
标题: [分享]不用第三方软件实现自动安装HAL
值得学习
作者: yujun    时间: 2005-9-22 21:46
标题: [分享]不用第三方软件实现自动安装HAL
值得学习

作者: 6618    时间: 2005-9-23 08:47
标题: [分享]不用第三方软件实现自动安装HAL
不错,值得学习。
作者: chenall    时间: 2005-9-23 10:15
标题: [分享]不用第三方软件实现自动安装HAL
感觉并不是很适用.
作者: 紫狐    时间: 2005-9-23 16:07
标题: [分享]不用第三方软件实现自动安装HAL
这样封装后是不是只能使用于系统HAL的机器呀?因为SYSPREP封装安装完成后;windows下生成一个setupact.log的日志.里面包含硬件信息应该是本机的硬件信息吧?




欢迎光临 无忧启动论坛 (http://wuyou.net/) Powered by Discuz! X3.3