Hi
Are you trying to use ODFRC compiler?
Unfortunately i don't know how to create proper resource for compressed data. I've found in SDK (CoreResTypes.h)
#define kPackagesRsrcType 'PCKS'
and
#define kBinaryBlobType 'BBlb' //taken from DynamicDocumentsExtrasDefs
But don't know the macro to create that kind of resource.
The good thing is that you can cheat a bit and use PNG resource, since this is also binary data.
Just define your zip file as PNG resource and use IPMStream to write the data to the disk.
All you need to do is to define in your .fr file path to the zip which is relative path from your project file:
#define kYOUR_ZIP_FILERsrcID 15
#ifdef __ODFRC__
resource PNGA(kYOUR_ZIP_FILERsrcID) "../../your_zip_file.zip"
#endif // __ODFRC__
and in your class read the resource and write it into a file:
WideString theFilePath("/Users/userName/Desktop/theFile.zip");
const IDFile theFile(theFilePath);
RsrcSpec theRsrc(kYourPluginID, kPNGArtRsrcType, kYOUR_ZIP_FILERsrcID, kFalse);
InterfacePtr<IPMStream> rsrcStream((IPMStream*) StreamUtil::CreateResourceStreamRead(theRsrc, kFalse));
InterfacePtr<IPMStream> fileStream(StreamUtil::CreateFileStreamWrite(theFile));
fileStream->Open();
fileStream->SetEndOfStream();
unsigned long totalIBytes = 0;
unsigned long totalOBytes = 0;
unsigned long iSize = -1;
unsigned long oSize = 0;
while (rsrcStream->IsReading() && iSize > 0)
{
unsigned char data[1024];
iSize = rsrcStream->XferByte(data, 1024);
oSize = fileStream->XferByte(data, iSize);
totalIBytes += iSize;
totalOBytes += oSize;
}
rsrcStream->Close();
fileStream->Close();
Regards
Bartek