Jump to content

Drivers Instalation in Post-Install stage (New Method)


MadBoy

Recommended Posts

oldo: gimme some time and it will be implemented :) hopefully i won't have destroy half of code to implement this.

I'm planning some more things in future just it takes time as i am busy coding MultiCopier to be able to copy directory with files to multiple servers into same place (on those servers) for easy spreading of packages in Altiris ;) Also i have lost some work that i did on addon for Hardware Installer that would create db of .inf files with corresponding HW_ID's so my program would read this and use only inf's that are nessecary to system and not all of them. This should speed up instalation process a lot. Anyway i'll start working on it again if i get some time.

Link to comment
Share on other sites


Here you go @oldo, that will be 200Euro's please. Hehe just kidding (/me dreams). I tried to make it as error proof as possible but i might have broken something. Added around 100 lines of code so excuse me :P As always report errors and I should fix them asap.

Changelog for 0.7.2

- Added option to configure log files names/path to logfiles (check section [LOG])

- Changed config file format (please be advised on that!)

- Changed programs icon

This is example how it loooks. For more information how to use more of additional options check 1st post.

[LOG]

Logging_to_file=Yes

Logging_option=Advanced

Log_file_name=hardware.log

Log_path=&ProgramDir

DOWNLOAD REMOVED DUE TO BUG - Come check later.

Edited by MadBoy
Link to comment
Share on other sites

Great stuff, thankyou!

Just for completeness, how much trouble is it to do add a &Systemdrive option for Log_path?

I will hopefully add it in next version with maybe few additional variables and checks for stability.

Link to comment
Share on other sites

For use with the Devcon switch, do I need to have Devcon in the folder with hardware.exe?

I keep having problems with Hardware 0.7.1 not finding the wireless drivers. Weird... Hopefully 0.7.2 fixes it.

Edited by kickarse
Link to comment
Share on other sites

For use with the Devcon switch, do I need to have Devcon in the folder with hardware.exe?

I keep having problems with Hardware 0.7.1 not finding the wireless drivers. Weird... Hopefully 0.7.2 fixes it.

Which devcon switch ?:P as in plug & play rescan ? There's no need for devcon to be included in the dir, it is attached with my program.

Link to comment
Share on other sites

Under [ADVANCED]

Plug_and_Play=Internal or Devcon

I'll check it out and report...

In my log it says that "Reboot setting set incorrectly. Only mode 2,6 and 9 are possible!"

But my ini file says Reboot=6

Also, in version 0.7.2 should we get rid of under [iNFO] Logging_to_file and Logging_Option and put those under [LOG] ?

I also get

"No active plug & play process has been found after 15 seconds. Terminating." Even though it shows that it found a device and imports the registry devices inf folders.

--------------

Other thoughts.. what does work.

Using a batch script with in conjunction with Devcon (http://support.microsoft.com/kb/311272) and Vernalex's Sysprep Driver Scanner (http://www.vernalex.com/tools/spdrvscn/index.shtml)

Script adds drivers to registry, removes bad devices, rescans for new devices, restarts (30 seconds). On restart all devices are installed.

Script code:

ECHO Importing Drivers into Registry
spdrvscn /p c:\D /e inf /d %windir%\inf /a /s /q
ECHO Installing Devices
DEVCON REMOVE
DEVCON RESCAN
ECHO Restarting Computer to Complete Install
shutdown -r -c "Rebooting for Driver Installation"

Below also works too... without restart...

ECHO Importing Drivers into Registry
spdrvscn /p c:\D /e inf /d %windir%\inf /a /s /q
ECHO Installing Devices
RunDll32.exe Syssetup.dll,UpdatePnpDevicedrivers
ECHO This process can take up to 10 minutes depending on devices that need installation

Edited by kickarse
Link to comment
Share on other sites

@kickarse:

you're right about the reboot :) i missused OR and should be AND in one place, i'll fix it. As for the plug_and_play i'll check it out.

As for [LOG] you should remove those 2 fields from [iNFO].

the only way i see the message

"No active plug & play process has been found after 15 seconds. Terminating." Even though it shows that it found a device and imports the registry devices inf folders.

to be there when 'devcon rescan' or the process of finding new devices isn't running correctly or when there were no devices removed at all (this can happen as the tool might show you that the device has a problem of lets say 24) and it doesn't remove that (unless you specifically tell it to under the [ADVANCED] section). Maybe that was the problem here? If you are sure that the device was removed you could try going to device manager and pressing "rescan & redetect) and see if the device pops up there? If it does means my tool sucks :P Lemme know and i'll try to fix some nasty bugs i surely have included :)

Link to comment
Share on other sites

Do you mean go into device manager and right click on the computer icon and click "Scan for Hardware Changes"?

What I do know on the problem laptop (model is dissimilar but the brand is the same as the others I have) is that it sees that there is a device that has a problem.

But, alas, I don't have that laptop to play with. I'll see about getting the same model from someone else today. What I do know is that once I import the INF locations into the registry and run

RunDll32.exe Syssetup.dll,UpdatePnpDevicedrivers

After a couple minutes the devices that weren't installed are now.

And thanks again!

Edited by kickarse
Link to comment
Share on other sites

Do you mean go into device manager and right click on the computer icon and click "Scan for Hardware Changes"?

Yes that's what i meant. If after you press that and windows will find new devices then it means my program didn't worked as it should (and then i can investigate why with additional information from you). If it doesn't find any devices then that means there were no devices removed by my program or the device is no longer available for the system (even thou it was removed, that can happen to USB or other devices that once were in the system and are no longer there so the system actually can't find them).

What I do know on the problem laptop (model is dissimilar but the brand is the same as the others I have) is that it sees that there is a device that has a problem.

What i need from you is to know the code of the problem, device that has that problem and your settngs in [ADVANCED] then i will be able to tell if it's my programs fault or it's wrong settings of program or the device is no longer in system (as in devices that start with ACPI and couple of others might be gone from system).

RunDll32.exe Syssetup.dll,UpdatePnpDevicedrivers

I am unaware of that. What does that line do? Same thing like Devcon Rescan? Does it only re runs Plug & Play Rescan or does it do something more like finding the newest driver it can find in given path's and update all system drivers (even those that are already installed in system) to newest version? That would be preety nice and i could implement this in my app. Lemm know ;)

Link to comment
Share on other sites

command1

CODE

RunDll32.exe Syssetup.dll,UpdatePnpDeviceDrivers

is same as

command2

CODE

DEVCON updateni <inf> <hwid>

This command is equivalent to devmgmt.msc (Device Manager), click on the device, right click, Update Drivers...

command1 updates all devices instead of only the one specified with hwid

infs files have to be integrated first with Pyron's SetupCopyOEMInf.exe

command2 uses specified inf file and update only specified hwid

Wow, this seems to be nice command and actually i need to investigate this even more as this can add a lot functionality to my proggy if it realy does what this guys says.

Link to comment
Share on other sites

@kickarse: i see you haven't read correctly :)

Devcon rescan only does Rescan of P&P and that basically means pressing the button in device manager and that's it. While the command you pasted and i checked it goes thru all devices in system and checks their INF's version and then compares to INF's that it has in DevicePath in Registry if it finds newever version of drivers it will update the system driver to new one!!!!!! This is very good news because some ppl wanted this!! and this might save me a lot of time at least for this feature.

Just compare times of rundll32.exe (in TaskMgr). When you run devcon rescan it's just couple of seconds (if you don't have any devices that are unknown to system). With the code you posted (there's small typo thou in it, small letter D) it runs looong time and that's why i am preety sure it does what it does :)

Edit: so either you misunderstood what command Devcon Rescan does (very simle task) and wanted it to do a lot more then it could :P

or you haven't read correctly info i pasted :)

Edited by MadBoy
Link to comment
Share on other sites

Heh, I'm surprised you're awake since you're in Poland. Isn't it like 1am?

Okay here's the deal

My hardware.ini file is:

[ADVANCED]

Registry_path=Begin

The error is on the device:

PCI\VEN_8086&DEV_4223&Subsys_10008086&REV_05

Problem ID 01 (I thought this is just enumerating how many devices were in the system that weren't installed yet)

-------------------

Now, I just redid the same exact machine, but logged in as local admin instead of the domain admin (as I usually do) and it detected the drivers and installed them properly.

-------------------

It's good that code adds that extra step for getting the latest drivers.

Also, how do you get a pc/laptop ready for testing your builds? I keep having to reimage or reinstall...

Edited by kickarse
Link to comment
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.
×
×
  • Create New...