- NSIS Discussion
- ExtractDLLEx Plugin
Archive: ExtractDLLEx Plugin
mumpitzstuff
12th September 2004 00:42 UTC
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
12th September 2004 13:34 UTC
Could you create an NSIS Archive page for this?
http://nsis.sourceforge.net/archive/nsisweb.php
-Stu
ImmortAlex
13th September 2004 04:50 UTC
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
13th September 2004 04:52 UTC
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
13th September 2004 05:10 UTC
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
13th September 2004 08:12 UTC
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
13th September 2004 08:44 UTC
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
13th September 2004 08:56 UTC
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
13th September 2004 09:03 UTC
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
ImmortAlex
13th September 2004 09:21 UTC
What should I push as name of file to extract? "*.*" or something else?
mumpitzstuff
13th September 2004 09:23 UTC
DLL based on msvcrt.dll
Hello,
try this files if you do not have msvcr71.dll installed (like on most systems...)
Achim
dujuan
13th September 2004 14:40 UTC
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
13th September 2004 15:09 UTC
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
13th September 2004 16:46 UTC
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
13th September 2004 18:03 UTC
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
14th September 2004 01:47 UTC
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
14th September 2004 06:15 UTC
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
14th September 2004 07:28 UTC
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
14th September 2004 11:12 UTC
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
14th September 2004 11:49 UTC
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
dujuan
14th September 2004 12:07 UTC
Success!
Thank you very much!!!
mumpitzstuff
15th September 2004 11:25 UTC
some bugfixes and crc support
Hello,
here is a new version of the plugin. Have fun!
Achim
dujuan
15th September 2004 13:27 UTC
Good!
Does this new verion depend on msvcr71.dll ?
mumpitzstuff
15th September 2004 15:57 UTC
this version depends on msvcrt.dll. this file should be included in every windows version down to win95.
achim
Yathosho
16th September 2004 19:38 UTC
would it be much work, to make it work the other way round? a plugin that creates 7z archives?
mumpitzstuff
17th September 2004 11:11 UTC
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
17th September 2004 16:43 UTC
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
18th September 2004 17:49 UTC
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?
dujuan
19th September 2004 02:05 UTC
Download LZMA SDK 4.06
mumpitzstuff
20th September 2004 11:02 UTC
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
mumpitzstuff
21st September 2004 10:17 UTC
hello,
i found a simple solution for your problem...
1.) create a packed file e.g. test.7z
2.) create a compiled nsis script (test.exe) where you set the variable SetOutPath to the directory you want to unpack the files (e.g. c:\unpacked) and call the extract function of the plugin after it.
3.) copy test.7z to the same directory like SetOutPath e.g. c:\unpacked\test.7z
4.) now copy test.exe to any directory you want e.g. c:\packed and execute test.exe
5.) the files from c:\packed\test.7z should be unpacked in c:\unpacked\*.* now
Function Test
SetOutPath "c:\unpacked"
;path not needed
Push "c:\unpacked\test.7z"
Push "c:\unpacked\update.tmp"
ExtractDllEx::extract
;get the result
Pop $0
StrCmp $0 success SUCCESS
MessageBox MB_OK|MB_ICONSTOP "$0"
Delete "update.tmp"
Quit
SUCCESS:
;Delete temp files
Delete "update.tmp"
FunctionEnd
achim
dujuan
22nd September 2004 03:37 UTC
Good!
thx!
RoMZERO
3rd November 2004 21:28 UTC
why the plugin dont work with files compressed with 7-zip ?
i'm use 7-zip 4.10