PDA

View Full Version : Installing inf file



talzur
07-26-2005, 11:32 AM
Hi all,

I would like to insatll an inf file,
trying to use the following code just didn't help:

".....
szProgram = "rundll32.exe";
szCmdLine = "setupapi.dll,InstallHinfSection DefaultInstall 132" + SUPPORTDIR + "test.inf";
LaunchAppAndWait(szProgram, szCmdLine, WAIT);
...."

what does the parameter DefaultInstall refer to ?
mybe there is onther function that can be used, such as
SetupCopyOEMInf(....) ?

THANKS

talzur
07-27-2005, 11:52 PM
Hi all,

The solution is as follows:

// declaration...

prototype BOOL Setupapi.SetupCopyOEMInfA(POINTER, POINTER, POINTER, POINTER, POINTER, POINTER, POINTER, POINTER);

STRING SourceInfFileName;

/* you first need to copy your inf and other install files to targetdir. If you setup the following code in say OnFirstUIAfter() function and use natural file copying of installshield and setup file goups etc, then you need to do this somewhere after the file copy in your script code... thats why OnFirstUIAfter()*/

SourceInfFileName = TARGETDIR ^ "X.inf"; // where x is your inf

UseDLL("Setupapi.dll");

nResult = SetupCopyOEMInfA(&SourceInfFileName, NULL, 1, NULL, NULL, 0, NULL, NULL);

UnUseDLL("Setupapi.dll");