Jump to content

Progress Bar for 7z Archive Extraction, Is it possible?


Recommended Posts

Ok im doing some extraction of archives like this

$aRarFile = _RecFileListToArray(@ScriptDir, "*.rar|*.part*", 1, 0)
;~  _ArrayDisplay($aRarFile, ".Rar Files")

    If IsArray($aRarFile) Then
        $FileEnd = StringTrimLeft(_ArrayToString($aRarFile), 2)
        $test = RunWait(@ComSpec & ' /c ' & @TempDir & '\7z.exe' & ' x -y ' & '"' & $FileEnd & '"', "", @SW_HIDE)
        Sleep(2000)
    Else
        MsgBox(64, "Error " & @error, "No Rar Files To Unpack")
    EndIf

And im wanting to make a progress output so i can update a toast.

I was looking at this as a starting point.

Func _CopyFolder($sSourceFolder, $sDestFolder)
    Local $ipct
    DirRemove($sDestFolder, 1)
    Local $iSourceSize = DirGetSize($sSourceFolder), $iDestSize
    Local $pid = Run(@AutoItExe & ' /AutoIt3ExecuteLine "DirCopy(''' & $sSourceFolder & ''', ''' & $sDestFolder & ''')"')
    Do
        GUICtrlSetData($hLabel3, "Checking " & StringReplace($sSourceFolder, @UserProfileDir & "\", ""))
        $iDestSize = DirGetSize($sDestFolder)
        $ipct = Int(($iDestSize / $iSourceSize) * 100)
        GUICtrlSetData($hProgress, $ipct)
        Sleep(20)
    Until Not ProcessExists($pid)
EndFunc   ;==>_CopyFolder

But how can i read the output of something when i dont know how much of the file is still to be unpacked

I saw on here http://www.dotnetperls.com/7-zip-examples

that the L switch can list the size of the files like the image below

http://www.dotnetperls.com/7-zip.png

The figure i would need i guess is this one

31104 

maybe that could be used before each pass at the files and use the actual folder size as the start point?

Is it possible to do this? or has something like this been atempted

Link to comment
Share on other sites

I tried something likes this in the GUI Support section. Search 7zip and guinness.

Edited by guinness

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

Thanks for that

Ive been messing around for a while with it and i still cant get it to update properly

I'm using the command line version of 7zip for an extractor so it doesnt matter whether they have support for archives or not

Ill keep trying, it extracts fine just doesnt update

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...