Jump to content

Setting DevicePath in registry during T-39


Recommended Posts

Posted (edited)

I want to have my DevicePath-key automatically set at the T-39 minute stage, by means of a DetachedProgram. I know that a program called SetDevicePath.exe exists, but I want to create it in a script, so that I can add/modify my own things...

I currently run this script as a detachedProgram, and it does change the DevicePath entry correctly in the registy (complete with %systemdrive% and all), however it seems like when this script is run, Windows Setup has already read the values from the Registry, because my custom drivers aren't installed..

I use this script:

@echo off

set drivers_path=%SystemDrive%\drivers
set drivers_prefix=%%SystemDrive%%\drivers

set newPath=%%SystemRoot%%\inf
call :traverse %drivers_path%
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion /v DevicePath /t REG_EXPAND_SZ /d %newPath% /f
goto :eof

:traverse
 pushd %~f1
 if EXIST *.inf (
   set curPath=%drivers_prefix%%~2
   call set newPath=%%newPath%%;%%curPath%%
 )
 for /d %%I in (*) do (
   call :traverse "%%I" "%2\%%I"
 )
 popd
goto :eof

Who can help me out?

Note:

I already have a solution where you can automatically add entries to the winnt.sif file. Look here if interested. So that is, before the installation, at ISO-creation time. But now I want to create a script that does this at Install-time.

Edited by Afterdawn

Posted

:lol: I've come so for already, I won't resort to using Pyron's files after all...

Yes I'm thinking about running it prior to setup too... well I'll try that.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...