ShadowFlare's Realm
http://sfsrealm.hopto.org/cgi-bin/yabb2/YaBB.pl
ShadowFlare's Realm Forums >> Support >> SFMpq extract API?
http://sfsrealm.hopto.org/cgi-bin/yabb2/YaBB.pl?num=1173919721

Message started by zeeh on Mar 15th, 2007, 1:48am

Title: SFMpq extract API?
Post by zeeh on Mar 15th, 2007, 1:48am

Hi, there! I am trying to use sfmpq.dll with NSIS (open-source installer) by calling dll API. It can create, open, add files, read files and get file information, but I am really lost on how to call an api to extract files from MPQ. There is a way if  program reads file's content and export it to a new file created with windows API, but NSIS does not support more than a maximum string length of 8192 bytes. Can someone help me? Thanks a lot.

Title: Re: SFMpq extract API?
Post by ShadowFlare on Mar 19th, 2007, 2:35am

Is it possible for you to incrementally write the data to the output file?  If so, you could read the file 4096 or 8192 bytes at a time and write that to the output file after each read operation.

Title: Re: SFMpq extract API?
Post by zeeh on Mar 19th, 2007, 10:15am

Thanks for the reply, ShadowFlare. Yes, I can try it, there is a FileOpen, FileWriteByte and FileSeek command, I have to verify the file uncompressed length and with a loop read and write 8192 bytes each time, appending data at the end, but it will slow down the installation a lot.

Title: Re: SFMpq extract API?
Post by zeeh on Mar 19th, 2007, 6:57pm

No luck :(
Unfortunately, Max Buffer length has 8192 bytes, so I can't put SFileReadFile read content there if file is bigger than 8192 bytes.

ShadowFlare's Realm » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.