Old 7th March 2016, 14:39   #1
kfcsmitty
Junior Member
 
Join Date: Mar 2016
Posts: 3
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:

code:
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
kfcsmitty is offline   Reply With Quote
Old 7th March 2016, 14:42   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,194
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)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 7th March 2016, 14:54   #3
kfcsmitty
Junior Member
 
Join Date: Mar 2016
Posts: 3
Thanks for the quick reply!

I had set the outpath using

code:

SetOutPath $INSTDIR



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

code:

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 is offline   Reply With Quote
Old 7th March 2016, 15:47   #4
kfcsmitty
Junior Member
 
Join Date: Mar 2016
Posts: 3
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.
kfcsmitty is offline   Reply With Quote
Old 11th March 2016, 14:29   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I have uploaded a new build which uses the latest 7-Zip 15.14 SDK.

http://nsis.sourceforge.net/File:Nsis7z.zip

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump