Jump to content

Recommended Posts

Hi Seeker,

do you have any new on this issue regarding dll 7zip add to archive with progress bar (no 7zg)? I've done several attempts to find a suitable and easy solution but wasn't lucky until today.

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

Share this post


Link to post
Share on other sites

Has anyone gotten this UDF to work with ISO files?

I am trying to extract an ISO file, but it fails. The same syntax works fine with zip file.

Edited by ilko

Share this post


Link to post
Share on other sites

Hi ! I'm using this UDF and it's really useful, I found a little bug though so I'll inform about it here in case you find your script failing for some archives like I did... kinda minor but, present.

If you have an archive with more than one contiguous space character in the name like this :

'My   archive   name.zip'

then it will extract it (using either _7zipExtract or _7zipExtractEx) it in this directory : (assuming you use your filename as destination, minus extension)

'My archive name'

in other words, it reduces contiguous spaces to one automatically, and the only workaround I found is to rename all my archives before using my script... (or to rename destination Dir after the extraction but I shouldn't have had to do that)

Perhaps are the Dlls involved in this, no idea. Just telling. What I know is if you extract it with 7Zip context menu in Explorer, then it keeps the true name and all the spaces.

Edited by CodingCody37

Share this post


Link to post
Share on other sites
68

this must be a April Fools joke  the link is for

7zip_udf.url which is fake or dead

and

mirror7zip_udf.url which is also fake or dead.

links go to files not other links why was it not

Attach Files

   You can upload up to 8MB of files (Max. single file size: 8MB)

Share this post


Link to post
Share on other sites

There is a small mistake in the _7ZipStartup() function.

It decides to load the dll depending on the OS, but it needs to depend on the exe.

Here is a fix.

Func _7ZipStartup()
    If Not @Compiled Then ; If not compiled, test and open the right dll
        If Not FileExists($sNoCompiledPath & $sZip32Dll) And _
           Not FileExists($sNoCompiledPath & $sZip64Dll) Then Return SetError(2, 0, 0)
        If Not @AutoItX64 Then
            $hDLL_7ZIP = DllOpen($sNoCompiledPath & $sZip32Dll) ; Open x32 dll from no compiled path
        Else
            $hDLL_7ZIP = DllOpen($sNoCompiledPath & $sZip64Dll) ; Open x64 dll from no compiled path
        EndIf
    Else ; If compiled, test and open the right dll (that must be in ScriptDir for compiling)
        If Not @AutoItX64 Then
            If Not FileInstall("7-zip32.dll", $sCompiledPath & $sZip32Dll, 1) Then Return SetError(3, 0, 0)
            $hDLL_7ZIP = DllOpen($sCompiledPath & $sZip32Dll) ; Open x32 dll from FileInstall path
        Else
            If Not FileInstall("7-zip64.dll", $sCompiledPath & $sZip64Dll, 1) Then Return SetError(3, 0, 0)
            $hDLL_7ZIP = DllOpen($sCompiledPath & $sZip64Dll) ; Open x64 dll from FileInstall path
        EndIf
    EndIf
    If $hDLL_7ZIP = -1 Then Return SetError(1, 0, 0) ; If no dll handle, return error
    Return 1
EndFunc   ;==>_7ZipStartup
Edited by Mugen

Share this post


Link to post
Share on other sites

Oh, haven't seen your post. But properly it's good to have it mentioned in this topic, too.

BTW: Does anyone have an idea why using this UDF, even with silent option

is so much slower than using 7z.exe?

Share this post


Link to post
Share on other sites

sorry for my bad english

I have the problem with accented characters

example for

_7ZipExtractEx($dHnd, $hWnd, $sArcName,........

$sArcName="c:\examplè\archive.zip"

or

$sArcName="c:\example\archìve.zip"

Share this post


Link to post
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

×
×
  • Create New...