Page Index Toggle Pages: 1
Topic Tools
Normal Topic SFMpq extract API? (Read 3564 times)
zeeh
Peon
*
Offline


NSIS programmer

Posts: 3
Joined: Mar 15th, 2007
SFMpq extract API?
Mar 15th, 2007 at 12:48am
Post Tools
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.
  
Back to top
 
IP Logged
 
ShadowFlare
Administrator/Lord of Nightmares
*****
Offline


The source of all chaos

Posts: 125
Location: The Sea of Chaos
Joined: May 11th, 2002
Re: SFMpq extract API?
Reply #1 - Mar 19th, 2007 at 1:35am
Post Tools
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.
  

-ShadowFlare

"My mind is my power. My power is my mind.
When uncorrupted by other elements, my mind is my pure power."

"I am a darkness beyond blackest pitch, deeper than the deepest night.
I am the Sea of Chaos. The source of all chaos.
That is how you describe me...
I am... the Lord of Nightmares."
Back to top
WWW  
IP Logged
 
zeeh
Peon
*
Offline


NSIS programmer

Posts: 3
Joined: Mar 15th, 2007
Re: SFMpq extract API?
Reply #2 - Mar 19th, 2007 at 9:15am
Post Tools
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.
« Last Edit: Mar 19th, 2007 at 11:02am by zeeh »  
Back to top
 
IP Logged
 
zeeh
Peon
*
Offline


NSIS programmer

Posts: 3
Joined: Mar 15th, 2007
Re: SFMpq extract API?
Reply #3 - Mar 19th, 2007 at 5:57pm
Post Tools
No luck Sad
Unfortunately, Max Buffer length has 8192 bytes, so I can't put SFileReadFile read content there if file is bigger than 8192 bytes.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools