gcriaco Posted April 11, 2005 Share Posted April 11, 2005 I need to compress files using some free dll, that returns a return code.My preferred one is the Info-Zip "zip32.dll" , but i'm unable to use the DllCall function correctly (just the command-line tool).Any other free DLL is OK.Can someone help me? Link to comment Share on other sites More sharing options...
kjactive Posted April 11, 2005 Share Posted April 11, 2005 Well I don't know much about this in AutoIt3 but this could help you if you'r into DLLCall dll stuff... ;Register the ZIP32.DLL function ZipInit(). This initializes the ZIP32.DLL ZIPPRINT = '32u, void, 32u' ZIPCOMMENT = 'void, void' ZIPPASSWORD = '32, void, 32, void, void' ZIPFUNCS = "func ZIPPRINT, func ZIPCOMMENT, func ZIPPASSWORD, void" $zpi = DLLCall("ZpInit", "32, struct ZIPFUNCS", "zip32") // not correct ;Register the ZIP32.DLL function ZpSetOptions(). This sets some options. ZIPOPTS = "void, str *, void, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 32u, 8u" $zps = DLLCall("ZpSetOptions", "32u, struct ZIPOPTS", "zip32") // Not correct ;ZIPNAMES struct must have a "str *" field for each filename you wish to add to the ZIP file. Here we declare it as having 16 fields, which means we're limited to 16 files in the zip. You can expand this if you need to. ZIPNAMES = "str *, str *, str *, str *, str *, str *, str *, str *, str *, str *, str *, str *, str *, str *, str *, str *" ;Register the ZIP32.DLL function ZpArchive(). This zips the files $zpa = DLLCall("ZpArchive", "32, 32u, str, struct ZIPNAMES", "zip32") // not correct ;Initialize a ZIPFUNCS struct ZipFuncs.1 = 'ZipPrint' ZipFuncs.2 = 'ZipComment' ZipFuncs.3 = 'ZipPassword' ZipFuncs.4 = 0 ;Initialize the ZIP32.DLL IF ZpInit(ZipFuncs) = 0 THEN ConsoleWrite("ZpInit failure!" & @CRLF) RETURN ENDIF ;Zero out all the numeric fields of the ZIPOPTS struct FOR $i = 1 TO 32 ZipOpts.$i = 0 NEXT ;Set the directory to the same one that RXFILE set ZipOpts.2 = 'The files directory' #CS * Some of the above fields may be set to 1 (instead of 0) * for certain options, as so: * * ZipOpts.6 (Encrypt files) * ZipOpts.7 (Include system and hidden files) * ZipOpts.8 (Include the drive label) * ZipOpts.9 (Exclude extra attributes) * ZipOpts.10 (Do not add directory entries) * ZipOpts.13 (Report oddities in the file) * ZipOpts.14 (Quiet operation) * ZipOpts.15 (Translate '0D0A'X to '0A'X, ie, CR/LF to LF) * ZipOpts.16 (Translate '0A'X to '0D0A'X, ie, LF to CR/LF) * ZipOpts.17 (Junk directory names) * ZipOpts.18 (Allow appending to a zip file) * ZipOpts.19 (Make entries using DOS names, ie k for Katz) * ZipOpts.20 (Delete files added or updated in zip file) * ZipOpts.21 (Delete files from zip file) * ZipOpts.22 (Update zip file--overwrite only if newer) * ZipOpts.23 (Freshen zip file--overwrite only) * ZipOpts.24 (Junk SFX prefix) * ZipOpts.25 (Set zip file time to time of latest file in it) * ZipOpts.26 (Put comment in zip file. Our ZipComment subroutine would need to return the comment text) * ZipOpts.27 (Update archive offsets for SFX files) * ZipOpts.28 (Use privileges) * * ============================== * * ZipOpts.30 can be set to 1 if you want to recurse into subdirectories (-r option, * or 2 if the -R option). * * ZipOpts.31 can be set to 1 if you want to repair the zip file (-F option, * or 2 if the -FF option). * * ZipOpts.32 is the compression level 0 to 9 (where 0 is the default level, and 9 is maximum). #CE ;Set the options ZpSetOptions(ZipOpts) ;We have a limit of 16 names due to our ZIPNAMES struct definition IF ZipNames.0 > 16 THEN ZipNames.0 = 16 ;The file names were already set into ZipNames.1 to ZipNames.16 #CS * Zip them into a ZIP file named "test.zip" in the TEMP dir, but first * delete any such file. Otherwise we would be adding these to that * existing zip archive. #CE ZipName = Path || "test.zip" Delete the file(ZipName) ZipName = 'c:\Test.zip' IF ZpArchive(ZipNames.0, ZipName, ZipNames) <> 0 THEN ConsoleWrite("ZpArchive error!" & @CRLF) This is an example I got in memory from another language, quickly translated and non function but could give you a clue to what to do - I would like to see a working example if this succeed for you... Kåre Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
kjactive Posted April 11, 2005 Share Posted April 11, 2005 (edited) No I know 'no structures in autoit3' but it could made functional anyway as direct call if one is on homeground to library calls as this is a nice zip32 example from another language and I got a semilare example to use UnZip32 just as well if one get this library to work with autoit - I like to see an example anyway but do not have the spirit me self... Kåre Edited April 11, 2005 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
steveR Posted April 12, 2005 Share Posted April 12, 2005 try this one: zlib.zip AutoIt3 online docs Use it... Know it... Live it...MSDN libraryglobal Help and SupportWindows: Just another pane in the glass. Link to comment Share on other sites More sharing options...
gcriaco Posted April 12, 2005 Author Share Posted April 12, 2005 (edited) try this one:zlib.zip<{POST_SNAPBACK}>Thanks, but unfortunately I don't know how to translate VB code to AutoIt. Edited April 12, 2005 by gcriaco Link to comment Share on other sites More sharing options...
HnAw Posted June 18, 2005 Share Posted June 18, 2005 no structures in autoit3Dllsctruct could to work ? Link to comment Share on other sites More sharing options...
layer Posted June 18, 2005 Share Posted June 18, 2005 Yes they can now, he said a while ago, before we had structure support Thanks Ejoc FootbaG Link to comment Share on other sites More sharing options...
t0ddie Posted June 18, 2005 Share Posted June 18, 2005 hmmm, speaking of zipping files, is there any scripts made that will zip files and unzip them automatically? it would also be nice to prompt the user to download winzip if its not installed, and download it if they click yes. i would work on it myself, but im not sure if one already exists. Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you. Link to comment Share on other sites More sharing options...
HnAw Posted June 19, 2005 Share Posted June 19, 2005 i was lookin for any script zip extractor too, but nothing :S,since i donno handle dlls, i cant create a script for it Link to comment Share on other sites More sharing options...
AgentJ Posted August 7, 2005 Share Posted August 7, 2005 I'd also like to do this but using the Zip dll file from the 7-Zip package. Anyone know how I could do it? Link to comment Share on other sites More sharing options...
blindwig Posted August 9, 2005 Share Posted August 9, 2005 I'd also like to do this but using the Zip dll file from the 7-Zip package. Anyone know how I could do it?<{POST_SNAPBACK}>As the web site, the program and it's DLLs are open source, and all the source and documentation is freely available. My UDF Threads:Pseudo-Hash: Binary Trees, Flat TablesFiles: Filter by Attribute, Tree List, Recursive Find, Recursive Folders Size, exported to XMLArrays: Nested, Pull Common Elements, Display 2dSystem: Expand Environment Strings, List Drives, List USB DrivesMisc: Multi-Layer Progress Bars, Binary FlagsStrings: Find Char(s) in String, Find String in SetOther UDF Threads I Participated:Base64 Conversions Link to comment Share on other sites More sharing options...
ikaros Posted December 4, 2007 Share Posted December 4, 2007 Well, im trying to work with zlib also, but the callDll function returns error code 3 (no function found). Here is the code : $logsList=_FileListToArray($GQM,"*.log") If @error = 4 Then FileWriteLine($appLog,$prefix & "No files found in the desingnated folder") Else FileWriteLine($appLog,$prefix & "Found " & _ArraySize($logsList)-1 & " log files") $zipPath = IniRead(@ScriptDir & "\gqm.ini","GQM","zipPath", "NotFound") $zipFileName = IniRead(@ScriptDir & "\gqm.ini","GQM","zipFileName", "NotFound") & "_" & @MDAY()&@MON&@YEAR&"_"&@HOUR&@MIN&@SEC&".zip" DllCall("zlib.dll","str","CreateZipFile","str",$GQM,"hwnd",$logsList,"str",$zipFileName) ConsoleWrite( "Return code : " & @error & @CRLF) EndIf Any idea? Ofer,WWW Home baseArticles for allOnline statistics toolThe online mass mailerWorld of bicycles Link to comment Share on other sites More sharing options...
BrettF Posted December 4, 2007 Share Posted December 4, 2007 Maybe the bit I bolded... $logsList= _FileListToArray($GQM,"*.log") If @error = 4 Then FileWriteLine($appLog,$prefix & "No files found in the desingnated folder") Else FileWriteLine($appLog,$prefix & "Found " & _ArraySize($logsList)-1 & " log files") $zipPath = IniRead(@ScriptDir & "\gqm.ini","GQM","zipPath", "NotFound") $zipFileName = IniRead(@ScriptDir & "\gqm.ini","GQM","zipFileName", "NotFound") & "_" & @MDAY[b]()[/b]&@MON&@YEAR&"_"&@HOUR&@MIN&@SEC&".zip" DllCall("zlib.dll","str","CreateZipFile","str",$GQM,"hwnd",$logsList,"str",$zipFileName) ConsoleWrite( "Return code : " & @error & @CRLF) () should not be there? And way to bring up the past... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
picaxe Posted December 4, 2007 Share Posted December 4, 2007 I need to compress files using some free dll, that returns a return code.My preferred one is the Info-Zip "zip32.dll" , but i'm unable to use the DllCall function correctly (just the command-line tool).Any other free DLL is OK.What about this udf Link to comment Share on other sites More sharing options...
ikaros Posted December 4, 2007 Share Posted December 4, 2007 () did not solve it... More ideas ? Ofer,WWW Home baseArticles for allOnline statistics toolThe online mass mailerWorld of bicycles Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted December 5, 2010 Share Posted December 5, 2010 Why not use 7-zip32.dll it has lots of func's and has the ability to work with zip files. click to view the post about the dll.Look at the dates the next time you post .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface 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