Jump to content

7Zip


rasim
 Share

Recommended Posts

  • Moderators

damian666,

Why would you expect a 7Zip UDF to create normal zip files? ;)

Take a look here if that is what you want. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 1 month later...

I haven't posted a lot to the forums and am not trying to necro the topic, but saw some things I might put my 2 cents in on.

First, I have no problem creating zip-compatible files using the update or add functions of this UDF, as in they open under WinZip 10 no problem, I believe the key is designating a file with a zip extension.

Second, I have been using the UDF from the below post and the newest custom-built DLL compatible with COM interfaces found at http://www.csdinc.co.jp/archiver/lib/7-zip32.html#download

I would take the time to add more functions to the UDF or design one that uses the standard DLL, but I neither have the time nor the experience necessary at this point.

I would like to fully explore what the DLL can and cannot do as to various formats in the future. I will post here if I find anything further.

Thank you.

Since rasim appears to be gone and he never addressed the issue of using OnAutoItExit in his UDF I took the liberty of rewriting all the functions and adding two of my own, _7ZipStartup() and _7ZipShutdown().

If you use the edited version of the script note that it works slightly different now. The first parameter in each function is now a dll handle followed by the rest of the original parameters.

So it all looks a bit like this.

$7zip = _7ZipStartup()
$extract = _7ZIPExtractEx($7zip,0,"archive.zip","C:pathtoextractionfolder",1)
_7ZipShutdown($7zip)

7Zip.au3

Link to comment
Share on other sites

  • 1 month later...

took the liberty of rewriting all the functions and adding two of my own, _7ZipStartup() and _7ZipShutdown()

Hooo, I never seen this post until today ... :whistle:

Great idea, but why did you rewrite all the functions ?

it works slightly different now

So, it's not a really good idea !

Why doesn't you make your new functions like TCPStartup and TCPShutdown with 1 or 0 on return? It would have been a much better idea and like that you would not have had to rewrite all the functions. ^^

We can do better, because the function is intended to be integrated and because there is a 64 bit version of the dll, we can manage the fileinstall and the version of the dll by the new _7ZipStartup() function. ;)

If I have the time, I will present my works on it.

Edit : I have play with the UDF, but it seems thats if we use a 7ZipStartup() function, we must rewriting all functions (even those of Delta), because it is necessary to take care about the possibility of the forgetting of the use of startup. In that case if you call a function, you haven't a dll handle, so you have an error ... ^^

Edit 2 : Well, I did my best and I think of having arrived at an UDF more complete with an improved presentation. I have added x64 support and some novelties. Can you test it and give me your impressions?

The archive with UDF, examples and Dlls can be downloaded here (don't forget to read the begining of the UDF to see what's new ^^).

Edited by Tlem

Best Regards.Thierry

Link to comment
Share on other sites

After one week, no return... It's really frustrating.

I'm surprised that it does not interest more people. Especially 64bit support and an update of the 32 dll that doesn't support some archives. ^^

Edited by Tlem

Best Regards.Thierry

Link to comment
Share on other sites

Tlem,

rasim is offline since 29.01.2009. I assume you should not wait for support from him.

Br,

UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Hello UEZ, I doesn't expect support from rasim. The question was for the community. ^^

May be my second edit wasn't clear. I have updated the rasim's UDF to use 64 bit dll and to update de 32 bit dll that doesn't work on some zip archive. I gave the link above to download full UDF updated for testing.

Edited by Tlem

Best Regards.Thierry

Link to comment
Share on other sites

Well Tlem, I did the same thing, wrote an UDF around the latest version of 7-zip32.dll. But I didn't find a 64-bit so thanks for that.

Downloaded your UDF, will be doing some tests soon and let you know. I'll also upload my UDF so that you can check it out.

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Link to comment
Share on other sites

Hello dany. Tanks for your responce.

Just one thing, can you precise what UDF do you talk and where we can find it.

It's on my HD :) haven't released it yet. It's also only using the 32-bit dll, I couldn't find a 64-bit version. I'll try to PM it to you or upload it here if possible.

Thusfar your UDF is working as it should. Tested on Win 7 64-bit and I haven't had any problems with the examples you provided. Nice Job!

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Link to comment
Share on other sites

  • 2 weeks later...

Hi Tlem, sorry for the long wait.

First here's my edited version of Rasim's original UDF. No testcases and maybe just 5% tested...

7Zip.au3

7ZipConstants.au3

Also thanks for posting in the other thread. I'll address some issues there.

[center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...

Hi Tlem

I have tested nearly all functions and only found one problem until now

Using the example script againt a very big zipped file > 2g and with individual files in the zip file bigger than > 2g

$iFileSize and $iWriteSize return wrong results sometime negative results in the function _ARCHIVERPROC

the error is both at 32 and 64 bit O/S

#include <GuiConstantsEx.au3>

#include <7Zip.au3>

$hGUI = GUICreate("_7ZIPExtractEx demo", 300, 200)

$ctlEdit = GUICtrlCreateEdit("", 10, 10, 280, 100)

$ctlProgress = GUICtrlCreateProgress(10, 130, 280, 20)

$ctlButton_Pack = GUICtrlCreateButton("Unpack!", 10, 167, 75, 23)

$ctlButton_Close = GUICtrlCreateButton("Close", 215, 167, 75, 23)

GUISetState()

$ArcFile = "c:testtest.7z.001"

If @error Then Exit

$sOutput = FileSelectFolder("Select output folder", "", 1, "", $hGUI)

If @error Then Exit

While 1

$msg = GUIGetMsg()

Switch $msg

Case $GUI_EVENT_CLOSE, $ctlButton_Close

Exit

Case $ctlButton_Pack

_7ZipStartup()

$retResult = _7ZipSetOwnerWindowEx($hGUI, "_ARCHIVERPROC")

If $retResult = 0 Then Exit MsgBox(16, "_7ZipAdd demo", "Error occured")

$retResult = _7ZIPExtractEx($hGUI, $ArcFile, $sOutput, 1)

_7ZipShutdown()

If @error = 0 Then

MsgBox(64, "_7ZIPExtractEx demo", "Archive unpacked successfully", 0, $hGUI)

Else

MsgBox(64, "_7ZIPExtractEx demo", "Error occurred", 0, $hGUI)

EndIf

;GUICtrlSetData($ctlProgress, 0)

;GUICtrlSetData($ctlEdit, "")

EndSwitch

WEnd

Func _ARCHIVERPROC($hWnd, $Msg, $nState, $ExInfo)

Local $iFileSize, $iWriteSize, $iPercent = 0

If $nState = 0 Then

Local $EXTRACTINGINFO = DllStructCreate($tagEXTRACTINGINFO, $ExInfo)

GUICtrlSetData($ctlEdit, DllStructGetData($EXTRACTINGINFO, "szSourceFileName") & @CRLF, 1)

$iFileSize = DllStructGetData($EXTRACTINGINFO, "dwFileSize")

$iWriteSize = DllStructGetData($EXTRACTINGINFO, "dwWriteSize")

$iPercent = Int($iWriteSize / $iFileSize * 100)

GUICtrlSetData($ctlProgress, $iPercent)

Return 1

EndIf

If $nState = 2 Then GUICtrlSetData($ctlProgress, 100)

Return 1

EndFunc

Link to comment
Share on other sites

Well, I would say this is not a problem of the UDF, but more of the DLL itself. Looking at the structure, iFileSize and iWriteSize are both returned as a single DWORD each, and afaik this does not allow a representation of larger file sizes... *check*check*google*check*... DWORD max size = 2147483647.

See also this dll api definition here:

http://www.madobe.net/archiver/lib/7-zip32api-en.txt

Link to comment
Share on other sites

Hi Kafu

thanks for your response

i have spend lots of time, looking for a solution.

i now know i have to write another FUNC _ARCHIVERPROC

maybe i can use a combination of DllStructGetData($EXTRACTINGINFO, "szSourceFileName") and _7ZipGetArcOriginalSize

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...