eltorro Posted April 19, 2007 Share Posted April 19, 2007 (edited) The moment you've all been waiting for [drum roll...] (yeah, right) Zip Plugin for AutoIt V3. It adds the following functions: _ZipCreate($NewZipFile) Returns a handle to the zip. _ZipAdd($hFile,$SourceFile,$FileNameInsideZip) Needs handle from _ZipCreate. _ZipAddDir($hFile,$DirToAdd,$Recursive) Needs handle from _ZipCreate 1 use recursion 0 don't. _ZipAddFolder($hFile,$FolderName) Creates an empty folder in the zip Needs handle from _ZipCreate. _ZipFormatMessage($ErrorCode) Returns the message that corresponds with the $ErrorCode. _ZipClose($hFile) Closes the Zip archive. Needs handle from _ZipCreate. _ZipUnZip($ZipFile,$Dest) UnZips the archive to the specified folder._ZipUnZipItem($ZipFile,$FileNameInsideZip,$Dest) UnZips the specified file to dest. _ZipGetList($ZipFile) Retrieves file info from zip. _ZipGetCount($ZipFile) Retrieves then number of items in the zip. _ZipGetItemInfo($ZipFile) Return a ptr to the file info a specific item. _ZipAddFileToZip($ZipFile,$FileToAdd,$FileNameInsideZip) adds a file to an already existing zip. _ZipDeleteFile($ZipFile,$FileNameInsideToDelete) Deletes a file inside the archive. _ZipPluginAbout() Returns "About" message string.Based on ZLib and Info-Zip code condensed by Lucian Wischik. See this CodeProject. The UDF _ZipPlugin.au3 is needed to extract the file information data (name, size, etc...) for the items in the zip from the _ZipGetList() function return. This function returns a compound delimited string. Each entry is delimited by @LF, each param is delimited by a semicolon. It would be nice to be able to return an array from plugins. The UDF contains a number of helper function. _ZipItemInfo2Array($ZipFile,$iIndex) Retrieves file info from zip and return as 1 Dim array. _ZipList2Array($ZipFile) Retrieves file info from zip for all items and returns a 2 Dim array _ZipGetItemInfoFromPtr($ptrZipInfo) Converts struct from ptr [ provided by _ZipGetItemInfo() ] to 1 Dim array. (Internal use.) * _ZipList2Array should be used instead of _ZipGetList() * The original CodeProject source archive is included with the plugin archive as is an Au3 example script. There is also a script that can be compiled into an exe for a Code::Blocks tool to zip the current project. The CodeBlocks_Tools.jpg shows the settings. Adjust the location of the exe accordingly. You can get the latest version here. Here is a direct link to Au3_Zip_1.0.408a.zip Enjoy, eltorro Edit: Added _ZipUnZipItem() Edit: Change the name of the download Edit: Removed _ZipGetList() -Plugin Added _ZipGetCount() -Plugin _ZipGetItemInfo() -Plugin _ZipItemInfo2Array() -UDF _ZipList2Array() -UDFEdit: Added checks for file existence Check if file is a zip.Edit: Fixed unneeded zip check in _ZipAddDir.Edit: Uploaded files to server. Replaced incorrect Au3 include file in zip package.Edit: Fixed crash with bad or otherwise incorrect zip file.Edit: Fixed extraction of 0 byte file.Edit: Fixed failed check for source folder.Edit: Replaced _ZipPlugin.pll.au3 with correct file. Edited June 17, 2008 by eltorro Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
james3mg Posted April 19, 2007 Share Posted April 19, 2007 So of all the files in the .zip (by the way, it seems your ocotillo.sytes.net upload may be corrupted?), we only need _ZipPlugin.au3? None of the other *.c or *.dll files are needed, or do we need to fully extract all the contents of the .zip file into the script directory and rely on external .dll (and other?) files? I'll try this out in a bit - if it's pure AutoIt, this looks great! :-) "There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110 Link to comment Share on other sites More sharing options...
Zedna Posted April 19, 2007 Share Posted April 19, 2007 Looks really cool but there is missing _ZipUnZipFile() for unzip just one file - and not all files like your _ZipUnZip() does_ZipUnZip($ZipFile,$Dest) UnZips the archive to the specified folder. Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 19, 2007 Share Posted April 19, 2007 Pure AutoIt Zip functions would make a definite built in UDF. Link to comment Share on other sites More sharing options...
smashly Posted April 19, 2007 Share Posted April 19, 2007 (edited) Nice work, Thank you eltorro. Can I set the compression level of the zip I create? Edit: Any plans to add Example 3 - unzip from resource directly into memory Example 4 - unzip chunk by chunk to a membuffer Or is this already supported ? Edited April 19, 2007 by smashly Link to comment Share on other sites More sharing options...
JSThePatriot Posted April 20, 2007 Share Posted April 20, 2007 I am glad to see more interest in plugins! They are still incomplete, so I hope this new interest in plugins will show Jon there is enough interest in that architecture to complete it. Looks like a great plugin. I have saved it to look at it later. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
eltorro Posted April 20, 2007 Author Share Posted April 20, 2007 Nice work, Thank you eltorro. Can I set the compression level of the zip I create? Edit: Any plans to add Example 3 - unzip from resource directly into memory Example 4 - unzip chunk by chunk to a membuffer Or is this already supported ? The zip source supports it but it is not implemented in the plugin. There is also provisions to extract/compress to/from a membuffer that the plugin does not exploit. I am glad to see more interest in plugins! They are still incomplete, so I hope this new interest in plugins will show Jon there is enough interest in that architecture to complete it. It kind of a "catch 22" isn't it. Some are holding out for completion, Jon looking for interest in plugins.I would be nice if it were possible to pass an array back in the same manner as the other variable types.eltorro Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
JSThePatriot Posted April 20, 2007 Share Posted April 20, 2007 It kind of a "catch 22" isn't it. Some are holding out for completion, Jon looking for interest in plugins.I would be nice if it were possible to pass an array back in the same manner as the other variable types.eltorroThat is what I am waiting on to complete my SQLite plugin. I am sure it would come in handy for other plugins as well.I dont want to bother Jon as I know he has started his new job, and doing that can be quite taxing till you get in the swing of things, but it may help if you post in the plugins thread on the developer forum. Letting Jon know of your interest in the plugins side of AutoIt.JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
eltorro Posted April 20, 2007 Author Share Posted April 20, 2007 That is what I am waiting on to complete my SQLite plugin. I am sure it would come in handy for other plugins as well.I dont want to bother Jon as I know he has started his new job, and doing that can be quite taxing till you get in the swing of things, but it may help if you post in the plugins thread on the developer forum. Letting Jon know of your interest in the plugins side of AutoIt.JSArrays are such an intergal part of code. It is almost a necessity. I may post in the developers forum as you suggested.eltorro Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
eltorro Posted April 20, 2007 Author Share Posted April 20, 2007 Nice work, Thank you eltorro.Can I set the compression level of the zip I create?Edit: Any plans to add Example 3 - unzip from resource directly into memoryExample 4 - unzip chunk by chunk to a membufferOr is this already supported ?I looked at the code last night and again this morning. I don't see where to change it. I made a couple of changes but the results weren't what I expected. So I left it alone.eltorro Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
Eru Posted April 22, 2007 Share Posted April 22, 2007 I haven't tried to install an autoit plugin yet, and this is making me feel really stupid. I downloaded the zip file and extracted it to my \include directory. I include the file as such: #include<Au3Zip\bin\_ZipPlugin.au3> It checks fine when I CTRL+F5 in SciTE, but when I run the script, it says that the _ZipCreate function isn't defined. What am I doing wrong? Sorry if this is a moronic question. Link to comment Share on other sites More sharing options...
JSThePatriot Posted April 22, 2007 Share Posted April 22, 2007 I haven't tried to install an autoit plugin yet, and this is making me feel really stupid. I downloaded the zip file and extracted it to my \include directory. I include the file as such: #include<Au3Zip\bin\_ZipPlugin.au3> It checks fine when I CTRL+F5 in SciTE, but when I run the script, it says that the _ZipCreate function isn't defined. What am I doing wrong? Sorry if this is a moronic question. You are doing nothing wrong at all. Just continue, and your script will continue fine. However to make it run without that warning you need to add a compiler directive at the top. Add the following line to get rid of that error.#compiler_plugin_funcs = _ZipCreate, _ZipOtherFunc I hope this helps, JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008Â Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Eru Posted April 22, 2007 Share Posted April 22, 2007 I've added that line, and the error is still popping up. :/ Another note: The script automatically exits when it gives that error and no zip file is made. Link to comment Share on other sites More sharing options...
eltorro Posted April 22, 2007 Author Share Posted April 22, 2007 (edited) copy the dll to the directory with the script in it.I have a seperate dir in my includes folder called "user" where i place include files that aren't installed with autoit. This is where I place the "_ZipPlugin.au3" file. However most people just place it in "includes". The example script is coded with the _ZipPlugin.au3 being in the production Includes folder with all the other includes. If you are using Beta then you'll need a copy placed there too.At the top of _ZipPlugin.au3 is the compiler directives to ignore the plugin function names.If you could post the exact error, it would go a long ways towards fixing you problem.eltorro Edited April 22, 2007 by eltorro Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
eltorro Posted April 26, 2007 Author Share Posted April 26, 2007 I think I have just come across a bug in Apache webserver. I have had a couple of reports of corrupt downloads and indeed it happend to me for both of the links. I found that I can rename the file anything but Au3Zip.zip and it is perfectly fine. Even Au3zip.zip is fine. Needless to say I have changed the name and re-uploaded the files. eltorro Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
smashly Posted April 26, 2007 Share Posted April 26, 2007 Thank you for the update and name fix, I've really been enjoying using your plugin Sorry to be totally off subject , but a similar thing happened to me lately. I don't mean the apache server part , but the filename part. Have you ever tried to create a file or folder in windows xp and just name it con ? It just can't be done Bad luck if your name is con and you want a folder with your name on it...lol Link to comment Share on other sites More sharing options...
eltorro Posted April 28, 2007 Author Share Posted April 28, 2007 I've updated the plugin please see first post. A few changes. ;removed _ZipGetList() ;replaced it with _ZipList2Array() functions below. ;Added: _ZipGetCount($ZipFileName) ;Get the number if items in the zip _ZipGetItemInfo($ZipFileName,$ItemIndex) ;Get ptr to info for a zip item. ;Added In the UDF: _ZipItemInfo2Array($ZipFileName,$ItemIndex) ;- 1 dim array of item info (single zip item) _ZipList2Array($ZipFileName) ;- 2 dim array of item info (dim 1 = zip item , dim 2 = item info ) _ZipGetList replacement. eltorro Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
Gene Posted April 29, 2007 Share Posted April 29, 2007 Thank you for the update and name fix, I've really been enjoying using your plugin Sorry to be totally off subject , but a similar thing happened to me lately.I don't mean the apache server part , but the filename part.Have you ever tried to create a file or folder in windows xp and just name it con ?It just can't be done Bad luck if your name is con and you want a folder with your name on it...lolCon is a reserved word, it goes back as far as DOS 2.11You could use Kon, it would sound the same. Gene [font="Verdana"]Thanks for the response.Gene[/font]Yes, I know the punctuation is not right... Link to comment Share on other sites More sharing options...
Tom42 Posted May 21, 2007 Share Posted May 21, 2007 this should work correct? #Include <user/_ZipPlugin.au3> _ZipUnZip("dummy1.zip",@ScriptDir) It compiles fine but gives unknown function error Link to comment Share on other sites More sharing options...
i542 Posted May 21, 2007 Share Posted May 21, 2007 So of all the files in the .zip (by the way, it seems your ocotillo.sytes.net upload may be corrupted?), we only need _ZipPlugin.au3? None of the other *.c or *.dll files are needed, or do we need to fully extract all the contents of the .zip file into the script directory and rely on external .dll (and other?) files?I'll try this out in a bit - if it's pure AutoIt, this looks great! :-)Whoa, james, still here? Arent you the guy who helped me with my first problem?i542 I can do signature me. Link to comment Share on other sites More sharing options...
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