Skip to content
⌘ NSIS Forum Archive

Plugin to extract 7-Zip 4.10 files

74 posts

Joel#
Originally posted by thanatos83
hi guys, this plugin can extract rar files too???
Hi thanatos83, you need to read a little further 😉
Since the plugin reads files from 7zip, let's got its site, quote from there:
Supported formats:

* Packing / unpacking: 7z, ZIP, GZIP, BZIP2 and TAR
* Unpacking only: ARJ, CAB, CHM, CPIO, DEB, DMG, HFS, ISO, LZH, LZMA, MSI, NSIS, RAR, RPM, UDF, WIM, XAR and Z.
How about that 😁
fedotawa#
Plugin breaks non ANSI file pathname encoding (for example it switches from cyrillic 1251 to 866, this causes shortcut creation into inproper places).

Here's a fix.
thanatos83#
Hi...

I need a help please with this plugin... I read the wiki about the usage of this plugin, like this:

Unpack you merge module as 7z archive to somewere on users harddrive, set target dir for archive contents with SetOutPath, and call plugin.

My question is:

when this say merge module it is referred to standalone file 7za.exe???
MSG#
I think that line is trying to say "unpack your 7z archive using the File command, then use SetOutPath to set the extraction output directory and call the plugin."
thanatos83#
OK ,so i saw that example but before from command script File you can see SetCompress off. But i think about the file command, it compress that 7z into setup.exe (so SetCompress off is not working?)

This plugin first copy 7z into harddrive and then extracts the contents???

I was searching for a long time a plugin that allow me to extract contents froms some 7z files with an animated bar but only i need to extract it from fixed media like DVD. So I need to make a little setup.exe...

thanks.

P.D.

Sorry admin about duplicate post, please delete one...
thanatos83#
OK ,so i saw that example but before from command script File you can see SetCompress off. But i think about the file command, it compress that 7z into setup.exe (so SetCompress off is not working?)

This plugin first copy 7z into harddrive and then extracts the contents???

I was searching for a long time a plugin that allow me to extract contents froms some 7z files with an animated bar but only i need to extract it from fixed media like DVD. So I need to make a little setup.exe...

thanks. 🙂
MSG#
Originally Posted by thanatos83 View Post
OK ,so i saw that example but before from command script File you can see SetCompress off. But i think about the file command, it compress that 7z into setup.exe (so SetCompress off is not working?)
No, the command only makes NSIS turn off compression. Of course it still stores the file in the installer, otherwise it wouldn't be able to extract the file when the File command is called during installation. Turning off compression only helps by making the installer compilation go faster.

Originally Posted by thanatos83 View Post
This plugin first copy 7z into harddrive and then extracts the contents???
Please don't use ??? like that, it makes you sound like you're shouting.

And no. You first have to copy the 7z to the harddrive using the File command (it's actually called extracting, not copying, because you need to extract it from the installer exe.) Or you can use a 7z file from a CD, or a downloaded one, of course.
thanatos83#
thanks MSG and sorry for "???" 🙂

I have some files in 7z format file, so my project takes about 8GB...so i need a plugin that allow me to extract these files from fixed media, like DVD...

If i use de 7z standalone file for use command line, this work for me but progress bar not moving and not showing the information progress like "10% - file.xx".
MSG#
Indeed, the standalone 7z is not designed for NSIS, so it will not output information to the NSIS log by itself. You can try using nsExec::ExecToLog, but if I recall correctly it doesn't work here because 7z doesn't just print information, it updates it as well (like the percentage counter). And that doesn't work with ExecToLog, as far as I know.

But have you tried the 7z plugin? It should be able to unpack a 7z archive just fine.
parasoul#
Is it possible to implement handling of password-protected archives?

This would be a much more convenient solution than using Dcrypt to protect some valuable files.
pizzaM4N#
is it possible to implement an option for unpacking lzma2 compressed .7z files? If you try to unpack lzma2 files with this plugin, all the unpacked files have a size of 0KB.
MSG#
As a makeshift solution you could turn your lzma2 file into a self-extracting exe. You can then use:

ExecWait '"Path\YourExe.exe" x -o"$INSTDIR" -y' $0
${If} $0 != "0"
MessageBox MB_OK "File extraction failed"
${EndIf}

You can distribute 7x sfx exes for free for commercial apps as well, as the creator mentions here: http://sourceforge.net/projects/seve.../topic/3361543
Yathosho#edited
Originally Posted by parasoul View Post
Is it possible to implement handling of password-protected archives?

This would be a much more convenient solution than using Dcrypt to protect some valuable files.
the plugin does not support that and the author doesn't bother to make any comments on his plans. the best (and probably easiest) would be the option to supply any of the available commandline arguments. personally i'm looking for the -p, -i and -e switches to be supported.
extremecarver#
Well, I've tried out the new 921 based plugin, but it cannot extract lzma2 (it just outputs 0bit files)?

Anything I'm doing wrong?
Anyone got a solution right now, to internally unpack lzma2 - it's nearly two years later compared to the last post?
extremecarver#
Originally Posted by MSG View Post
As a makeshift solution you could turn your lzma2 file into a self-extracting exe. You can then use:

ExecWait '"Path\YourExe.exe" x -o"$INSTDIR" -y' $0
${If} $0 != "0"
MessageBox MB_OK "File extraction failed"
${EndIf}

You can distribute 7x sfx exes for free for commercial apps as well, as the creator mentions here: http://sourceforge.net/projects/seve.../topic/3361543
Just make sure, that if you use it, you know there is a 2-4GB limit here too. SFX created by 7-zip over 4GB don't open "This is not a valid Win32.."...
I just lost about a full day of work, not knowing this. Because I adapted lots of code to the SFX to implement them, only to find out in real use, that it won't work...

So lzma2 for Nsis - yeah, but really not useful. Cause if you have a big amount of data, you cannot use sfx. And for small amounts, lzma packed with 7zip (and not stupidly slow Nsis) works okay enough. Still native lzma2 support - or at least using the plugin would be really great...
PPeti66x#edited
I made some changes in nsis7z plugin:

1.) Visual Studio 2008 to 2003 and 6.0 backport.
The compiled file now should be compatible with Win95/98/ME and NT4 systems. (VS6 version successfully tested on Windows 98SE)

2.) .\CPP\7zip\Bundles\Nsis7z\nsis7z.cpp
In ExtractWithCallback mode the totalSize and completedSize values in bytes are now converted to negative value in kilobytes if totalSize value exceeds the 0x7FFFFFFF limit for the positive longint values. So in the NSIS script the negative values of $R8 and $R9 variables now means values in kilobytes - the display size limit now is 2TB instead of 2GB.

Source(only difference) + VS2003/VS6 binaries:

<<attachment removed>>
extremecarver#
Edit - first understood wrong...

1. will have to try regarding 2TB limit. Great.. I will have to try out understanding again what it means. Can I know create a nsis .exe that is say 8GB big?

2. Any chance for basing it on a newer 7z version. I would love to have lzma2 support! (because packing to lzma2 means that you are able to pack using multiple threads....).


Thanks for updating the plugin in any case...
PPeti66x#
0. !!! Bugfix !!! See the attachement.
I made a mistake in the nsis7z.cpp file, so above 2GB of uncompressed data zero size was displayed. Now it is corrected.

For admins: Please remove the attached file from my previous post (#47).

1. I do not know, what is the 7zip archive real size limit, but in case if uncompressed amount of data reached/exceeded the 2GB size, the displayed size was wrong (mostly a negative value) in callback mode. Practically this is only a cosmetical change, but may be useful.
Note that the returned value must be correctly processed via NSIS script (only updated part of the original example script):
Function CallbackTest
Pop $R8
Pop $R9
StrCpy $R7 "bytes"
IntCmp $R9 0 NoOvrFlw 0 NoOvrFlw
IntOp $R9 $R9 & 0x7FFFFFFF
IntOp $R8 $R8 & 0x7FFFFFFF
StrCpy $R7 "kilobytes"
NoOvrFlw:
SetDetailsPrint textonly
DetailPrint "Installing $R8 / $R9 $R7..."
SetDetailsPrint both
FunctionEnd
2. Sorry, but I have not enough programming knowledge to do this. My primary target was recompiling the plugin to support the legacy operating systems.

PS: Sorry, my english is bad.
PPeti66x#
New version with 7-Zip 9.22 code base - now with LZMA2 support. Unicode version also included (thanks to Marek Mizanin).
Files:
.Release\nsis7z_VS2003.dll - ANSI version, Compiled by Visual Studio 2003 SP1
.Release\nsis7z_VS60.dll - ANSI version, Compiled by Visual Studio 6.0 SP6
.Release\nsis7zU_VS2003.dll - Unicode version, Compiled by Visual Studio 2003 SP1
.Release\nsis7zU_VS60.dll - Unicode version, Compiled by Visual Studio 6.0 SP6

Note: Extensive testing required. I made only same basic tests with nsis7z_VS2003.dll. ANSI versions should work on Win9x/NT4 systems (successfully tested on Win98SE).

Password-protected archives and multivolume archives are still unsupported.
I made some experiments to adding RAR format support and enabling password support, but without success. This experimental project also included with source code, called Nsis7zx_VS2003.vcproj. I hope someone finds a solution.
MaGoth#
Hi guys,
Tried to compile a draft version Nsis7z_921, get a bunch of errors.:

1>------ Построение начато: проект: Nsis7z, Конфигурация: Debug Win32 ------
1>  StdAfx.cpp
1>  UserInputUtils.cpp
1>c:\users\александр\desktop\7zip\ui\nsis\userinpututils.cpp(5): fatal error C1083: Не удается открыть файл включение: Common/StdInStream.h: No such file or directory
1>  OpenCallbackConsole.cpp
1>c:\users\александр\desktop\7zip\ui\nsis\opencallbackconsole.h(devil): fatal error C1083: Не удается открыть файл включение: Common/StdOutStream.h: No such file or directory
1>  NSISBreak.cpp
1>  MainAr.cpp
1>c:\users\александр\desktop\7zip\ui\nsis\mainar.cpp(7): fatal error C1083: Не удается открыть файл включение: Windows/Error.h: No such file or directory
1>  Main.cpp
1>c:\users\александр\desktop\7zip\ui\nsis\main.cpp(5): fatal error C1083: Не удается открыть файл включение: Common/MyInitGuid.h: No such file or directory
1>  ExtractCallbackConsole.cpp
1>c:\users\александр\desktop\7zip\ui\nsis\extractcallbackconsole.h(devil): fatal error C1083: Не удается открыть файл включение: Common/MyString.h: No such file or directory
1>  WorkDir.cpp
1>c1xx : fatal error C1083: Не удается открыть файл источник: ..\..\UI\Common\WorkDir.cpp: No such file or directory
1>  UpdateProduce.cpp
1>c1xx : fatal error C1083: Не удается открыть файл источник: ..\..\UI\Common\UpdateProduce.cpp: No such file or directory
1>  UpdatePair.cpp
1>c1xx : fatal error C1083: Не удается открыть файл источник: ..\..\UI\Common\UpdatePair.cpp: No such file or directory
1>  UpdateCallback.cpp
1>c1xx : fatal error C1083: Не удается открыть файл источник: ..\..\UI\Common\UpdateCallback.cpp: No such file or directory
1>  UpdateAction.cpp
1>c1xx : fatal error C1083: Не удается открыть файл источник: ..\..\UI\Common\UpdateAction.cpp: No such file or directory
1>  Update.cpp
1>c1xx : fatal error C1083: Не удается открыть файл источник: ..\..\UI\Common\Update.cpp: No such file or directory
1>  TempFiles.cpp
1>c1xx : fatal error C1083: Не удается открыть файл источник: ..\..\UI\Common\TempFiles.cpp: No such file or directory
... 
And there are a lot of files ..

Author, why do not you have put most of the source files? 🤪
Afrow UK#
New version built with 7-Zip 15.07 beta. Includes x86/x64/ANSI/Unicode builds.



Stu
jiake#
Originally Posted by Afrow UK View Post
New version built with 7-Zip 15.07 beta. Includes x86/x64/ANSI/Unicode builds.



Stu
Hi Afrow UK.

The new version of the source code compiler error.

VS2012+LZMA SDK 15.07 beta.
Mircea M#
Hi,

can I now somehow use some of the 7zip command line options / switches? I would like to know if it possible to extract only part of the contents of the .7z file.

Thanks!
Afrow UK#
Originally Posted by jiake View Post
Hi Afrow UK.

The new version of the source code compiler error.

VS2012+LZMA SDK 15.07 beta.
It would help if you told me what the error was...

Have you extracted the contents to the right folders within the LZMA SDK?

Stu
jiake#
Originally Posted by Afrow UK View Post
It would help if you told me what the error was...

Have you extracted the contents to the right folders within the LZMA SDK?

Stu
Thank you for your reply!
lzma1507.7z url: http://sourceforge.net/projects/seve...07.7z/download

Here is a compilation log.

1>------ Build started: Project: Nsis7z, Configuration: Release Unicode Win32 ------
1>  Error.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\..\..\Windows\Error.cpp': No such file or directory
1>  PropVariantConversions.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\..\..\Windows\PropVariantConversions.cpp': No such file or directory
1>  Time.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\..\..\Windows\Time.cpp': No such file or directory
1>  CoderMixer2MT.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\..\Archive\Common\CoderMixer2MT.cpp': No such file or directory
1>  BranchCoder.cpp
1>c1xx : fatal error C1083: Cannot open source file: '..\..\Compress\BranchCoder.cpp': No such file or directory
1>  ExtractCallbackConsole.cpp
1>..\..\UI\NSIS\ExtractCallbackConsole.cpp(25): error C2871: 'NDirectory' : a namespace with this name does not exist
1>  Main.cpp
1>..\..\UI\NSIS\Main.cpp(121): error C2259: 'CExtractCallbackConsole' : cannot instantiate abstract class
1>          due to following members:
1>          'HRESULT IFolderArchiveExtractCallback::PrepareOperation(const wchar_t *,Int32,Int32,const UInt64 *)' : is abstract
1>          c:\users\jeffio\desktop\lzma1507\cpp\7zip\ui\common\IFileExtractCallback.h(56) : see declaration of 'IFolderArchiveExtractCallback::PrepareOperation'
1>          'HRESULT IFolderArchiveExtractCallback::SetOperationResult(Int32,Int32)' : is abstract
1>          c:\users\jeffio\desktop\lzma1507\cpp\7zip\ui\common\IFileExtractCallback.h(56) : see declaration of 'IFolderArchiveExtractCallback::SetOperationResult'
1>          'HRESULT IExtractCallbackUI::BeforeOpen(const wchar_t *,bool)' : is abstract
1>          c:\users\jeffio\desktop\lzma1507\cpp\7zip\ui\common\IFileExtractCallback.h(89) : see declaration of 'IExtractCallbackUI::BeforeOpen'
1>          'HRESULT IExtractCallbackUI::OpenResult(const CCodecs *,const CArchiveLink &,const wchar_t *,HRESULT)' : is abstract
1>          c:\users\jeffio\desktop\lzma1507\cpp\7zip\ui\common\IFileExtractCallback.h(89) : see declaration of 'IExtractCallbackUI::OpenResult'
1>..\..\UI\NSIS\Main.cpp(130): error C2039: 'kCurrentPathnames' : is not a member of 'NExtract::NPathMode'
1>..\..\UI\NSIS\Main.cpp(130): error C2065: 'kCurrentPathnames' : undeclared identifier
1>..\..\UI\NSIS\Main.cpp(130): error C2039: 'kNoPathnames' : is not a member of 'NExtract::NPathMode'
1>..\..\UI\NSIS\Main.cpp(130): error C2065: 'kNoPathnames' : undeclared identifier
1>..\..\UI\NSIS\Main.cpp(132): error C2039: 'kWithoutPrompt' : is not a member of 'NExtract::NOverwriteMode'
1>..\..\UI\NSIS\Main.cpp(132): error C2065: 'kWithoutPrompt' : undeclared identifier
1>..\..\UI\NSIS\Main.cpp(132): error C2039: 'kSkipExisting' : is not a member of 'NExtract::NOverwriteMode'
1>..\..\UI\NSIS\Main.cpp(132): error C2065: 'kSkipExisting' : undeclared identifier
1>..\..\UI\NSIS\Main.cpp(142): error C2660: 'NWildcard::CCensor::AddItem' : function does not take 3 arguments
1>..\..\UI\NSIS\Main.cpp(147): error C3083: 'NDirectory': the symbol to the left of a '::' must be a type
1>..\..\UI\NSIS\Main.cpp(147): error C2039: 'MyGetFullPathName' : is not a member of 'NWindows::NFile'
1>..\..\UI\NSIS\Main.cpp(147): error C3861: 'MyGetFullPathName': identifier not found
1>..\..\UI\NSIS\Main.cpp(150): error C3861: 'DecompressArchives': identifier not found
1>  Generating Code...
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Yathosho#
Originally Posted by parasoul View Post
Any idea when password protected archives will be supported?
Would be a nice addition, but it probably makes more sense to support optional parameters in general
jiake#
7-Zip 15.12 Release (2015-11-19)
, archiver, compression, zip, best, compress, high, ratio, free, gnu, lgpl, unzip, far, win32, 7zip, long, file, names
aerDNA#
Originally Posted by jiake View Post
7-Zip 15.12 Release (2015-11-19)
http://www.7-zip.org/
Also worth mentioning is that v15 no longer includes script decompile feature.