SetupDecompressOrCopyFile
The SetupDecompressOrCopyFile function copies a file, decompressing it if necessary.
DWORD SetupDecompressOrCopyFile(
PCTSTR SourceFileName, // filename of the source file
PCTSTR TargetFileName, // filename after copy operation
PUINT CompressionType // optional, source file compression
);
Parameters
-
SourceFileName
-
Filename of the file to copy. If CompressionType is not specified and the SetupDecompressOrCopyFile function does not find the file specified in SourceFileName, the function searches for the file with up to two alternate, "compressed-form" names. For example, if the file is F:\mips\cmd.exe and it is not found, the function searches for F:\mips\cmd.ex_ and, if that is not found, F:\mips\cmd.ex$ is searched for. If CompressionType is specified, no additional processing is performed on the filename; the file must exist exactly as specified or the function fails.
-
TargetFileName
-
Supplies the exact name of the target file that will be created by decompressing or copying the source file.
-
CompressionType
-
This optional parameter points to the compression type used on the source file. You can determine the compression type by calling SetupGetFileCompressionInfo. If this value is FILE_COMPRESSION_NONE, the file is copied (not decompressed) regardless of any compression in use on the source. If CompressionType is not specified, this routine determines the compression type automatically.
Return Values
The SetupDecompressOrCopyFile function returns a Win32 error code that indicates the outcome of the operation. For more information about Win32 error codes, see the WINERROR.H header file included with the Platform SDK.
To get extended error information, call GetLastError.
QuickInfo
Windows NT: Use version 4.0 and later.
Windows: Use Windows 95 and later.
Windows CE: Unsupported.
Header: Declared in setupapi.h.
Import Library: Link with setupapi.lib.
See Also
Overview, Functions, SetupGetFileCompressionInfo