Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SetupCopyOEMInf of IM driver

101 views
Skip to first unread message

shawn

unread,
Jan 14, 2003, 10:22:10 AM1/14/03
to
I want the source path location information stored in the PNF to be the path
of SourceInfFileName after the call to SetupCopyOEMInf(), whether or not the
INF file already exists in %WINDIR%\inf:

SetupCopyOEMInf(
szSourceInfFileName,
NULL,
SPOST_PATH,
SP_COPY_REPLACEONLY | SP_COPY_NOOVERWRITE,
szDestInfFileName,
MAX_PATH,
NULL,
NULL
);

Thanks,
Shawn


Eliyas Yakub [MSFT]

unread,
Jan 14, 2003, 12:15:50 PM1/14/03
to
You can get the source media path by using this special symbol in the
original INF.

OriginalInfSourcePath = %1%

Take a look at the GetMediaRootDirectory routine in the
toaster\toastpkg\toastco\toastco.c file and also the toastpkg.inf INF file
which specifies this symbol. If I remember it right, the MUX IM sample of XP
DDK also uses this technique to workaround CopyINF directive issue on Win2K.

--
-Eliyas
This posting is provided "AS IS" with no warranties, and confers no rights.

"shawn" <sh...@att.com> wrote in message
news:eRbTsC#uCHA.2372@TK2MSFTNGP12...

shawn

unread,
Jan 15, 2003, 9:31:45 AM1/15/03
to
The problem is that the old version of my install deleted the driver files
in the original source path (which was in %tmp%). My new install copies the
driver media a new subdirectory that I save. When I update the driver, the
operating system seems to think that I'm installing from the original source
path (%tmp%) and tries to copy the .sys file from that location, but since
it has been deleted the user is prompted for location of the driver file.

If I set the CopyStyle = to SP_COPY_REPLACEONLY | SP_COPY_NOOVERWRITE, will
that always update the corresponding PNF with the new source path location?

Thanks,
Shawn

"Eliyas Yakub [MSFT]" <eli...@online.microsoft.com> wrote in message
news:uLltCC$uCHA.848@TK2MSFTNGP11...

Jeff McCashland [MS]

unread,
Jan 17, 2003, 2:03:34 PM1/17/03
to
Shawn,

If you include the path to your new installation folder in the second
parameter of the SetupCopyOEMInf call, then the PNF should be created with
that location. It sounds like PnP may be choosing your old driver for the
device, rather than the new driver. Is the new driver signed? You might
want to turn on verbose SetupAPI logging and see if PnP is selecting the
wrong driver, and why.

Thanks,
Jeff McCashland [MS]

shawn

unread,
Jan 22, 2003, 5:11:11 PM1/22/03
to

I need to handle the case when the INF exists and doesn't exist in the
destination directory. Should I call SetupCopyOEMInf with CopyStyle =
SP_COPY_NOOVERWRITE | SP_COPY_REPLACEONLY, or should I call it with
CopyStyle = SP_COPY_NOOVERWRITE first, and if it returns ERROR_FILE_EXISTS,
call it again with CopyStyle = SP_COPY_REPLACEONLY?

"Jeff McCashland [MS]" <je...@online.microsoft.com> wrote in message
news:oK7QeslvCHA.1844@cpmsftngxa09...

Jeff McCashland [MS]

unread,
Jan 23, 2003, 6:18:42 PM1/23/03
to
Shawn,

The SetupCopyOEMInf call is used to pre-install drivers for non-present
devices. If you are updating a driver for a present device, you can use
UpdateDriverForPlugAndPlayDevices on Windows 2000 and XP. If the device
was previously installed with your old driver, but is currently not
present, then look at the UpdateDriverThreadProc function in the
toastpkg\toastva.c (suggested by eliyasy). This routine shows how to
update drivers for non-present devices.

0 new messages