Skip to content
⌘ NSIS Forum Archive

Nsis7z -- How do I use it?

5 posts

kfcsmitty#

Nsis7z -- How do I use it?

Hi Everyone,

Sorry, I've Googled and I've searched the forums, but I can't seem to find an answer to my question.

Scenario: I have an installer I'm making, but the data is over 2GB. I used 7zip to compress some specific files down and now the installer creates properly, but obviously I need to extract the 7zip files on the users' computer for the installation to be complete.

I downloaded http://nsis.sourceforge.net/Nsis7z_plug-in and put it into my plugins folder.

I added the following lines to my .nsi file:

Nsis7z::ExtractWithDetails "Tile.7z" "Decompressing %s..."
Delete "$OUTDIR\Tile.7z"
Nsis7z::ExtractWithDetails "Sprites.7z" "Decompressing %s..."
Delete "$OUTDIR\Sprites.7z"
Nsis7z::ExtractWithDetails "Map And Sounds.7z" "Decompressing %s..."
Delete "$OUTDIR\Map And Sounds.7z"
The installer compiles fine, it runs fine and says everything worked... Except it doesn't extract my files.

Is there something special I need to do? I had thought the dll I downloaded would actually extract the files, but as far as I can tell, it doesn't and it doesn't give me any errors.

Any help is appreciated.

Thanks,

Smitty
Anders#
You should specify the full path to the .7z files. (And it is probably not $OutDir, $ExeDir is the same directory as the installer if that is where they are)
kfcsmitty#
Thanks for the quick reply!

I had set the outpath using


SetOutPath $INSTDIR
but just to be safe, I changed the code to be as below:


Nsis7z::ExtractWithDetails "$INSTDIR\Tile.7z" "Decompressing %s..."
Delete "$INSTDIR\Tile.7z"
Nsis7z::ExtractWithDetails "$INSTDIR\Sprites.7z" "Decompressing %s..."
Delete "$INSTDIR\Sprites.7z"
Nsis7z::ExtractWithDetails "$INSTDIR\Map And Sounds.7z" "Decompressing %s..."
Delete "$INSTDIR\Map And Sounds.7z"
That is successfully deleting the .7z files, but it still isn't actually extracting them... again no error is being displayed...

Do I need to download a standalone 7zip command line app and add it to my installer for this to work or anything?

Thanks again!

Smitty
kfcsmitty#
Update:

So I switched from using the x86-unicode dll and used the x86-ansi one and it is actually extracting the files now.

However, the status being displayed is off.

It says "Decompressing XX%" where the % seems to be accurate, but then it lists (0 /XXX MB) where XXX is the amount that has been extracted and the 0 always stays at 0.

Has anyone encountered that before or know of a fix? I would be fine even if there was a way to just show the % and not the #'s.
Afrow UK#
I have uploaded a new build which uses the latest 7-Zip 15.14 SDK.



Stu