OwiDowiSpinn Posted April 10, 2011 Posted April 10, 2011 I really like this UDF, but when you add folder contents which contain an empty folder, an error message appears and the script freezes
andrei0x309 Posted April 10, 2011 Posted April 10, 2011 (edited) Is very strange that if you have the flags for CopyHere method set as 4 ( to not show the compressing dialog will ) not work but in my case ( both on w7 and xp sp3 ) when i use 0x4 instead of 4 works even if 0x4 is practically the same as 4 or even 04 ( octal ) . And even more strange is that when you are not copying to a zip folder both 4 and 0x4 work . I searched a lot for a method to suppress the dialog cause _hiding with SW_HIDE is ugly and there are chances to show the dialog for a very short time , the eye can see the window even if the window is present just for 30 milliseconds . I hope this might help others , cause there are other ways to suppress the dialog but they imply much more coding and knowledge and they are cumbersome . Edited April 10, 2011 by Azraelsub7
Moderators Melba23 Posted April 10, 2011 Moderators Posted April 10, 2011 Azraelsub7, wraithdu has completely rewritten this UDF here - responders went into some detail about why this happens and possible solutions. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
andrei0x309 Posted April 10, 2011 Posted April 10, 2011 @Melba23 Yeah i know i read this and that thread a thousand times , still flags don't work , using either 20 or 4 will still show the dialog on my machines , using 0x4 instead will not display compressing dialog , and that is very weird . You should try it , maybe is the same for you , anyway i use my own udf for zipping with the same method ( shell object ) ( cause this is the only way using windows build in features ) , but i do not need much of the functionality that is present here . I saw that some said that dialog comes from zipfldr.dll but i don't think that is correct as MS programs usually store dialogs in resources , and on both w7 and xp , zipfldr.dll has no dialogs in resources . There are other threads in witch users complain that flags don't work , as i said i did a lot of searches but thanks greatly for your good intention .
bittiez Posted May 4, 2011 Posted May 4, 2011 Okay so I'm trying this: _Zip_UnzipAll("tempdownload\" & $downloadfile & ".zip", "tempdownload\" & $downloadfile & "\") And it isn't giving any errors or anything but it isn't extracting anything for me, any ideas? I already checked and the $downloadfile part is all good and well, no problems there I have no idea what "flags" I may need to use, I haven't found them listed anywhere =S
TommyDDR Posted February 6, 2012 Posted February 6, 2012 You should check in your _Zip_AddXXXX if the file/folder to add exist (if not, actualy, the script pause indefinitively) _GUIRegisterMsg (Register more than 1 time the same Msg), _Resize_Window (GUICtrlSetResizing for children windows), _GUICtrlSetOnHover (Link a function when mouse go on, left, clic down, clic up, on a control), _InputHeure (Create an input for hour contain), _GUICtrlCalendar (Make a complete calendar), _GUICtrlCreateGraphic3D (Create a 3D graph), _ArrayEx.au3 (Array management), _GUIXViewEx.au3 (List/Tree View management).
mamutos99 Posted May 2, 2012 Posted May 2, 2012 (edited) Hi,I have installed the UDF library.I have a problem, I want to extract the file natives.zip(it is located in %APPDATA%.extremecraft)to the %APPDATA%.extremecraftnativesPlease correct my function._Zip_UnzipAll($natives, @AppDataDir & ".extremecraftnatives")Thank you. Edited May 2, 2012 by mamutos99
MachinistProgrammer Posted November 16, 2012 Posted November 16, 2012 i used this udf and i didnt get an error code but it didnt work #include <zip.au3> $hFolder = "D:7z-shell" $hZipFile = "@AppDataDir & 'hello.zip'" $flag = '1' _Zip_AddFolderContents($hZipFile, $hFolder, $flag = 1) All my projects live on github
garbb Posted September 3, 2013 Posted September 3, 2013 (edited) i used this udf and i didnt get an error code but it didnt work #include <zip.au3> $hFolder = "D:7z-shell" $hZipFile = "@AppDataDir & 'hello.zip'" $flag = '1' _Zip_AddFolderContents($hZipFile, $hFolder, $flag = 1) "D:7z-shell" isn't a valid path. You probably ment "D:7z-shell" Edited September 3, 2013 by garbb
garbb Posted September 3, 2013 Posted September 3, 2013 I noticed that I was getting an error intermittently when adding a bunch of files to a zip file using the _Zip_AddFolderContents function. The error is in the _Zip_List() function on the $oApp.Namespace($hZipFile).Items line. Basically I think that $oApp.Namespace($hZipFile) was sometimes not returning an object because the _Zip_AddFolderContents function is trying to write to the zip file and read the contents of the zip file at the same time. I modified Zip.au3 slightly so that the error is a COM error instead of an autoit3 error and added a COM error handler so that at least the script will run fully instead of exiting out when the error happens. I know this is not a proper fix but it was the only thing I could come up with to make it work... Zip.au3
nazirm Posted September 25, 2013 Posted September 25, 2013 I get the following error when I use zip.au3 and console.au3 together. To simulate this error please create a new script in SciTE script editor and include zip.au3 and console.au3 and then run it. You will get two pop up messages. Here are the error messages: First Popup message: AutoIt Error: Line 456 (File "C:Program Files (z86)|AutoIt3Includezip.au3:): $ZipFile=#ZipSplit[2] $ZipFile=^Error Error: Array variable has incorrect number of subscripts or subscript dimension range exceeded. Second popup message: Line 455 (File "C:Program Files (z86)|AutoIt3IncludeConsole.au3:): If $_Amount_Startup_COnsole Then If^Error Error: Variable used without being declared.
ScriptingNewbie Posted February 6, 2014 Posted February 6, 2014 (edited) On Windows 7 x64 the _Hide() function does not work. This is the fix for it. Func _Hide() If ControlGetHandle("[CLASS:#32770]", "", "[CLASS:DirectUIHWND; INSTANCE:1]") <> "" And WinGetState("[CLASS:#32770]") <> @SW_HIDE Then ;The Window Exists $hWnd = WinGetHandle("[CLASS:#32770]") WinSetState($hWnd, "", @SW_HIDE) EndIf EndFunc Just change the SysAnimate32 to DirectUIHWND Edited February 6, 2014 by ScriptingNewbie
Fredricz Posted April 3, 2014 Posted April 3, 2014 (edited) Hey, I can't really get the progressbar away. If I use the flag as 1 or not, doesnt work. The progressbar is still there. I really want to unzip quietly. #include <Zip.au3> $filepath = "test.zip" $pathtosavethefileat = "c:\temp" _Zip_UnzipAll($filepath, $pathtosavethefileat, 1) Should I do something else to make it work? Is anyone else having this problem? --- EDIT--- I'm using Windows 7 x64 and tried to use the "new" hide function above. Func _Hide() If ControlGetHandle("[CLASS:#32770]", "", "[CLASS:DirectUIHWND; INSTANCE:1]") <> "" And WinGetState("[CLASS:#32770]") <> @SW_HIDE Then ;The Window Exists $hWnd = WinGetHandle("[CLASS:#32770]") WinSetState($hWnd, "", @SW_HIDE) EndIf EndFunc Unfortunately that didn't work. /Fredricz Edited April 3, 2014 by Fredricz
Moderators Melba23 Posted April 3, 2014 Moderators Posted April 3, 2014 Fredricz,If you read my post at the top of this page you will find the answer - which unfortunately is not what you want to hear. M23 Fredricz 1 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Fredricz Posted April 3, 2014 Posted April 3, 2014 Fredricz, If you read my post at the top of this page you will find the answer - which unfortunately is not what you want to hear. M23 Oh no.. Now I feel bad.. ... 3 min later... Well.. It worked! Thanks.
legend Posted April 4, 2014 Posted April 4, 2014 It can't compress files that got filenames with symbols from other languages, ex. æ ø å
UltimateW Posted August 6, 2014 Posted August 6, 2014 I know this is an old post, but is there any way to exclude specific files that contain certain strings. For example if I zip a folder called test that has files named 1-5 in it can I exclude the file named 4 or with 4 in its name.
Marvin_Baral Posted August 18, 2015 Posted August 18, 2015 (edited) Hi,I am using your script and I'm wondering about the return value of _Zip_AddFile. When I'm using an absolute path with no trailing "/" or "\", your function returns 1, but perfectly creates a file in the zip directory. When I'm adding the "/" or "\" i get no error (0), but nothing is added.What am I doing wrong?I added a snippet of my code. Excuse me for my coding-style, which is no Autoit-standard. Func FileCopyToZipLog($name, $prefix, $sourceFile) $zipDir = $DIR_LOGFILES & $name & ".zip" $dir = $DIR_LOGFILES If Not FileExists($zipDir) Then _Zip_Create($zipDir) EndIf $filename = $dir & $prefix & @MDAY & "." & @MON & "." & @YEAR & "_" & @HOUR & "h" & @MIN & "m" & @SEC & "s" & ".txt" FileCopy($sourceFile, $filename) $success = _Zip_AddFile($zipDir, $filename) MsgBox(0, "Return Value", $success) FileDelete($filename) EndFunc Edited August 18, 2015 by Marvin_Baral inserted code
esullivan Posted October 29, 2015 Posted October 29, 2015 (edited) I an trying to unzip a file using_Zip_UnzipAll("C:\Users\Brodie\AppData\Local\Temp\NewInstall\MSIAfterBurner.zip", "C:\Users\Brodie\AppData\Local\Temp\NewInstall",[1])and I get >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Brodie\Desktop\Install\NewInstall.au3" "C:\Users\Brodie\Desktop\Install\NewInstall.au3" (269) : ==> Error in expression.:_Zip_UnzipAll("C:\Users\Brodie\AppData\Local\Temp\NewInstall\MSIAfterBurner.zip", "C:\Users\Brodie\AppData\Local\Temp\NewInstall",[1])_Zip_UnzipAll("C:\Users\Brodie\AppData\Local\Temp\NewInstall\MSIAfterBurner.zip", "C:\Users\Brodie\AppData\Local\Temp\NewInstall",^ ERROR>Exit code: 1 Time: 1.003Thanks for any help! Screenshot attached showing the file is there. Edited October 29, 2015 by esullivan
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now