Welcome, Guest. Please Login
Back to main page
  News:
Welcome to the ShadowFlare's Realm Forums.  New registrations are by request only.  To be considered for a new forum account, send an e-mail with the user name and display name you want and the reason you want to register.
  Home SFRealm HelpSearchLogin  
 
Pages: 1
Send Topic Print
SFMpq extract API? (Read 3232 times)
zeeh
Peon
*
Offline

NSIS programmer

Posts: 3

SFMpq extract API?
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.
Back to top
 
 
  IP Logged
ShadowFlare
Administrator/Lord of Nightmares
*****
Offline

The source of all
chaos

Posts: 125
The Sea of Chaos
Re: SFMpq extract API?
Reply #1 - 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.
Back to top
 
 

-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."
WWW 46431561 ShadowFlareSFR   IP Logged
zeeh
Peon
*
Offline

NSIS programmer

Posts: 3

Re: SFMpq extract API?
Reply #2 - 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.
Back to top
 
« Last Edit: Mar 19th, 2007, 12:02pm by zeeh »  
  IP Logged
zeeh
Peon
*
Offline

NSIS programmer

Posts: 3

Re: SFMpq extract API?
Reply #3 - Mar 19th, 2007, 6:57pm
 
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
Pages: 1
Send Topic Print