MadBoy

Drivers Instalation in Post-Install stage (New Method)

620 posts in this topic

This seems handy! But I would appreciate the source-code...

Written in AutoIT, isn't it?

Thanx!

0

Share this post


Link to post
Share on other sites

Yes, it's written in autotit. But i wouldn't like to release it, at least not yet as there is a lot more to cover with this program. I don't want all the work i have put it in .. to be lost within a few minutes. If you're wondering if there's malicious code.. well there isn't. But i guess i can't realy convince you, if you think so.

0

Share this post


Link to post
Share on other sites

Well, I'm not the suspicious kind, but I do hate reinventing the wheel because I'd like to adapt some of your prog to work in conjunction with seupcopyoeminf.exe.

So what I mean by that, is doing a scan of all present hardware devices and integrating only the needed drivers. That way you won't need a devicepath setting, which is linked to 4096 chars.

Another thing is the skinning/GUI. (less importance)

I don't really care about having credit for any program, so I'd gladly give my extra source back to you to perhaps use the new ideas.

0

Share this post


Link to post
Share on other sites

Well copyoeminf.exe is great proggy and i can add it to my program without big problem. It has one big disadvantage (that's why i decided to go with device path instead). It copies every inf .. including those that won't be used. I tried it few times with all the drivers from bashrat (think it was his drivers package). Over 700mb. And i ended up few waiting few minutes, or more waiting and watching screen as each .inf is getting copied one by one. Of course it can be used for much smaller amount of drivers and it will work fine and as fast. If you want i can 'add' copyoeminf.exe in some next version within days. Or if you know the routine how copyoeminf works (since i am not sure if all it does is going thru drivers dirs and copying nfo or also doing something else. When i get that info it shouldn't be problem to reproduce it in autoit and add it as option to choose if you wanna use setdevicepath or copyoeminf routine. Just another variable in hardware.ini.

Atm i have bigger problem that needs to be solved and when it gets solved i can preety much add more things into it. Devcon behaviour is a bit unpredictable to me. "devcon remove =Unknown" works the first time it's started (even on polish system). Then devcon rescan .. rescans devices. It's all fine and works. But if by accident it won't find drivers for any of those removed devices.. devcon doesn't care anymore. Running "devcon remove =Unknown" second time won't show any results (and in device manager you can clearly see unknown device, just it seems invisible for devcon). Maybe you can help on this?

0

Share this post


Link to post
Share on other sites

Ok man, no problemo, just solve your current problems and build things from there.

About the devcon output... I don't know about that, but I think the devcon sourcecode is included in the DDK or the Platform SDK... so maybe this could help you...?

I do have one question for you: How do you set non-WHQL to ignore from AutoIt?

In batch I tried:

reg add "HKCU\SOFTWARE\Microsoft\Driver Signing" /v Policy /d 0 /f

reg add "HKLM\SOFTWARE\Microsoft\Driver Signing" /v Policy /d 00 /f

reg add "HKLM\SOFTWARE\Microsoft\Non-Driver Signing" /v Policy /d 00 /f

But that didn't work... auto-clicking it to "Ignore" from the XP-GUI "driver signing options" from within autoit is an option, but I'd like to know the "under the skin" way... :-)

Edited by Scrapple
0

Share this post


Link to post
Share on other sites

I'm not sure it works thou :P Haven't been able to test it (only few comps so far). It uses all info i could find on some forums here..

Func DriverSigningOff(); Sets Driver Signing to OFF.
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Driver Signing", "Policy", "REG_BINARY", "00")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Driver Signing", "Policy", "REG_DWORD", "0")
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows NT\Driver Signing", "BehaviorOnFailedVerify", "REG_DWORD", "00000000")
EndFunc

Func DriverSigningOn(); Resets Driver Signing to DEFAULT.
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Driver Signing", "Policy", "REG_BINARY", "01")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Driver Signing", "Policy", "REG_DWORD", "1")
RegWrite("HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows NT\Driver Signing", "BehaviorOnFailedVerify", "REG_DWORD", "00000001")
EndFunc

Edited by MadBoy
0

Share this post


Link to post
Share on other sites

@donjuan

no need for more testing for now. I know where the problem is. Seems that when devices are removed from device manager by either hand (not 100% sure but think so) or devcon status from Unknown (device with problems: 28) is changed to Device with problems: 01 and is not longer marked as Unknown. So it will take me some time to redo the devcon search function and the whole process of device removal. Hopefully i will get some time at work to do this ;) next version then should be language independant.

0

Share this post


Link to post
Share on other sites
@donjuan

no need for more testing for now. I know where the problem is. Seems that when devices are removed from device manager by either hand (not 100% sure but think so) or devcon status from Unknown (device with problems: 28) is changed to Device with problems: 01 and is not longer marked as Unknown. So it will take me some time to redo the devcon search function and the whole process of device removal. Hopefully i will get some time at work to do this ;) next version then should be language independant.

Thank u very much in advance.Your tool will be very usefull in my opinion, especially for unknown devices in presetup systems.Looking forward to your newer version..

0

Share this post


Link to post
Share on other sites

@donjuan - I think i fixed it. But it needs testing. Pls report if it works. Check changelog for details. As for presetup stage, as i understand you mean the stage while the windows is still being installed, my program hasn't been tested for that issue so you need to report on that. The thing here is that Devcon isn't used when Unattended is set to On because windows detects new devices by default so doesn't need devcon to do it's job. So it does all the things that non-unattended option without Devcon Remove/Rescan. Plus there's no GUI for unattended mode. I might add it but need some reports how this version works atm.

0

Share this post


Link to post
Share on other sites

New version is out. I rushed it a bit but thought i would share it before i end up starting a lot of changes to GUI and other stuff. So without further ado...

Download version 0.3.6 (Current with GUI)

Problems to solve:

- Signing of drivers isn't 100% working. Unfortunetly Microsoft implemented it the way it can't be realy done just by registry. Tests shown that also during change from Warn to IGNORE mode (My Computer -> Properties -> Hardware -> Driver Signing) besides standard registry keys that can be found all over the internet this key below also changes. On my computer it has 2 values (one for IGNORE and one for WARN). So unless i'll find a way to fix it.. Bummer. Maybe someone has some nice idea? Each computer has their own diffrent keys so it's not that simple as i seen on other forums in some posts ;)

- HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\PrivateHash 15 CA EF C3 34 E8 C8 78

- HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\PrivateHash 01 32 A3 68 55 C2 D2 00

Problem of signing drivers on unnatended cd doesn't exist because you can set the right value in winnt.sif or sysprep.inf. Or so i have read on Microsoft pages :) Oh well, we will see..

Possible changes in next versions:

- Option to have copied drivers to C:\Drivers (or other dir you choose) and then using it

as the main driver directory. Mighty be usefull for ppl who like to leave the drivers

on hdd, and for use with pyron's method.

- Completly redo of GUI. As someone said GUI isn't good enough which i knew on begining,

but wanted to have something easy and done fast so i could see the progress going on.

So the project will have new GUI soon. Better, nicer. Maybe special GUI for congfiguration.

- Waiting for other ideas and problems.

Changelog for 0.3.6

- Added REMOVABLE drives to be autodetected (you can use it instead of CDROM or drive letter)

- Added function that will create hardware.ini automagically if there is no hardware.ini present (usefull ;p)

- Added option that opens Device Manager while devices are being removed/detected.

- Added option to use either RegistryDevicePath or SetupCopyOemInf by pyron

Would be nice if someone would give his opinion about this, especially about Driver Signing. Couldn't realy found good solution.

0

Share this post


Link to post
Share on other sites
New version is out.....

Changelog for 0.3.6

- Added REMOVABLE drives to be autodetected (you can use it instead of CDROM or drive letter)

- Added function that will create hardware.ini automagically if there is no hardware.ini present (usefull ;p)

- Added option that opens Device Manager while devices are being removed/detected.

- Added option to use either RegistryDevicePath or SetupCopyOemInf by pyron

Would be nice if someone would give his opinion about this, especially about Driver Signing. Couldn't realy found good solution.

Thanx, very nice of you to integrate setupcopyoeminf!

0

Share this post


Link to post
Share on other sites

Np, just report errors ;) New version is there. Little mistake on my side ;/ And can anyone report problem with redetection of devices? I mean like you had to do it manually in device manager to see the process started?

Changelog for 0.3.7

- Fixed multiple Device Manager instances being started

0

Share this post


Link to post
Share on other sites

Just to keep you guys posted.. i decided to add some screenshot. Not best quality but will give you *HINT* on new features that will be implemented in newest version.

post-44662-1144686725_thumb.jpg

New features:

- Full support for 7zip/Rar packed drivers

- Optional backup of c:\Windows\Inf directory before applying drivers

- New look

- Ability to configure .ini file thru GUI (not realy sure i need it but i'll try to implement it if i get time ;p)

- Possibility to copy drivers to for example C:\Drivers for later use (a must to set when using packed_drivers)

- Optional output to log_file (usefull for debugging)

- Optional output_option = Full/Simple - with Full mode on 99% of what's happening including output from external programs will be placed in log. (usefull for debugging but might slow down program a lot)

- Information if Windows require reboot to use drivers or not

- Automatic or Manual start (by pressing button).

- Auto autorun file creator for easy deployment on CD.

Suggestions are welcome as i haven't done everything yet so i can change things. Later on it will be much harder (althought with log window instead of preset GUI it's much easier to change things.

Hope you guys will like the changes in new version. Hopefully out sometime soon.

Edited by MadBoy
0

Share this post


Link to post
Share on other sites

The part about removal of unkown devices is kind of limited. How about i had a driver that was installed but had a ? mark or another driver that had the wrong driver installed. The fact that it resolves unknown devices is great, but usually thats not the case as windows has the drivers for that device already.

0

Share this post


Link to post
Share on other sites

So is this project still alive? :)

I could use this functionality in our corporate upgrade project.

Basically I'm at the point that after the first logon by the user (post Win2k -> XP Pro upgrade finishes), on several types of our HW, the NIC (hardwire and wireless) were not detected properly and are listed as unknown devices. I've been able to prove, via manual method, that uninstalling/removing the unknown devices and doing a new hardware scan will then detect the devices and pick up the driver from the C:\Windows\NLDRV\001 (or 002) folder (I've used nLite to integrate the drivers, works fine). For some reason these drivers are not sensed or found during the device detection phase. :(

Remember, these are upgrades, not clean installs... Clean installs with the same source set created via nLite works right completely, all drivers found and installed correctly. :huh:

So, I need a way to have the upgrade finish installing the right HW drivers...

The basic thought is to:

1. Have a script/batch file fire off from a RunOnce key (which I can't get to work either with an upgrade, but that's another story)

2. Check the registry to ensure the right DevicePath is set or force it to the desired paths (I have this working with a command in a script)

3. Remove all unknown devices (don't know for sure how to do this, but maybe "devcon -remove =Unknown" might work ?? )

4. Re-scan HW to detect the devices and install the right driver (again, I think "devcon rescan" ?? )

5. Reboot the PC

So, anyone out there with some insight on doing this?

0

Share this post


Link to post
Share on other sites

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.