ExtractDLLEx plug-in: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Wikipedia python library)
 
m (Updated author and download links, and changed format of some pages.)
Line 1: Line 1:
<pre>                         ExtractDLLEx v1.0
== Links ==
                        -----------------</pre>
<attach>Extractdllex.zip</attach><br>
Original:
[[Image:Zip.gif]] [http://www.lkcc.org/achim/download/extractdllex.zip Extractdllex.zip] (135 KB) (Mirror #1)
 
Copyright 2002 by Tim Kosse (tim.kosse@gmx.de)
                         
Changes:
 
- LZMA compression with crc check
- file container support
- wildcard support
- relative path support
- as small as possible dll filesize (7680 byte)
 
Copyright 2004 by Achim Winkler (achim@lkcc.org)
 
 
What is this?
-------------


== What is this? ==
ExtractDLLEx is a extension DLL for NSIS. It can decompress one or  
ExtractDLLEx is a extension DLL for NSIS. It can decompress one or  
more files from a container file which was created with  
more files from a container file which was created with  
Line 24: Line 9:
with NSISdl so that you don't have to download large files  
with NSISdl so that you don't have to download large files  
uncompressed.
uncompressed.
 


Usage
== Usage ==
-----
*Decompression (within NSIS script):
<pre>
**Push path and name of compressed file and then path and name of temporary destination file on top of the stack.
Decompression (within NSIS script):
**Call the function "extract" with CallInstDLL
- Push path and name of compressed file and then path and name of  
**On Success, the string "success" is on top of the stack, else an error message.
  temporary destination file on top of the stack.
**The decompressed files are created in the same directory like the script executable NSIS script file.
- Call the function "extract" with CallInstDLL
**The second filename is only used for temporary file access!
- On Success, the string "success" is on top of the stack, else an  
*Compression (outside NSIS script or using !system):
  error message.
**Call CompressFile.exe with the name of the compressed file and the uncompressed files as parameters. You can use relative paths of the actual directory. The usage of wildcards like * and ? is also supported!
- The decompressed files are created in the same directory like  
**Use always / and not \ in your paths!
  the script executable NSIS script file.
**Don't use / in front of relative paths.
- The second filename is only used for temporary file access!
**../ is not supported in relative paths.
 
**CompressFile needs the lzma.exe file!
Compression (outside NSIS script or using !system):
- Call CompressFile.exe with the name of the compressed file  
  and the uncompressed files as parameters. You can use relative
  paths of the actual directory. The usage of wildcards like * and
  ? is also supported!
- Use always / and not \ in your paths!
- Don't use / in front of relative paths.
- ../ is not supported in relative paths.
- CompressFile needs the lzma.exe file!
</pre><BR><BR><BR> 


 
== Example ==
Example
=== Compression ===
-------
CompressFile.exe test.7z test.* te?t.exe test1/test2/test.txt


Compression Example:
=== Decompression (NSIS script) ===
 
<highlight-nsis>
CompressFile.exe test.7z test.* te?t.exe test1/test2/test.txt
    Push "test.7z"
 
    Push "update.tmp"
 
Decompression Example (NSIS script):


<highlight-nsis>    Push "test.7z"
    Push "update.tmp"
 
     ExtractDllEx::extract
     ExtractDllEx::extract
 
 
     ;get the result
     ;get the result
     Pop $0
     Pop $0
     StrCmp $0 success SUCCESS
     StrCmp $0 success SUCCESS
       MessageBox MB_OK|MB_ICONSTOP "$0"
       MessageBox MB_OK|MB_ICONSTOP "$0"
 
 
     SUCCESS:
     SUCCESS:
</highlight-nsis>  
</highlight-nsis>
      
      
Process Overview
== Process Overview ==
----------------
1. Batch file compresses files:
CompressFile.exe test.7z test.* test/test.txt
 
2. The process begins:
<pre>
<pre>
  ; batch file to compress files
  CompressFile.exe test.7z test.* test/test.txt
 
 
         test.exe      test.dat    test/test.txt
         test.exe      test.dat    test/test.txt
                 \        |        /
                 \        |        /
Line 102: Line 70:
                   /      |      \
                   /      |      \
           test.exe    test.dat    test/test.txt
           test.exe    test.dat    test/test.txt
</pre>        
</pre>


<highlight-nsis> ; nsis script to unpack files
3. NSIS script unpacks files:
<highlight-nsis>
   Push "test.7z"
   Push "test.7z"
   Push "update.tmp"
   Push "update.tmp"
Line 118: Line 87:
</highlight-nsis>
</highlight-nsis>


Known limitations
== Changes from Original Version ==
-----------------
* LZMA compression with CRC check.
* File container support.
* Wildcard support.
* Relative path support.
* Smaller DLL file size.


Zlip and LZMA compression are included. The included plugin supports
== Known limitations ==
Zlib and LZMA compression are included. The included plugin supports
only LZMA because of the better compression ans smaller filesize.
only LZMA because of the better compression ans smaller filesize.


== Credits ==
; Modified by:
: Copyright 2004 by Achim Winkler (achim@lkcc.org)


Download
; Created by:
--------
: Copyright 2002 by Tim Kosse (tim.kosse@gmx.de)
 
[[Image:Zip.gif]] [http://www.lkcc.org/achim/download/extractdllex.zip ExtractDLLEx] 1.0 (138,961 bytes)
 
 
Legal Stuff
-----------


== Legal Stuff ==
This software is provided 'as-is', without any express or implied
This software is provided 'as-is', without any express or implied
warranty.  In no event will the authors be held liable for any damages
warranty.  In no event will the authors be held liable for any damages
Line 141: Line 113:
including commercial applications, and to alter it and redistribute it
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
freely, subject to the following restrictions:
<pre>
1. The origin of this software must not be misrepresented; you must not
  claim that you wrote the original software. If you use this software
  in a product, an acknowledgment in the product documentation would be
  appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
  misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
</pre>


Page author: mumpitzstuff
# The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
# Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
# This notice may not be removed or altered from any source distribution.
 
Page author: [[User:mumpitzstuff|mumpitzstuff]]

Revision as of 12:43, 23 April 2005

Links

Extractdllex.zip (135 KB)
Zip.gif Extractdllex.zip (135 KB) (Mirror #1)

What is this?

ExtractDLLEx is a extension DLL for NSIS. It can decompress one or more files from a container file which was created with compressfile.exe before. It is especially useful in combination with NSISdl so that you don't have to download large files uncompressed.

Usage

  • Decompression (within NSIS script):
    • Push path and name of compressed file and then path and name of temporary destination file on top of the stack.
    • Call the function "extract" with CallInstDLL
    • On Success, the string "success" is on top of the stack, else an error message.
    • The decompressed files are created in the same directory like the script executable NSIS script file.
    • The second filename is only used for temporary file access!
  • Compression (outside NSIS script or using !system):
    • Call CompressFile.exe with the name of the compressed file and the uncompressed files as parameters. You can use relative paths of the actual directory. The usage of wildcards like * and ? is also supported!
    • Use always / and not \ in your paths!
    • Don't use / in front of relative paths.
    • ../ is not supported in relative paths.
    • CompressFile needs the lzma.exe file!

Example

Compression

CompressFile.exe test.7z test.* te?t.exe test1/test2/test.txt

Decompression (NSIS script)

    Push "test.7z"
    Push "update.tmp"
 
    ExtractDllEx::extract

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

Process Overview

1. Batch file compresses files:

CompressFile.exe test.7z test.* test/test.txt

2. The process begins:

         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

3. NSIS script unpacks 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:

Changes from Original Version

  • LZMA compression with CRC check.
  • File container support.
  • Wildcard support.
  • Relative path support.
  • Smaller DLL file size.

Known limitations

Zlib and LZMA compression are included. The included plugin supports only LZMA because of the better compression ans smaller filesize.

Credits

Modified by
Copyright 2004 by Achim Winkler (achim@lkcc.org)
Created by
Copyright 2002 by Tim Kosse (tim.kosse@gmx.de)

Legal Stuff

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.

Page author: mumpitzstuff