Skip to content
⌘ NSIS Forum Archive

ExtractDLLEx Plugin

33 posts

mumpitzstuff#

ExtractDLLEx Plugin

Hello,

i enhanced the original ExtractDLL Plugin from Tim Kosse with the following features:

- added LZMA compression
- added file container support to add more than one file to the compressed file (like zip)
- added wildcard support (* and ?)
- added relative path support

Have fun with the plugin...

Achim Winkler

Homepage
Download
Afrow UK#
Could you create an NSIS Archive page for this?



-Stu
ImmortAlex#
Plugin depends on msvcr71.dll. My W2K Prof SP4 doesn't contains this dll. (Yes, I found it in some other program, but anyway...)
dujuan#
hello, I am a beginner,
Can somebody tell me how to ues ExtractDLLEx.dll ?

I have read readme.txt, but I still don't know the meaning of "Call the function "extract" with CallInstDLL"
ImmortAlex#
1. Copy extractdllex.dll into NSIS\Plugins directory.
2. In your script write:

Push "name_of_compressed_file"
Push "name_of_file_to_extract"
extractdllex::extract
Pop $0
After that you'll have result code ("success" or error text) in $0.

... And I found that plugin doesn't support masks in name of file to extract 🙁
mumpitzstuff#
And I found that plugin doesn't support masks in name of file to extract 🙁
This feature is only needed for the compression of files! How should the plugin extract files with masks??? Thats impossible.

Achim
ImmortAlex#
I want to use some archiver for backup when install over pervious installation and restore when uninstall.
When I install I can use CompressFile.exe to create backup file, contains all installation directory, but when I uninstall I can't use extractdllex for restore previous state because I can't extract *.*
That's all. I think I will use full version of 7-zip, or something else GPL-ed.
mumpitzstuff#
Plugin depends on msvcr71.dll. My W2K Prof SP4 doesn't contains this dll. (Yes, I found it in some other program, but anyway...)
you are right. i will fix that next days and will release a new version. thx for the tip!

achim
mumpitzstuff#
When I install I can use CompressFile.exe to create backup file, contains all installation directory, but when I uninstall I can't use extractdllex for restore previous state because I can't extract *.*.
thats not correct. if you create a backup with compressfile.exe (this needs lzma.exe!) with the following command:

compressfile test.7z test.* /test/test.*

and you have a directory structure like:

test.exe
test.ext
test.dat
/test/test.exe
/test/text.ext
/test/test.dat

all 6 files gets compressed into test.7z! now copy the test.7z to the directory where you want to extract the files and call the extract function to get your 6 files including the directory structure back!

achim
mumpitzstuff#edited
DLL based on msvcrt.dll

Hello,

try this files if you do not have msvcr71.dll installed (like on most systems...)

Achim
dujuan#
Originally posted by mumpitzstuff
thats not correct. if you create a backup with compressfile.exe (this needs lzma.exe!) with the following command:

compressfile test.7z test.* /test/test.*

and you have a directory structure like:

test.exe
test.ext
test.dat
/test/test.exe
/test/text.ext
/test/test.dat

all 6 files gets compressed into test.7z! now copy the test.7z to the directory where you want to extract the files and call the extract function to get your 6 files including the directory structure back!

achim
After I get test.7z , I write my script:

ExtractDLLEx::extract "e:\web\*.*" "e:\test.7z"

But there is something wrong, there is no file at the folder "e:\web" at the result.
mumpitzstuff#
hi,

okay my explanation was wrong.

the follwoing:

ExtractDLLEx::extract "e:\web\*.*" "e:\test.7z"

should be:

Push "test.7z"
Push "update.tmp"

ExtractDll::extract

update.tmp is only the temporary filename for the decompression. after decompression the temp file gets splitted to the original files!

achim
dujuan#
I am so foolish that I don't know how to decompression the temp file(update.tmp). Can you tell me ?

Please don't kick me...
mumpitzstuff#
okay you have the compressed test.7z file created with compressfile.exe. now write a little script where you call exactly this:

Push "test.7z"
Push "update.tmp"

ExtractDLLEx::extract

now create a exe file (let me call it update.exe) from your script and put the update.exe and test.7z into the same directory. you should create a new directory to see that something changed. execute the update.exe file and the file or files you compressed before should be uncompressed to this directory.
i do not know how i can make it more clear...

to get the result of the unpacking process you can enhance the script:

Push "test.7z"
Push "update.tmp"

ExtractDll::extract

;get the result
Pop $0
StrCmp $0 success SUCCESS
MessageBox MB_OK|MB_ICONSTOP "$0"

SUCCESS:


i hope this helps.

achim
dujuan#
Thank you very much!

I think my explanation was wrong.

my step:
1.Create update.exe
2.Put update.exe and test.7z in the same directory
3.Execute update.exe, and get update.tmp

I think update.tmp is a file container. How can I get the 6 original file in the update.tmp ?
mumpitzstuff#
you get the files like i described it before with the extract command!!!!!!!! the extract command unpack the filecontainer to update.tmp and split the filecontainer to the original files!!!! it is not needed to do more.

achim
mumpitzstuff#
the following is the pack/unpack sequence:

; batch file to compress files
CompressFile.exe test.7z test.* test/test.txt


test.exe test.dat test/test.txt
\ | /
\ | /
\ | /
\ | /
CompressFile.exe \ | /
pack.tmp (hardcoded in CompressFile)
|
|
test.7z
--------------------------------------------------------
test.7z
|
|
update.tmp (temporary file!)
ExtractDLLEx.dll / | \
/ | \
/ | \
/ | \
/ | \
test.exe test.dat test/test.txt


; nsis script to unpack files
Push "test.7z"
Push "update.tmp"

ExtractDllEx::extract

;get the result
Pop $0
StrCmp $0 success SUCCESS
MessageBox MB_OK|MB_ICONSTOP "$0"

SUCCESS:
thats all i can say about it. i do not have more options to explain it...

achim
dujuan#
I apologize for my dumpishness.

when I execute update.exe, therer is one error:
Could not open splitted destination file.

my OS : Windows XP pro + SP2
my sources file and nsis script:
mumpitzstuff#
ahhhh now i see the problem. .. in relative paths is not supported at this time! the files you want to compress should be in the same directory like compressfile.exe or in subdirectories created in the same directory like compressfile.exe!!!

achim
mumpitzstuff#
some bugfixes and crc support

Hello,

here is a new version of the plugin. Have fun!

Achim
mumpitzstuff#
this version depends on msvcrt.dll. this file should be included in every windows version down to win95.

achim
Yathosho#
would it be much work, to make it work the other way round? a plugin that creates 7z archives?
mumpitzstuff#
hello,

to pack lzma is not so easy because there is no simple c interface for it. i tried it already and got a file of round 100kb. thats to much in my opinion but also to much work to make it smaller. at this time you can use compressfile and lzma.exe together to pack files...

achim
dujuan#
hello,

When I execute update.exe(created from script), the filecontainer(update.tmp) will be splitted to the original files at the same directory.
my question: how to split filecontainer to the original files to the special directory?
Yathosho#
Originally posted by mumpitzstuff
hello,

to pack lzma is not so easy because there is no simple c interface for it. i tried it already and got a file of round 100kb. thats to much in my opinion but also to much work to make it smaller. at this time you can use compressfile and lzma.exe together to pack files...

achim
so far i was using 7za.exe to do that, but as this is capable of packing and extracting, the filesize is quite big. where exactly can i get lzma.exe?
mumpitzstuff#
Originally posted by dujuan
how to split filecontainer to the original files to the special directory?
thats not supported at this time. but i will see what i can do...

achim