Dec 21 2003, 08:38 AM Post
#1 | |
| Junior ![]() Group: Members Posts: 84 Joined: 4-December 03 Member No.: 10361 OS: none | Major Update 12. Sep 2004 (finally!) You want to install PnP-drivers directly from the CD? Or extract them from an archive before installation? Maybe you want a repair cd without winnt.sif but with custom drivers? All this is possible. NOTE: this only works with drivers that have an .inf! I did some programming in my (rare) spare time and created some custom tools to accomplish the above. This is what you have to do: 1. download the following files: (updated: 12. Sep 2004) SETUP.EX_ ca. 2K presetup.cmd ca. 1K SetDevicePath.exe ca. 12K WatchDriverSigningPolicy.exe ca. 4K In case you are having problems, try this: setup_dbg.exe ca. 5K This works exactly like the above one, except that the window of presetup.cmd is visible, so you can see what is happening. (You have to rename it to setup.exe and cab it yourself) 2. create a directory OEM\bin in the root of your CD-folder and copy WatchDriverSigningPolicy.exe and SetDevicePath.exe into it. 3. go to your I386 directory and uncab SETUP.EX_ like this: CODE expand SETUP.EX_ setupORG.exe 4. copy my SETUP.EX_ to your I386 directory and overwrite the old one. 5. copy my presetup.cmd to your I386 directory. This is an example file which assumes that all user related files reside in \OEM\bin on the CD. Feel free to change it to your needs, I added some comments, shouldn't be too hard. 6. create a directory OEM\drivers in the root of your CD-folder and copy your uncompressed drivers there OR create an archive containing your drivers and put them on the CD, for example OEM\drivers.7z or OEM\data\mydrivers.rar... you get the idea. You can sort them into subdirectories, these will be scanned recursively by SetDevicePath.exe. 7. edit TXTSETUP.SIF directly under [SourceDisksFiles] to include the following entries: CODE setupORG.exe = 1,,,,,,,2,0,0 presetup.cmd = 1,,,,,,,2,0,0 These two are absolutely neccessary, everything else can come from CD later on. Done. This is what happens during installation After the first reboot the installation starts in GUI-mode and executes "setup.exe -newsetup". Well, it *thinks* it does... My setup.exe executes presetup.cmd first (the window is hidden by design) which in turn starts the original setup. It waits till presetup.cmd terminates, then it terminates itself and Windows reboots. So as you might have guessed already, the neat stuff happens in presetup.cmd. The driveletter of the CD is searched first: CODE set tagfile=\WIN51 for %%i in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist "%%i:%tagfile%" set CDDRIVE=%%i: (thanks to serialsz for the shorter version, slightly modified) Remark: note that the tagfile might be different for you. You might have to change it to '\WIN51IP' or '\WIN51.SP2'. Uncompressed drivers directly on CD If they are uncompressed on the CD, just do it like this: CODE %CDDRIVE%\OEM\bin\SetDevicePath.exe %CDDRIVE%\OEM\drivers The drivers directory on the CD is scanned for subdirectories. The list of subdirectories is then written to HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DevicePath. ("%SystemRoot%\Inf" is added in front of it) Compressed drivers from an archive In case you want to use compressed drivers (and who wouldn't want to Unsigned drivers Now comes the tricky part. The installation of unsigned drivers will trigger the usual warning messages. So you may think: "No problem. I just change the 'HKLM\Software\Microsoft\Driver Signing' value in HIVESFT.INF!" Should work, but does not. Windows Setup resets the "Driver Signing" entries when it starts. The following line in presetup.cmd will take care of this issue. CODE start %CDDRIVE%\OEM\bin\WatchDriverSigningPolicy.exe (the 'start' is important, or presetup.cmd will hang!) It installs a notification hook on the "Driver Signing" regkey and changes it back whenever necessary. It changes another key as well: The geniuses at Microsoft implemented a mechanism to disallow the change of the "Driver Signing" keys through regkeys, which is a good thing but at the same time they build a backdoor for circumventing this mechanism. HKCU\Software\Policies\Microsoft\Windows NT\Driver Signing\BehaviorOnFailedVerify (=0) This essentially means that when Windows finds out that the policies have been tampered with, it just does not care... Things to do after the installation: Microsoft recommends to reset the DevicePath to "%SystemRoot%\Inf" after setup: CODE REGEDIT4 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion] "DevicePath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,\ 00,74,00,25,00,5c,00,49,00,6e,00,66,00,00,00 If you used WatchDriverSigningPolicy.exe, you should reset the appropriate keys if you don't want unsigned drivers to be installed without warning: CODE REGEDIT4 [HKEY_CURRENT_USER\Software\Microsoft\Driver Signing] "Policy"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Driver Signing] "Policy"=hex:01 [HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows NT\Driver Signing] "BehaviorOnFailedVerify"=dword:00000001 (Apparently this does not work at the end of presetup.cmd after the invocation of setup.exe. It seems that Windows is in some weird limbo state there and registry-changes are ignored/reset.) Final notes: Please note that you cannot start all programs in presetup.cmd. The environment is rather limited at this point of the setup. regedit.exe for example does not work, but reg.exe does. taskmgr.exe does not work either. They will work a minute later, when the real setup has started. rundll32.exe works so you can install custom infs. WinRAR-sfx-archives only work with consolemode-sfx-module, 7z-sfx archives work out of the box. (figured out by edmoncu here) BTW, things added to RunOnce will be executed somewhere at mark 34min, parallel to the driver installation. RunOnceEx gets executed at mark 13min, as usual. You can also use AutoIt to automate the installation in case you don't want to use winnt.sif. (for a repair cd) My old version of setup.exe started GUI-setup automatically after presetup.cmd had finished, this new one does not! You have to do it youself at the end of presetup.cmd. This way you can do stuff after setup as well, like cleanup. This version of setup.exe forwards its parameters to presetup.cmd. This means that you should start the installation like this: CODE setup.exe %* (thanks, Biggles, for the shorter version) in case Windows wants to do some special stuff, like ASR (Automated System Recovery). This was mentioned by ovilla2001 here, although he reported the repair option failed, I just assume he meant ASR. (AFAIK "-newsetup" is used by normal and repair setup, only the entries in $winnt.inf$ change)SetupORG.exe must be renamed to setup.exe before installation to resolve a bad signature issue reported by ovilla2001 here, look into the example presetup.cmd to see how this is to be done. -- Pyron |
| | |
Pyron SOLVED: drivers from CD Dec 21 2003, 08:38 AM
Spooky Thank you Pyron. All I do is point to a .cmd file ... Dec 21 2003, 09:35 AM
stinkywea wow, this may be a huge help...does it still matte... Dec 21 2003, 09:39 AM
Pyron Well, actually I never tried this with an unattend... Dec 21 2003, 10:30 AM
Bachus Interesting...very interesting. This should work ... Dec 21 2003, 11:55 AM
Gism0 woah, very very good work Dec 21 2003, 12:22 PM
Pyron @Bachus:
It *should* work for Windows 2000, but I ... Dec 21 2003, 12:50 PM
disgraceful33 this'd be great, too bad the only drivers i ha... Dec 21 2003, 01:17 PM
Bachus Finally getting around to implementing this and I ... Dec 25 2003, 03:31 PM
Alanoll QUOTE then the drivers directory on the CD is scan... Dec 25 2003, 08:02 PM
Pyron SetDevicePath.exe scans a directory recursively fo... Dec 26 2003, 12:35 PM
bucketbuster Hi,
what should I do with the PnPDriversPath entr... Dec 30 2003, 04:17 PM
Alanoll QUOTE (bucketbuster @ Dec 30 2003, 04:17 PM)H... Dec 30 2003, 06:22 PM
eirogge Thank you very much for this effort in unattended ... Mar 18 2004, 11:56 AM
Bilou_Gateux @Bachus
for Windows 2000, i suggest to edit prese... Mar 21 2004, 04:32 AM
Pyron @Bilou_Gateux:
I simply use RegCreateKeyEx to set... Mar 26 2004, 12:29 PM
Alanoll the Driver Policy key is restet when GUI install s... Mar 26 2004, 03:02 PM
eirogge QUOTE (Alanoll @ Mar 26 2004, 11:02 PM)why di... Mar 30 2004, 12:09 AM
RyanVM So let me get this right. We're omitting the ... May 5 2004, 08:11 PM
RyanVM Argh, so much information to absorb... May 5 2004, 08:13 PM
Alanoll this is true, but if you wanted to save space on y... May 5 2004, 09:15 PM
RyanVM There's two possibilities I'm seeing: Firs... May 5 2004, 09:35 PM
Alanoll this is true....
you would have one file to copy o... May 5 2004, 09:36 PM
RyanVM Just for the sake of experimenting, I made a solid... May 6 2004, 06:29 AM
Alanoll use DetachdProgram
that should get it there befor... May 6 2004, 06:50 AM
RyanVM If I understand how DetachedProgram works, it runs... May 6 2004, 07:37 AM
Bâshrat the Sneaky I've been trying to do this too. I've made... May 6 2004, 11:32 AM
RyanVM By george, it worked like a charm!
And Bashra... May 6 2004, 01:43 PM
Alanoll ::marks another on the board for good ideas::
wow... May 6 2004, 01:59 PM
RyanVM For those using WinRAR to achieve this, this is my... May 7 2004, 07:25 AM
Alanoll what I like about this method (the one at the begi... May 7 2004, 07:59 AM
Alanoll I'm going to pin this topic. It could come in ... May 7 2004, 08:00 AM
RyanVM QUOTE (Alanoll @ May 7 2004, 07:59 AM)what I ... May 7 2004, 08:14 AM
Alanoll yeah more stuff.....
go DVD!! I still go... May 7 2004, 08:44 AM
RyanVM QUOTE (Alanoll @ May 7 2004, 08:44 AM)yeah mo... May 7 2004, 08:55 AM
Alanoll yeah, that office sends it over the limit.
wish ... May 8 2004, 10:32 PM
edmoncu im sorry guys if i didn't got it correctly ,... May 14 2004, 11:15 AM
Alanoll yes.
I personally use a slightly modified version... May 14 2004, 02:02 PM
edmoncu WOW!
Does this approach work when combined w... May 18 2004, 02:45 PM
Alanoll no. Not what you're doing. You'r trying to... May 18 2004, 02:50 PM
edmoncu i wonder if files are case-sensitive. i had an err... May 18 2004, 08:22 PM
edmoncu sorry, made a double post. please disregard this o... May 18 2004, 08:22 PM
RyanVM I'm not exactly sure what you're talking a... May 18 2004, 08:30 PM
edmoncu @Alanoll, so in doing this method, aside from REM... May 18 2004, 08:42 PM
Alanoll don't REM the lines. To comment in the Winnt.s... May 18 2004, 11:54 PM
edmoncu @Alanoll,
Oh, I get it now (I hope)! Thanks... May 19 2004, 01:25 AM
edmoncu hmm, it seems that the SFX archive needs to use Wi... May 19 2004, 04:36 PM
edmoncu would like to ask a followup question though, unde... May 20 2004, 09:15 AM
Alanoll Windows doesn't really determine the order bas... May 20 2004, 08:48 PM
edmoncu thanks Alanoll.
btw, just a note, sfx-winrar arc... May 21 2004, 02:33 AM
Bâshrat the Sneaky QUOTE (edmoncu @ May 21 2004, 10:33 AM)thanks... May 21 2004, 02:43 AM
edmoncu btw, just to be sure, i had to supply the switches... May 21 2004, 03:17 AM
Bâshrat the Sneaky QUOTE (edmoncu @ May 21 2004, 11:17 AM)btw, j... May 21 2004, 03:29 AM
RyanVM How does one tell a 7zip SFX archive to extract au... May 21 2004, 06:26 AM
Bâshrat the Sneaky QUOTE (RyanVM @ May 21 2004, 02:26 PM)How doe... May 21 2004, 07:29 AM
edmoncu @Bâshrat the Sneaky:
ooops im sorry, i didnt get y... May 21 2004, 07:46 AM
RyanVM Interesting, I'll have to play with that idea.... May 21 2004, 08:09 AM
edmoncu yup. even if executed via the DetachedProgram meth... May 21 2004, 08:37 AM
RyanVM QUOTE (edmoncu @ May 21 2004, 10:37 AM)yup. e... May 21 2004, 08:59 AM
edmoncu oh, may i know which part am i incorrect?
/me s... May 21 2004, 10:36 AM
RyanVM WinRAR SFX Windows GUI module extracting at the T3... May 21 2004, 10:39 AM
edmoncu oh i see... i stand myself corrected then. May 21 2004, 11:26 AM
Bâshrat the Sneaky QUOTE (RyanVM @ May 21 2004, 06:39 PM)WinRAR ... May 22 2004, 03:01 AM
edmoncu same here... that is when i use the detachedprogra... May 22 2004, 06:06 AM
Bâshrat the Sneaky QUOTE (edmoncu @ May 22 2004, 02:06 PM)same h... May 22 2004, 09:18 AM
edmoncu i tried the Default.sfx module. although when i tr... May 22 2004, 10:10 AM
RyanVM QUOTE (RyanVM @ May 7 2004, 09:25 AM)For thos... May 22 2004, 11:03 AM
RaveRod Hmm... don't know quite what's wrong here.... Jun 26 2004, 03:42 AM
Bâshrat the Sneaky CMD is not available at that stage. You've got... Jun 26 2004, 04:27 AM
RaveRod FIXED IT! Never actually thought, change it fr... Jun 26 2004, 05:08 AM
iSmart This cool method doesn't allow to install RAID... Jun 26 2004, 05:52 AM
RaveRod In relation to my first post, I have given up on t... Jun 27 2004, 08:05 AM
bilemke @RaveRod
perhaps could you try setting the variab... Jun 29 2004, 11:10 PM
Alanoll QUOTE (iSmart @ Jun 26 2004, 06:52 AM)This co... Jun 29 2004, 11:32 PM
edmoncu quick question: i heard from the early part of the... Jul 19 2004, 01:17 AM
Pyron Just checked, it works.
But you need to change th... Jul 19 2004, 03:25 AM
edmoncu wow cool! i'll try it! thanks! Jul 19 2004, 05:48 PM
bilemke QUOTE (Alanoll @ Jun 29 2004, 11:32 PM)QUOTE ... Jul 22 2004, 12:33 AM
twindude have a problem......these directions are great and... Jul 27 2004, 02:20 PM
bilemke @twindude
you talking to me?
If so, you can s... Jul 28 2004, 06:09 PM
Pyron @bilemke:
As far as I know, textmode-setup writes ... Jul 29 2004, 01:59 AM
bilemke Thanks for the info Pyron.. It has been a while si... Jul 30 2004, 01:29 AM
bilemke BTW.. googling for $winnt$.sif.. already... Jul 30 2004, 01:37 AM
ovilla2001 Did someone already test this solution with SP2?
W... Aug 4 2004, 01:23 AM
Pyron 1 - You probably cannot change the setup.exe durin... Aug 4 2004, 01:49 AM
ovilla2001 well....I working since 3AM.
The last "solut... Aug 4 2004, 03:21 AM
bilemke Perhaps.. can we change what setup.exe loads soone... Aug 4 2004, 02:13 PM
ovilla2001 That is what I was trying to suggest with my poor ... Aug 4 2004, 04:26 PM
bilemke @ovilla2001
Sounds close, renaming the exe will n... Aug 4 2004, 06:19 PM
ovilla2001 Yes Bilimke, I know that... but believe me... the ... Aug 4 2004, 06:38 PM
bilemke @ovilla2001
ah-ha
No harm intended.. Rename comma... Aug 5 2004, 01:43 AM
Alanoll QUOTE (ovilla2001 @ Aug 4 2004, 05:26 PM)That... Aug 9 2004, 08:21 AM
ovilla2001 Alanoll
Well, how I worte before, in T-8 (or some... Aug 9 2004, 08:38 AM
Alanoll no no, I understand the renaming (i believe I... Aug 9 2004, 10:06 AM
Pyron After renaming setupORG.exe to setup.exe it cannot... Aug 10 2004, 05:42 AM
Alanoll it may be neccesary. Atleast for me....
I still ha... Aug 10 2004, 08:33 AM
Pyron BTW: It has to be started like this:
CODEsetup.exe... Aug 10 2004, 09:06 AM
Alanoll I shall add that.....
And yes I did miss that. At... Aug 10 2004, 09:41 AM
Pyron I attach the exetutable I am currently using.
It i... Aug 11 2004, 01:34 AM
sezz does it work with sp2 (final) now? Aug 11 2004, 02:13 AM![]() ![]() |
| Lo-Fi Version | Time is now: 20th November 2009 - 11:18 PM |