Topic: how does Finisher nake nvcpl shut up?

When my image boots to the desktop for the first time my driver installer does it's thing, and since the nVidia control panel is (thankfully) not a part of the graphics packs, I get the "RUNDLL32.EXE C:\WINDOWS\system32\NvCpl.dll,NvStartup" error on boot.  I have tried the following bits to try and make it not do that, but it keeps happening...

regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","NvCplDaemon","REG_SZ","")
regwrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","NvCplDaemon","REG_SZ","")
regdelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","NvCplDaemon")
regdelete("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","NvCplDaemon")
regdelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","NvMediaCenter")
regdelete("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run","NvMediaCenter")

I found that RegDelete was not doing anything so tried the RegWrite "" trick, and I thought that would do it but nope.  So then I tried one after the other, nope again.  I'm pretty flummoxed and can't find the right answers through Google, care to share how Finisher does it?

Thanks

Ian

Re: how does Finisher nake nvcpl shut up?

Look at the Nvidia.ins file wink

did you ever try my tool?

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: how does Finisher nake nvcpl shut up?

Yes, I used it on a few machines as a test, sorry if I never really gave any feedback!!  I do like the feature where it keeps the drivers compressed until they are needed, and as I recall it worked very well.  The only reason I am not using it now is because my own tool has come so far, and is more tailored to my uses (obviously, I wrote the bloody thing!  big_smile )  Do you have plans to include it in a future release of Base?  Do you need any more testing of it done?  I'd be happy to help shake any bugs out and offer some input if you'd like, but testing of it may be a bit limited since my images are now locked down using my own tool.....  But I could try to make some time to experiment with it.

On a side-note, I was going through the code for InstallByHWIDsPrepTool to see if I could either learn how your INF scanner works and see if I could use that to help my own routine, or just reformat your output to be how my installer needs it, and I am still so lost by your programming style!!  smile  I even went so far as to write a program to take your output and convert it to my output style, after an hour it worked for a fraction of the output and would freeze, so I said some bad words and walked away from it.  I am currently using KickArse's FindHWIDS and reformatting the CSV output to meet my criteria, the results are a bit more thorough than mine but the output file grew a LOT since doing so, so it takes literally twice as long now to scan for matches.  My method was:

Scan the INF for lines containing a & or a {
Omit any matching lines that started with StringLower( hklm, exclude, classgui or proxy.clsid
Go through that line and try to trim it as much as possible to only contain the HWID, no comments or descriptions, etc


Then I modified it by looking at your results and manually going through a few INF matching your results and made my newer way:

Scan the INF for any lines starting with %
Any line that contains a \ gets saved as a possible HWID
Go through that line and try to trim it as much as possible to only contain the HWID, no comments or descriptions, etc

Pretty crude.  The output file for this was about 1.2MB with all packs and most 3rd party (no monitors, phones, a few other omissions).  Using FindHWIDS the same set of drivers created a 12MBish CSV, using my parser I get a 2.4MB master HWID file.  On one particular test machine my scanner only found 4 driver matches, the FindHWIDS-modified output file found 12 matches, though the only actual difference was that file found a match for the ethernet adapter that mine missed.  I am still trying to find the "right way" to pluck out what is relevant, or even POSSIBLY relevant, with my own tool but due to the need to stop spending so much time developing and just get some images out, I decided to just use FindHWIDS for now.......  But if possible I'd like to go back to my own way, due to how I had to format the output from FindHWIDS versus my own scanner I know I can reduce that significantly, which will result in a big time saving.


Anyway, thanks for the tip on Nvidia.ins, I'll take a peek at that and see what is has to offer!

Ian

Re: how does Finisher nake nvcpl shut up?

well my routine is much more exacting, as is kickarses.

that is why it is hard to follow. it is actually intuitive. it first identifiys the manufacturers supported then finds each of the manufacturers individual platforms (2k, XP, 2k3, x64) "supported section" line by line. this avoids misreads you might encounter by accidentaly importing hwids that are ;disabled or are in a section that is actually an "exclusion" section wink. this is Tricky because many of the lines use variable substitutions and dealing with variable substitutions in an inf from a program is kinda tricky wink.

the output of mine has the advantage that the hwids for each of our supported platforms are separated so that only the correct hwids lists (based on platform IE XP,win2k, ect...) are applied to the target machine wink. (IE we dont need to extract folders based on HWID matches that are "win2k only drivers" when we are installing XP - ect...)

I think I have created the tool you that you set out to create... Please let me know if i have not wink
IE
   If my tool works why does it matter if the temp file used is in a different format???
    Or tell me why the format is important to you and what that format is / needs to be...
      are you trying to achive KTD or some similar function... talk to me...
      I'm sure it's easily doable if only i know what it is we're doing tongue
and yes if it works I'll add it and credit you for motivateing me wink

- I may never know if it works... wink tongue big_smile

PS Ithink mine works for 2k xp and 2k3 too...

DP BartPE Tutorial   DP_BASE Tutorial   HWID's Tool     Read BEFORE you post    UserBars!
http://driverpacks.net/userbar/admin-1.png
The DriverPacks, the DP_Base program, and Support Forum are FREE!.

Re: how does Finisher nake nvcpl shut up?

Your tool does do what I set out to do, but I have several extras.  I wish I had the code with me for what I do, maybe on Monday when I get back to the shop I'll post all of my code and let you see what I'm up to.  I'll summarize as best I can for now:

My current method is to get XP set up just right in VirtualBox, SysPrep it with just the standard MS SysPrep with no MS integration or PnP detection, just plain for Home and Mini-Setup option for Pro/MCE.
GhostCast the virtual installation by capturing a Bart ISO with VirtualBox and send the image to the physical installation (worst part of the whole process...)
Transfer the image to a real HDD with Ghost
Use OfflineSysPrep for HAL on next boot and MS injection plus a few other options
Reimage
Use Ghost Explorer to insert my apps and the driver cache in to the image


My driver+other method then kicks in as follows:

The main app gets put in C:\Documents and Settings\All Users\Start Menu\Programs\Startup which is what does devcon * on the local machine the image was dunped on
The main app calls another simple one I wrote to automatically close any Found New Hardware Wizards, which closes at either the window that says driver installation is complete (forget the window name right now) or 90 seconds, whichever happens first
The main app then runs a match scan on the devcon output file against the master HWID file (currently Kickarse's modified INF HWID list)
As matches are found the names of the directories containing the matching INFs are written to a temp file
When the scan is finished the match directories are copied to a temp folder where dpinst and dpinst.xml are located
dpinst is then run to install the matches
The main app then attempts to delete the driver cache folder, calls another app, then closes itself
The last step is the above app, which will delete the driver cache, tidies up the Desktop a bit, and sets some registry entries for things like default homepage, and will eventually (hopefully) shut the silly NVCPL error up


So you see, what I need it much more than one tool just for drivers, and with all of the dependencies involved, plus needing to try to do things like calling my cleanup/reg stuff after other programs have run, plus the feedback my installer gives since the whole process can take 5-8 minutes, it has just seemed like the right thing to do to keep mine going. I suppose I could just write an app to call your installer then follow up with my cleanup, but mine is working so well now that I'm kinda disinclined to give it up!  smile  Allllllll I want to do now is beef up my INF scanning tool.

OH YEAH, as for that, my original scanner outputted as follows:

HWID1
HWID2
HWID3
etc
***c:\dp\d\m\a...........
HWID1
HWID2
etc
***c:\dp\d\m\b

That way, as matches are found my installer would look for *** so it knew where it came from.  Using FindHWIDs I had to make the out go

HWID
***source
HWID
***source
HWID
***source

So there is a lot of wasted space on redundant source locations.  I could fairly easily make it more like my preferred method, but was at a point where I was putting too much time developing, my company has 4 locations and quite a few techs who use my images, so I hit a point where I felt like just giving them some updated images and stop tweaking!  smile  They were stuck using images I did in early January, and I have made who-knows-how-many dozens of images since then.....

So, there is my huge overview, I swear just posting the code would take up less space!!  big_smile  On Monday I will post the code as it is using my scanner, not modifying FindHWIDS.

Ian



Edit - Oh, and no I'm not trying to do a KTD-type installation, I used to but stopped doing anything like that in January, you pointed out several times, using SAD as one example why, that it was silly keeping 3GB of drivers around in case a modem got installed months down the road, plus another of my techs complained about keeping the drivers.  Plus if that install were to be re-SysPrepped (a practice I no longer do...) the DevicePath entry in the registry just gets waaaaaaaay out of hand.   So no, no KTD.

Last edited by llewxam (2009-03-21 14:39:12)

Re: how does Finisher nake nvcpl shut up?

OK, as promised, here is my code BEFORE I started using Kickarse's scan tool, so this code includes my own scanning routine.  Make sure C:\DP exists, and EXTRACT the packs you want to work with to that folder.  This code is AS-IS, so if you run the installer (justinstall_s 2.au3) it WILL DELETE the C:\DP folder when done, so comment out line 194 to prevent this.

My INF scanner: (justscan.au3)

TrayTip("generating databases", "please wait a moment", 150, 1)

#include<process.au3>
$rc=_rundos("dir /s c:\dp\*.inf >c:\dp\allinf.txt")

global $hwcount
global $hwgo
global $dirty
global $infcount
global $infcount2
global $gobatcount
global $trips
global $slashcount
global $strlength
global $ampcount

sleep(2000)

$allinf = FileOpen("c:\dp\allinf.txt", 0)
FileOpen("c:\dp\masterinflist.txt", 1)

Do

	$linein = FileReadLine($allinf)
	If @error = -1 Then ExitLoop

	$lookfordir = StringInStr($linein, "Directory of")
	if $lookfordir<>0 Then
		$len=StringLen ($linein)
		$dirname=StringRight ( $linein, $len-14)
	EndIf

	$lookforinf = StringInStr($linein, ".inf")
	if $lookforinf<>0 Then
		$len=StringLen ($linein)
		$infname=StringRight ( $linein, $len-39)
		FileWriteLine ("c:\dp\masterinflist.txt", $dirname & "\" & $infname)
		$infcount2=$infcount2+1
	EndIf

until 1=2

FileClose($allinf)
FileClose("c:\dp\masterinflist.txt")

;start section where INFs are scanned for HWIDs

$mastinf=FileOpen("c:\dp\masterinflist.txt", 0)
FileOpen("c:\dp\masterhwid.txt", 1)

Do

	$hwidin = FileReadLine($mastinf)
	If @error = -1 Then ExitLoop
	$wroteone=0
	$infcount=$infcount+1

	$openinf=$hwidin
	$currentinf=FileOpen($openinf, 0)
	TrayTip("scanning inf " & $infcount & " of " & $infcount2 , $openinf, 15, 1)

	Do
		$infin = FileReadLine($currentinf)
		If @error = -1 Then ExitLoop

		$lookforperc = StringLeft($infin,1)
		if $lookforperc="%" Then	
			$dirty=0
			if StringLeft($infin,1)=";" then $dirty=1
					
			if $dirty=0 then 
				$infout=$infin
				$len222=stringlen($infin)
				for $n=1 to $len222
					
					$whatis=stringmid($infin,$n,1)
					if $whatis="\" Then
						$leftcount=$n
						$rightcount=$n
						Do
							$findleft=stringmid($infin,$leftcount,1)
							if $findleft=" " then ExitLoop
							$leftcount=$leftcount-1					
						until $leftcount<0
						Do
							$findright=stringmid($infin,$rightcount,1)
							if $findright=" " then ExitLoop
							$rightcount=$rightcount+1					
						until $rightcount>$len222
							
						$infout=stringstripws(stringmid($infin,$leftcount,$rightcount-$leftcount),8)
							
					EndIf
					
				Next	
		
			endIf	
		if $dirty="0" and $infout<>"" then 
			FileWriteLine ("c:\dp\masterhwid.txt", $infout)
			$wroteone=1
		endif	
		EndIf
						
	until 1=2
		

if $wroteone=1 then FileWriteLine ("c:\dp\masterhwid.txt", "********" & $hwidin)
FileClose($openinf)
FileClose($currentinf)

until 1=2

FileClose("c:\dp\masterhwid.txt")

FileClose($mastinf)
FileDelete("c:\dp\allinf.txt")
Fileclose("c:\dp\masterinflist.txt")
FileDelete("c:\dp\masterinflist.txt")

TrayTip("finished ", "done scanning",15,1)

Exit

Main install app (justinstall_s 2.au3) (named "_s 2" for SysPrep-tailored version, version 2)

;        Hands-Off Driver Installer v1.2 3/2/2009
;        by Ian Maxwell
;        llewxamnai@gmail.com
;
;        Make sure you have drivers extracted to C:\DP (subfolders from there are fine),  devcon.exe in
;        C:\DP, and dpinst.exe and dpinst.xml in C:\DP\INST.  Layout of dpinst.xml should be:
;
;        <?xml version="1.0" ?>
;         <dpinst>
;          <search>
;           <subDirectory>*</subDirectory>
;          </search>
;          <scanHardware/>
;          <legacyMode/>
;        </dpinst>
;
;        Also have a file called inst.cmd in C:\DP\INST with the following lines:
;
;        @echo off
;        title Driver Installer
;        c:\dp\inst\dpinst.exe /SW /C /S /SA

run("c:\windows\system32\suppress.exe")
SplashTextOn("auto driver loader stage 1/7","generating databases",-1,50)

#include<process.au3>
$rc=_rundos("c:\dp\devcon.exe hwids * >c:\dp\hwids.txt")

global $hwcount
global $hwgo
global $dirty
global $infcount
global $infcount2
global $gobatcount
global $trips
global $slashcount
global $strlength
global $ampcount
;global $hwidcount      ;only include if needed, runs much slower with this on


;strip out unneeded info from hwids.txt

$id=FileOpen("c:\dp\hwids.txt",0)
FileOpen("c:\dp\hwidlist.txt",1)

Do

$idinraw = FileReadLine($id)
If @error = -1 Then ExitLoop
$idin=StringStripWS($idinraw,8)

$dirty=0
$clean = StringInStr($idin, "\")
if $clean<>0 Then 
	if StringLeft($idin, 4)="ACPI" then $dirty=1
	if StringLeft($idin, 4)="IDE\" then $dirty=1
	if StringLeft($idin, 5)="ROOT\" then $dirty=1
	if StringLeft($idin, 8)="STORAGE\" then $dirty=1
	if StringLeft($idin, 8)="DETECTED" then $dirty=1
		
  	$slashcount=0
 	$ampcount=0
  	$strlength=StringLen($idin)
  	for $trips=1 to $strlength		
  		if StringMid($idin,$trips, 1)="\" then $slashcount=$slashcount+1
 	Next	
 	for $trips=1 to $strlength		
  		if StringMid($idin,$trips, 1)="&" then $ampcount=$ampcount+1
  	Next	
  	if $slashcount=1 and $ampcount=0 then $dirty=1	
		
	if $dirty=0 then FileWriteLine("c:\dp\hwidlist.txt",$idin)
    if $dirty=0 then $hwcount=$hwcount+1
EndIf
	
Until 1=2

FileClose("c:\dp\hwids.txt")
FileClose("c:\dp\hwidlist.txt")

;start section matching system's HWIDs to available drivers

$hwids=fileopen("c:\dp\hwidlist.txt",0)
FileOpen("c:\dp\tobeinst.txt",1)
$masterhwid=fileopen("c:\dp\masterhwid.txt",0)

Do

	$hwidin = FileReadLine($hwids)
	If @error = -1 Then ExitLoop
	$hwgo=$hwgo+1

	SplashTextOn("auto driver loader stage 2/7","running match scan " & $hwgo & " of " & $hwcount,-1,50)

	do
		$masthwidin = FileReadLine($masterhwid)
		If @error = -1 Then ExitLoop
		
		$lookformatch = StringInStr($masthwidin, $hwidin)
		if $lookformatch<>0 Then

			Do
				$masthwidin = FileReadLine($masterhwid)
				$findlocation = StringInStr($masthwidin, "********")
				if $findlocation<>0 Then
					FileWriteLine("c:\dp\tobeinst.txt",StringTrimLeft($masthwidin,8))
					exitloop(2)
				endif	
		
			until 1=2
			
		EndIf

	until 1=2
	fileclose($masterhwid)
	$masterhwid=FileOpen("c:\dp\masterhwid.txt",0)
	

until 1=2

fileclose($masterhwid)
fileclose("c:\dp\hwidinst.txt")
fileclose("c:\dp\tobeinst.txt")

SplashTextOn("auto driver loader stage 3/7", "finishing setup",-1,50)

; set up installer

fileopen("c:\dp\go.txt",1)
fileWriteLine("c:\dp\go.txt","x")
fileclose("c:\dp\go.txt")

$input=FileOpen("c:\dp\tobeinst.txt",0)

Do
	
$infname = FileReadLine($input)
If @error = -1 Then ExitLoop

$len=StringLen($infname)
for $count=$len to 1 step -1
	$justdir=StringLeft($infname,$count)
	IF StringRight($justdir,1)="\" Then
		$justdir=StringLeft($infname,$count)
		ExitLoop
	EndIf	

Next

$gotxt=fileopen ("c:\dp\go.txt",0)
Do
$txtin = FileReadLine($gotxt)
If @error = -1 Then ExitLoop
$finddup = StringInStr($txtin, $justdir)
if $finddup<>0 then ExitLoop
until 1=2

FileClose($gotxt)

if $finddup=0 then
	FileOpen("c:\dp\go.txt",1)
	FileWriteLine("c:\dp\go.txt", $justdir)
	fileclose("c:\dp\go.txt")
EndIf
until 1=2

FileClose("c:\dp\tobeinst.txt")
FileClose("c:\dp\go.txt")

$gotext=fileopen("c:\dp\go.txt",0)

SplashTextOn("auto driver loader stage 4/7", "copying drivers to be installed",-1,50)

Do
$textinput = FileReadLine($gotext)
If @error = -1 Then ExitLoop
	
if $textinput<>"x" then DirCopy($textinput,"c:\dp\inst\" & $gobatcount,1)
$gobatcount=$gobatcount+1

until 1=2

SplashTextOn("auto driver loader stage 5/7", "installing your drivers now, the screen may flicker a few times",-1,50)

Run("c:\dp\inst\inst.cmd","",@SW_MINIMIZE)
sleep(3000)    ;needed so the system can have time to execute the installer before skipping right by it
WinWaitClose("Driver Installer")

sleep(3000)
SplashTextOn("auto driver loader stage 6/7", "cleaning up",-1,50)
DirRemove("c:\d",1)
DirRemove("c:\dp",1)
run("c:\windows\system32\clean.exe")
splashoff()

Exit

Code for clean.au3:

SplashTextOn("auto driver loader stage 7/7","performing final stage of asetup",-1,50)

RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "DevicePath")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "DevicePath", "REG_EXPAND_SZ", "%SystemRoot%\Inf")
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page")
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page", "REG_SZ", "http://www..com")   ;removed my company name
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main", "Default_Page_URL")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main", "Default_Page_URL", "REG_SZ", "http://www..com")   ;removed my company name
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main", "Start Page")
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main", "Start Page", "REG_SZ", "http://www..com")   ;removed my company name
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}")   ;my computer icon on desktop
Regwrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}", "REG_DWORD", "0")   ;don't hide my computer icon on desktop
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel", "{450D8FBA-AD25-11D0-98A8-0800361B1103}")  ;my docs icon on desktop
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel", "{450D8FBA-AD25-11D0-98A8-0800361B1103}", "REG_DWORD", "0")  ;don't hide my docs icon on desktop

FileOpen("c:\windows\system32\imgver.txt",1)
FileWriteLine("c:\windows\system32\imgver.txt","Windows XP OEM SP3 Image Version 1.6OSP 3/19/2009")
fileclose("c:\windows\system32\imgver.txt")

processclose("suppress.exe")

for $i=1 to 6
$allusers = FileFindFirstFile("c:\documents and settings\*.*")

	Do

		$user = FileFindNextFile($allusers) 
		If @error Then ExitLoop
		FileDelete("c:\docume~1\"&$user&"\desktop\inter*.*")
		FileDelete("c:\docume~1\"&$user&"\desktop\windo*.*")
		FileDelete("c:\docume~1\"&$user&"\desktop\hwids.txt")

	until 1=2

FileDelete("c:\*.txt")
DirRemove("c:\dp",1)
DirRemove("c:\d",1)
dirremove("c:\sysprep",1)
filedelete("c:\Documents and Settings\All Users\Start Menu\Programs\startup\just*.exe")

next

splashoff()
msgbox(0,"DONE!","The automated driver installation and system preparation process is now finished.  After you close this message your should check to make sure all drivers are installed, and a reboot would be recommended to apply driver changes.")

Exit

I have the for-next loop because I found many times that C:\DP was not being fully removed, something I also experienced a lot with Finisher when using Base for SysPrep integration...  The loop makes it more likely to succeed (hasn't failed yet this way...).  I included the rest of the typical deletions to the loop just in case  smile


Code for suppress.au3:

$start = TimerInit()

Do

sleep(2000)

if WinExists("Found New Hardware Wizard") then 
	WinActivate("Found New Hardware Wizard")
	Send("{TAB}{TAB}{ENTER}")
endif

if WinExists("Hardware Update Wizard") then 
	WinActivate("Hardware Update Wizard")
	Send("{ENTER}")
endif

if WinExists("System Settings Change") then 
	WinActivate("System Settings Change")
	Send("{TAB}{ENTER}")
	Exit
EndIf

Until TimerDiff($start)>90000


Exit

I have only noticed the System Settings Change window with XP Pro, so included the 90 second kill switch incase that window doesn't come up.


Any questions/comments, let 'er rip.  I also apologize about the spacing being gone due to the code tag, if anybody is interested in downloading the code in the raw au3 format let me know, that way the code will be much easier to follow.....

Ian

Re: how does Finisher nake nvcpl shut up?

I tried your tool Jeff with the extra requests, and the PrepTool did finish with no issues.

Not sure when I'll run the installer, but I'll try to make time.

Ian

Re: how does Finisher nake nvcpl shut up?

LOL, getting back to the point of this topic, I just now had a chance to try your suggestion and did a regedit /s nvidia.reg (renamed it...) and saw that the keys were added properly, but the silly nvcpl mesage keeps popping up.  In desparation I yanked that out of the INFs and reimaged, but now the driver is broken  big_smile   Yeah, I'll try anything.....

Any other suggestions?

Thanks

Ian