Jump to content

Drivers Instalation in Post-Install stage (New Method)


MadBoy

Recommended Posts

I am in UK atm (which is +00) for couple of days (until all equipment arrives to Poland) and Poland is +01 hour. So it's 18:20 atm.

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

My program removes devices with following Problem ID's: 1, 18,28,37 and 39. The list what each problem states can be found here. You can now force diffrent driver problems with diffrent problem id's to be removed by my program within [ADVANCED] field. On first page you got information how to do it but lemme quote it:

Problem_Ids - here you put numbers separated by commas i.e. 01,10,18,28,37,39. This means that devices that match one of those problems IDS will be removed. You can either increase the numbers or decrease if you think default i use is too much. On that page: http://support.microsoft.com/kb/310123/en-us you can find what each problem means. Keep in mind that there have to be 2 digits for example: 01,05,09,10,18.

Keep in mind that this settings OVERWRITE the builtin problem_ids so you have to include them if you want them removed aswell.

I'm not sure what might be causing the issue with Domain Accounts vs Admin Local account, if both are in same Administrators group of course.

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

Yeap i will be probably adding it as additional option in some next version!!! I think i have to redo some stuff and .ini changes.

As for testing builds. Depends what you mean ? :) But usually to test build you have to bring it back from image ;) Nothing else you can do. You can try disabling packing of image (which slowes down deployment heavily). Image gets larger but still deploys faster. Use fast USB 2.0 hdds to deploy image from or use fast/1000mbit server on 1000mbit nic based computers. Other then that i don't know mate :)

Edited by MadBoy
Link to comment
Share on other sites


I thought this might be helpful

http://msdn2.microsoft.com/en-us/library/aa476916.aspx

-----

And just to keen you in on what I've been doing

Using WatchDriverSigningPolicy.exe and Sysprep Driver Scanner I've been able to come up with a batch script to do something similar to your program.

Basically it turn off Driver Signing using Pyrons method, then imports drivers into the registry, then start Device Manager so you can see what's happening, then it starts the install of the devices. Once install finishes it closes out WatchDriverSigningPolicy and the Device Manager (mmc.exe).

@ECHO OFF
ECHO Setting Driver Signing Policy to OFF
START WatchDriverSigningPolicy.exe
ECHO Importing Drivers to Registry
START /WAIT spdrvscn /p c:\D /e inf /d %windir%\inf /a /s /q
ECHO Starting Driver Manager
START devmgmt.msc
ECHO Starting Install of Hardware
START /WAIT RunDll32.exe Syssetup.dll,UpdatePnpDeviceDrivers
taskkill /f /im WatchDriverSigningPolicy.exe
taskkill /f /im mmc.exe

Edited by kickarse
Link to comment
Share on other sites

@kickarse:

that's nice. i would love to see all possible command-line options regarding device handling (and not only) for rundll32.exe.

I agree that your script does similar things, mine thou has a bit more configurable options. The problem is not to code the main features to make them work as it was already done by someone else (i got the idea to do it after seeing some .bat scripts and all the pyron work). I was just to demanding what i realy wanted to have. Also writting this program gave me a lot of inside knowledge on devices in windows as i had to read a lot to actually write it. So actually if i would like just to install drivers and nothing else i would pr obably use your script. But when i would want some 'configuration' then i would choose mine *EViL GRiN* :)

Anyways i've been coding new features including DriverSigning On/Off since i know how to code it (or i think so in my head) plus the update of drivers option thanks to your addition (by giving me the command line that turned out to be very usefull!!).

It's much easier to write things in small programs, problems starts when you try to put it all in one. You have to make it fool-proof and since many features actually can't work together you have to write many work around for those ;) That's why it takes me so much time. Plus i am lazy coder!

I'll give some new version soon hopefully.

Link to comment
Share on other sites

I can't wait! :thumbup

Thanks for all the hard work btw!

Actually now i just found nasty bug!!! That prevented device removal if only 1 device had error!!!! And this was your situation. You had just one device and another time it worked probabyl because you had more then one! (when you tried comparing Domain Account vs Local one)! To summarize it is now fixed :P I also already added the new features but i am still thinking about some additions before releasing 0.7.3. I was thinking to port it to new gui before rlsing but it's a major work so i guess i'll just rls it as it is soon.

Link to comment
Share on other sites

Changelog for 0.7.3

- Fixed serious bug that was disallowing device to be removed when there was only one device in the list that didn't had any driver. (tnx kickarse!!)

- Added option Update_All_Drivers_Version (read documentation) which makes Windows update all drivers to newest version that it has access to (tnx kickarse!!)

- Cleaned up code (useless variables etc)

- Fixed bug that made the feature reboot useless (tnx kickarse!!)

- Added variable for Log_Path - &SystemDrive

Check first post for download link and make sure to READ the first page documentation if you're new to my program or just the settings i've introduced in this version.

Huge thanks go to Kickarse for bringing those bug reports ;D

Link to comment
Share on other sites

  • 2 weeks later...

So I tried this program for the first time today and have a couple of questions. I run this program and it finds the unknown devices and attempts to remove them. As soon as the first one starts to uninstall my whole machine slows to a crawl and I am unable to do anything. I left it like this for approximately five minutes and after no progress I restarted the computer. Windows XP progress bar finished and was just about to boot to the desktop when I get a black screen and the machine is frozen. I tried this on two different machines and both resulted in the same thing. My hardware.ini

[iNFO]

Start=Automatic

Drivers_drive=Relative

Drivers_dir=\Drivers

Device_manager=Off

Method=RegistryDevicePath

Drivers_Packed=No

Copy_drivers=No

Copy_where=C:\Drivers

Delete_drivers=No

Create_backup=No

Update_All_Drivers_Version=No

Time_to_start=0

[LOG]

Logging_to_file=Yes

log_file_name=hardware.log

log_path=&ProgramDir

Logging_option=Simple

The S drive is a mapped network resource but that should not matter at all, right?

Link to comment
Share on other sites

So I tried this program for the first time today and have a couple of questions. I run this program and it finds the unknown devices and attempts to remove them. As soon as the first one starts to uninstall my whole machine slows to a crawl and I am unable to do anything. I left it like this for approximately five minutes and after no progress I restarted the computer. Windows XP progress bar finished and was just about to boot to the desktop when I get a black screen and the machine is frozen. I tried this on two different machines and both resulted in the same thing. My hardware.ini

You're .ini file is fine. I think there's something wrong with my proggy :| I'll take a look at it as few days ago i did exactly the same thing as you did and crashed my 2 machines. I just wasn't sure that's my programs fault. They don't boot anymore. However i managed to see that devcon32.exe which i use to remove devices is hanging the machine and waiting for things to happen instead removing devices and probably destroying the machine. I think my devcon32.exe is corrupted. I know remember that i had it on flash which had to replaced because it was corrupting data so i guess similar thing might have happend to devcon32.exe which was on it. I'll check that aswell.

My advice. Don't use the program till i know what's wrong. I'm sorry for your 2 machines :(

Link to comment
Share on other sites

Hey no problem. These were two test machines that nearly a second ago finished installing Windows XP. Popped back in the unattend disk and we were back in half an hour.

Just like to say that from what I saw in the GUI I was extremely impressed. I am installing Windows XP over the network using Windows PE and needed some way to take care of drivers recursively scanning a folder on the network. This correctly identified the two devices missing and not any more than that. Keep up the good work!

Link to comment
Share on other sites

Hey no problem. These were two test machines that nearly a second ago finished installing Windows XP. Popped back in the unattend disk and we were back in half an hour.

Just like to say that from what I saw in the GUI I was extremely impressed. I am installing Windows XP over the network using Windows PE and needed some way to take care of drivers recursively scanning a folder on the network. This correctly identified the two devices missing and not any more than that. Keep up the good work!

Well good thing is i might know what was the cause of it. By default my program was removing last part of the HW_ID.

Before it was like:

[08:08:46] - Unknown device found: ACPI\PNP0303 ProblemID: 24

[08:08:46] - Unknown device found: ACPI\PNP0F13 ProblemID: 24

Now it is like:

[08:08:46] - Unknown device found: ACPI\PNP0303\4&EDE93E0&0 ProblemID: 24

[08:08:46] - Unknown device found: ACPI\PNP0F13\4&EDE93E0&0 ProblemID: 24

It worked without problems till like this week. Don't know why it's not working anymore but i guess on some devices it tries to remove more devices then it should which breaks the windows. I'll see how it works with full HW_ID and then release it. I'll test it during the weekend on my computer. Don't want to crash more computers at work as those 2 i crashed are still not reinstalled by our great IT which needs SLA 5 days to fix system.

Cheers :)

Link to comment
Share on other sites

Any updates on the latest version? This has been a wonderful app. Still using 6.8 Thanks!

Well actually i can't find anything that may be causing the issue in last version. I haven't modified the function with devcon removal of devices which causes the big problem. I think 0.7.2 works fine, and 0.7.1 also just the new 0.7.3 causes problems. Didn't had much time to compare those 2 and eventually find problems. I've been asking around for help with dll call so i could replace devcon totally with internal dllcall.

I even asked on autoit forum but no response. Maybe someone from here is a bit better on dllcalls and can help to solve the mystery for me :)

Link to Microsoft: http://msdn2.microsoft.com/en-us/library/ms792970.aspx

Windows Driver Kit: Device Installation SetupDiRemoveDevice The SetupDiRemoveDevice function is the default handler for the <a onclick="java script:Track('ctl00_LibFrame_ctl00|ctl00_LibFrame_ctl01',this);" href="ms793460.aspx">DIF_REMOVE installation request.

WINSETUPAPI BOOL WINAPI

SetupDiRemoveDevice(

IN HDEVINFO DeviceInfoSet,

IN OUT PSP_DEVINFO_DATA DeviceInfoData

);

Parameters

DeviceInfoSet A handle to a device information set for the local system that contains a device information element that represents the device to remove. DeviceInfoData A pointer to an SP_DEVINFO_DATA structure that specifies the device information element in DeviceInfoSet. This is an IN-OUT parameter because DeviceInfoSet.DevInst might be updated with a new handle value upon return. If this is a global removal or the last hardware profile-specific removal, all traces of the device instance are deleted from the registry and the handle will be NULL.

Return Value

The function returns TRUE if it is successful. Otherwise, it returns FALSE and the logged error can be retrieved by a call to GetLastError.

Comments

The caller of SetupDiRemoveDevice must be a member of the Administrators group.

Only a class installer should call SetupDiRemoveDevice and only in those situations where the class installer must perform device removal operations after SetupDiRemoveDevice completes the default device removal operation. In such situations, the class installer must directly call SetupDiRemoveDevice when the installer processes a DIF_REMOVE request. For more information about calling the default handler, see Calling Default DIF Code Handlers.

SetupDiRemoveDevice removes the device from the system. It deletes the device's hardware and software registry keys and any hardware-profile-specific registry keys (configuration-specific registry keys). This function dynamically stops the device if its DevInst is active and this is a global removal or the last configuration-specific removal. If the device cannot be dynamically stopped, flags are set in the Install Parameter block of the device information set that eventually cause the user to be prompted to restart the computer.

Device removal is either global to all hardware profiles or specific to one hardware profile as specified by the Scope member of the SP_REMOVEDEVICE_PARAMS structure that supplies the class installation parameters for the DIF_REMOVE request. Configuration-specific removal is only appropriate for root-enumerated devices and should only be requested by system code.

Requirements

Headers: Declared in setupapi.h. Include setupapi.h.

If you guys can point me to right directions on how to convert this, what to do etc.. i will greatly appreciate it.

Thanks

Link to comment
Share on other sites

Is there a link to download version 7.2?

You can try the 7.2 version from here (DOWNLOAD REMOVED)

Try it on non-essential system (best that can be reinstalled seconds later) as it might have that bug that makes your computer unusable. Please and report if it crashes computers ASAP. If it does then i'll keep looking in changes i have done during the last 5 versions or so. At some point i must have done something realy bad ;p

Edited by MadBoy
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...