Recently Browsing 0 members
No registered users viewing this page.
The progress of 7zip is displayed, and the problem of subvolume decompression is encountered. - (Moved)By netmaple
I am a novice and my English is not very good, I hope everyone can understand my statement and give me some advice, thanks.
The code is very suitable for echoing the progress bar when the 7z file is released, but FileGetSize cannot correctly echo the progress bar when encountering multiple sub-volume compressed files.
For example, AA.7z.001, AA.7z.002, AA.7z.003, AA.7z.004, AA.7z.005, AA.7z.006, AA.7z.007, AA.7z.008, AA .7z.009, AA.7z.010…………,
FileGetSize can only progress by AA.7z.001. The card is 100% completed. Please help me, and help me solve the file detection part of FileGetSize. thank.
#include <array.au3> #include <GUIConstantsEx.au3> #include <ProgressConstants.au3> Global $Title = "7zip progress echo demo" $hGUI = GUICreate($Title, 320, 80,-1,-1) $progressbar = GUICtrlCreateProgress(10, 10, 300, 30) $btn = GUICtrlCreateButton("Start", 125, 45, 70, 30) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $btn $ExtrTarget = 'E:\DP' ;Release path $ExtrSource = 'E:\mtest.7z' ;Target file $UnPack_line = ' x -y -o' & '"'& $ExtrTarget & '"' & ' ' & '"'& $ExtrSource & '"' _GetPIODataSend2Bar('7za.exe', $UnPack_line, FileGetSize($ExtrSource), $progressbar) GUICtrlSetData($progressbar, 100) MsgBox(0, '', 'Successful release') GUICtrlSetData($progressbar, 0) GUICtrlSetData($hGUI, "") Exit EndSwitch WEnd Func _GetPIODataSend2Bar($Execute, $Commandline, $Param, $Ctrl) Local $Pid, $PIOData, $iPercentage, $iPercentageBefore $Pid = Run ($Execute & $Commandline, '', @SW_HIDE) While ProcessExists($Pid) $PIOData = ProcessGetStats($Execute, 1) If @error Then MsgBox(0, '', $Execute) Else $iPercentage = Round($PIOData/$Param*100) If $iPercentage <> $iPercentageBefore And $iPercentage > 0 And $iPercentage <= 100 Then ConsoleWrite('->-' & $iPercentage & @CRLF) GUICtrlSetData($Ctrl , $iPercentage) WinSetTitle($hGUI, "", $Title & " " & $iPercentage & "%") EndIf EndIf WEnd Return $iPercentage EndFunc
I know this has been done to death in many programming languages and probably even in AutoIt.
But couldn't help myself and as a learning challenge I wrote "yet another converter" LOL
I need your help to test it and show me "the error of my ways" but in a nutshell here's what it can do already (taken from my source file) :
Converts all zip files recursively into a 7Zip file, with max compression REQUIRES AUTOIT Version 22.214.171.124 + Exact copy with attributes and folder structure + Extensive error checking, including files blocked by anti-virus (by file count) + Can stop process and restart later with the use of a log file + Can pause process (but in between compressing / extracting files) + Creates a .CSV file that can be used to check on compression ratios + Dynamic GUI that enables user to see console while 7zip is working + Gui can be stretched horizontally for long filenames + Up to 5 retries while transfering compressed files + Checks free space (at startup) to make sure you don't kill your OS LOL + Have converted 10,000+ files with no issues in file integrity. + Open to suggestions and program free to modify to your liking + Will eventually be fully modular and configurable (if there is interest for this) + Exit codes so you can have an idea where program went wrong (if it did) + Fully commented so users can tinker away. - Cannot save archive comments. - Not FULLY tested yet, do not use on .zip files that have no backups The program also has a very minimal GUI that can be stretched. Not a huge fan of million-button interfaces.
I also assume some people running this program will have a 1024x768 monitor so the GUI is made accordingly.
There is no way I am keeping this script for myself. If this is useful to anybody, feel free to use it and modify it. All I ask is you credit me (as I will credit those who contribute).
Now here's the issues that are left to fix. Any help is greatly appreciated and I will add your name in the credits if you so wish.
- For some reason while compression is under way, all my current explorer windows flicker; notably the cut-and-paste part. I can't seem to narrow it down.
- Also context menu is closed in explorer every time program compresses / extracts a new file
- I've added support for retries if, for some reason, AutoIt can't move the converted file. This happened once after 5000-6000 conversions. Now that I've programmed the retries, the process is somewhat slower. It shouldn't affect speed though.
- After compressing 10,000+ files (Yes I have that many zip files! Think Mame) I've had a system meltdown. There's a leak somewhere. Am I supposed to close something and I'm not? I've added _IsPressed() lately so closing that .DLL is not the cause of this leak.
- Subtracting one array from another was a tricky thing to program (happens when user stops and restarts process), if you can think of a faster way I'm all in.
Obviously if you find bugs or have suggestions, I'm all ears.
Changelog is included in the source file, including credits.
PLEASE DON'T CONVERT ALL YOUR FILES YET. It's not fully tested (well I tested it but I need others to test too).
I want to make my progress bar progress with the amount of File lines read.
How would I do this correctly. So far the code below can sometimes run in the middle of the progress bar and state completed.. and other times it can run into the 200%.
;======================================================================== ProgressOn("TITLE", "ACTION") ;======================================================================== For $count = 1 To _FileCountLines($FileRead) Step 1 $string = FileReadLine($FileRead, $count) $value1 = $input $value2 = $input $value3 = $input $value4 = $input $TM = FileWrite("C:\temp\test.txt", $value1 & " " & $value2 & " " & $value3 & " " & $value4 & @CRLF) ProgressSet($count, $count & "%") Next ;======================================================================== ; PROGRESS BAR OFF ;======================================================================== ProgressSet(_FileCountLines($FileRead), "Completed!") Sleep(750) ProgressOff() ;========================================================================
By Kevin Finnegan
Long time lurker and now forum poster! I'm writing a relatively simple backup script for my firm that automates the copy, compression and organization of Leaver's data on one of our secured NAS systems. I personally found the best method to do this so far was to use 7zG.exe (GUI version of 7Zip which can use command-line too) and it functions quite well!
I would like to retrieve more info on whether any warnings or errors happen in 7Zip during the backup, but I can't quite get my head around the syntax and switches for reading out, it seems any adjustment I make to the RunWait call's string seems to break the backup or give unexpected repercussions! Hopefully its something silly I'm doing as I don't code very often.
Here is the working version:
; Compress the directories one by one in the zip using the listfile.... Local $iPID = RunWait(@ScriptDir & "\bin\7zG.exe a -mx" & $compressionQuality & " -v" & $compressSplitFileSize & " -wc:\temp " _ & $backupToLocation & "\" & $userDirectory & ".7z @bin\listfile.txt -x@bin\excludefile.txt", "", @SW_SHOWDEFAULT, $STDOUT_CHILD) Ultimately I would love to switch entirely to 7za.exe (standalone) so that I can read the progress percentage, current file being uploaded and any warnings or errors could be processed and output to the AutoIT script's GUI I've created rather than jumping in and out of two applications per se.
Im new to autoit im exploring some function and I am interested with the progress bar.
Is it possible to have a end user input in how much the bar will progress?
I saw this code in the examples.
; Display a progress bar window.
ProgressOn("Progress Meter", "Increments every second", "0%")
; Update the progress value of the progress bar window every second.
For $i = 10 To 100 Step 10
ProgressSet($i, $i & "%")
; Set the "subtext" and "maintext" of the progress bar window.
ProgressSet(100, "Done", "Complete")
; Close the progress window.