Example 3:
Problems installing CAB files from a CD-ROM
subdirectory
//
// Open the inf file ( InfFile includes full path)
//
Inf = SetupOpenInfFile( InfFile, NULL, INF_STYLE_WIN4, NULL );
if ( Inf == INVALID_HANDLE_VALUE )
{
return FALSE;
}
if( !SetupSetDirectoryId( Inf, InfId, DestDir ) )
{
return FALSE;
}
FileQueue = SetupOpenFileQueue();
if ( FileQueue == INVALID_HANDLE_VALUE )
{
SetupCloseInfFile(Inf);
return FALSE;
}
//
// If you use FileMon you will see that it is looking for a Cab
// file under the root directory of your CD even though SrcDir
// includes the full path to the Inf and Cab file.
//
if ( !SetupInstallFilesFromInfSection( Inf, NULL, FileQueue,
InfSection, SrcDir, SP_COPY_NEWER ) )
{
SetupCloseFileQueue(FileQueue);
SetupCloseInfFile(Inf);
return FALSE;
}
context.DefaultContext = SetupInitDefaultQueueCallback( Parent );
if ( context.DefaultContext == NULL )
{
SetupCloseFileQueue(FileQueue);
SetupCloseInfFile(Inf);
return FALSE;
}
//
// If you use FileMon you will see that it is looking for a Cab
// file under the root directory of your CD
//
if ( !SetupCommitFileQueue( Parent, FileQueue,
(PSP_FILE_CALLBACK) InfQueueCallback, &context ) )
{
SetupTermDefaultQueueCallback(context.DefaultContext);
SetupCloseFileQueue(FileQueue);
SetupCloseInfFile(Inf);
return FALSE;
}