From: Peter on
In my *.inf file is section:
[AAAMP.AddService.AddReg]
HKR, Parameters, "MyDir", 0, %01%

That creates value equal to path where is installed driver.sys from.
This path is necessary to have in registry for my driver operation.
Problem is, that when user uninstalls driver and tries to install it from
different directory, in Windows\Inf still exist oemXX.inf and oemXX.PNF files
and I think that there is stored still previous MyDir value, so after
installation my driver uses bad MyDir value.

Does exist some *.inf directive or flag, that deletes previsously created
oemXX.inf and oemXX.PNF before creating new ?
Or does exist some API function with help of it I can to find corresponding
oemXX.inf and oemXX.PNF file names in Windows/inf - if yes no problem to
delete it with some API function.
?

Thanks !
Peter

From: Pavel A. on
"Peter" <Peter(a)discussions.microsoft.com> wrote in message news:DC371AFA-560E-42C7-8D81-8490F77289F2(a)microsoft.com...
> Does exist some *.inf directive or flag, that deletes previsously created
> oemXX.inf and oemXX.PNF before creating new ?
> Or does exist some API function with help of it I can to find corresponding
> oemXX.inf and oemXX.PNF file names in Windows/inf - if yes no problem to
> delete it with some API function.

See: SetupUninstallOEMInf

Regards,
--PA


From: Peter on
Yes SetupUnistallOEMInf can help, but first I must to know file name.
It seems that only one way to find file name is to iterate through
every oemXX.inf, read it into buffer, search for some string (product name
or something else that is unique unique)
then if string matches delete file.
I cannot believe that Microsoft OS developers designed it by this way...
Does not really exist some *.inf directive or flag that deletes old *.inf ?

Peter

"Pavel A." <pavel_a(a)NOwritemeNO.com> wrote in message
news:OeK62X0cFHA.2180(a)TK2MSFTNGP12.phx.gbl...
> "Peter" <Peter(a)discussions.microsoft.com> wrote in message
> news:DC371AFA-560E-42C7-8D81-8490F77289F2(a)microsoft.com...
>> Does exist some *.inf directive or flag, that deletes previsously created
>> oemXX.inf and oemXX.PNF before creating new ?
>> Or does exist some API function with help of it I can to find
>> corresponding
>> oemXX.inf and oemXX.PNF file names in Windows/inf - if yes no problem to
>> delete it with some API function.
>
> See: SetupUninstallOEMInf
>
> Regards,
> --PA
>
>


From: Ray Trent on
Define "the old INF". Remember that multiple people (including
Microsoft) can write drivers for the same device so PnP IDs are out,
companies and products change their names so those are out, etc., etc.

Any such API would eventually lead to annoying breakage. If Microsoft
does it, everyone complains, if you do it only your customer's complain.

Personally, though, it does seem like if Microsoft *wanted* to
facilitate this, they could add a field to INFs that you'd put a GUID
in, and you could optionally delete INFs with that GUID.

BTW, that's pretty much how we did it back in the days when we thought
it was a good idea... why is it that you think you need to delete the
old INFs?

Peter wrote:
> Yes SetupUnistallOEMInf can help, but first I must to know file name.
> It seems that only one way to find file name is to iterate through
> every oemXX.inf, read it into buffer, search for some string (product name
> or something else that is unique unique)
> then if string matches delete file.
> I cannot believe that Microsoft OS developers designed it by this way...
> Does not really exist some *.inf directive or flag that deletes old *.inf ?
>
> Peter
>
> "Pavel A." <pavel_a(a)NOwritemeNO.com> wrote in message
> news:OeK62X0cFHA.2180(a)TK2MSFTNGP12.phx.gbl...
>> "Peter" <Peter(a)discussions.microsoft.com> wrote in message
>> news:DC371AFA-560E-42C7-8D81-8490F77289F2(a)microsoft.com...
>>> Does exist some *.inf directive or flag, that deletes previsously created
>>> oemXX.inf and oemXX.PNF before creating new ?
>>> Or does exist some API function with help of it I can to find
>>> corresponding
>>> oemXX.inf and oemXX.PNF file names in Windows/inf - if yes no problem to
>>> delete it with some API function.
>> See: SetupUninstallOEMInf
>>
>> Regards,
>> --PA
>>
>>
>
>


--
.../ray\..
From: Peter on
"the old INF" I mean *.inf created in previous driver installation.
In my case that is IM driver.
I need to delete not only oemXX.inf but also oemXX.PNF - because
in *.inf I use:
[AAAMP.AddService.AddReg]
HKR, Parameters, "MyDir", 0, %01%

Registry value under "MyDir" driver uses after loading,
and if product is uninstalled and reinstalled from different directory,
installation does not update "MyDir" in *.PNF compiled from previous
installation.

Peter

"Ray Trent" wrote:

> Define "the old INF". Remember that multiple people (including
> Microsoft) can write drivers for the same device so PnP IDs are out,
> companies and products change their names so those are out, etc., etc.
>
> Any such API would eventually lead to annoying breakage. If Microsoft
> does it, everyone complains, if you do it only your customer's complain.
>
> Personally, though, it does seem like if Microsoft *wanted* to
> facilitate this, they could add a field to INFs that you'd put a GUID
> in, and you could optionally delete INFs with that GUID.
>
> BTW, that's pretty much how we did it back in the days when we thought
> it was a good idea... why is it that you think you need to delete the
> old INFs?
>
> Peter wrote:
> > Yes SetupUnistallOEMInf can help, but first I must to know file name.
> > It seems that only one way to find file name is to iterate through
> > every oemXX.inf, read it into buffer, search for some string (product name
> > or something else that is unique unique)
> > then if string matches delete file.
> > I cannot believe that Microsoft OS developers designed it by this way...
> > Does not really exist some *.inf directive or flag that deletes old *.inf ?
> >
> > Peter
> >
> > "Pavel A." <pavel_a(a)NOwritemeNO.com> wrote in message
> > news:OeK62X0cFHA.2180(a)TK2MSFTNGP12.phx.gbl...
> >> "Peter" <Peter(a)discussions.microsoft.com> wrote in message
> >> news:DC371AFA-560E-42C7-8D81-8490F77289F2(a)microsoft.com...
> >>> Does exist some *.inf directive or flag, that deletes previsously created
> >>> oemXX.inf and oemXX.PNF before creating new ?
> >>> Or does exist some API function with help of it I can to find
> >>> corresponding
> >>> oemXX.inf and oemXX.PNF file names in Windows/inf - if yes no problem to
> >>> delete it with some API function.
> >> See: SetupUninstallOEMInf
> >>
> >> Regards,
> >> --PA
> >>
> >>
> >
> >
>
>
> --
> .../ray\..
>