rasim Posted January 27, 2009 Author Share Posted January 27, 2009 one request though, could you please add a version or date to the UDF, so tracking updates would be easier?I think this not it is necessary, because mistakes are corrected only.Edit:Taking a deeper look, should the _OnAutoitExit() func be called manually on Exit? Don't see it being done. Also you wrote IsDeclared("$hDLL_7ZIP"), I think it should be IsDeclared("hDLL_7ZIP").Damn! I'm very unattentive. Thank you! Fixed Link to comment Share on other sites More sharing options...
KaFu Posted January 27, 2009 Share Posted January 27, 2009 Hmmm, this way you silently override an OnAutoItExit() func defined by the user. Wouldn't something like Opt("OnExitFunc","OnAutoItExit") global $old_opt = Opt("OnExitFunc","OnAutoItExit_7Zip") GUICreate("test", 230, 90) GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop sleep(5) WEnd Func OnAutoItExit() MsgBox(0,'','Org OnAutoItExit func') EndFunc Func OnAutoItExit_7Zip() call($old_opt) MsgBox(0,'','7Zip OnAutoItExit func') EndFunc be nicer? Or point out at top of the UDF that the user somehow has to include your exit func in his own like Func OnAutoItExit() MsgBox(0,'','Org OnAutoItExit func') OnAutoItExit_7Zip() endfunc ...not sure about this, just random thoughts ... Btw, do you now a switch to preserve folder path information in the zip? Couldn't find it (yet).... Best Regards OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
GEOSoft Posted January 27, 2009 Share Posted January 27, 2009 Btw, do you now a switch to preserve folder path information in the zip? Couldn't find it (yet)....-r switch when adding or updating files makes it recursive.for extracting with full paths you can usex command to extract with full paths. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
KaFu Posted January 27, 2009 Share Posted January 27, 2009 -r switch when adding or updating files makes it recursive.Tried it, but that archives files in subdirs, (for me) not the directory information ... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
wraithdu Posted January 27, 2009 Share Posted January 27, 2009 Archiving in subdirs is the path information. I don't think you're going to be able to save a path like "C:\Program Files\blah\blah" in an archive. It's going to be relative paths to the root of your extraction. Then as suggested use the 'x' command to extract full paths, relative to your extraction root. Link to comment Share on other sites More sharing options...
KaFu Posted January 28, 2009 Share Posted January 28, 2009 (edited) Archiving in subdirs is the path information. I don't think you're going to be able to save a path like "C:\Program Files\blah\blah" in an archive. It's going to be relative paths to the root of your extraction. Then as suggested use the 'x' command to extract full paths, relative to your extraction root.Tried that , can't archive what I want. I want to pack files incl. there relative path (not the absolute one), e.g. like in this example:#include<7Zip.au3> FileCopy('c:\windows\system32\rundll32.exe',@ScriptDir & '\windows\systemTEST\',9) _7ZipAdd(0,@ScriptDir & '\test.zip','c:\windows\system32\rundll32.exe',0,5,1) _7ZipAdd(0,@ScriptDir & '\test.zip',@ScriptDir & '\windows\systemTEST\rundll32.exe',0,5,1) _7ZIPExtract(0,@ScriptDir & '\test.zip',@ScriptDir,0,0,1) _7ZIPExtractEx(0,@ScriptDir & '\test.zip',@ScriptDir,0,0,1)The files should go to '\windows\system32\' and @scriptdir & '\windows\systemTEST\' in the archive, and my desired result would be to extract them to @scriptdir & '\windows\system32\' and@scriptdir & @scriptdir & '\windows\systemTEST\' But it doesn't work this way.My problem is, that I want to pack files from different dirs with the same filename. But the code above won't pack two files like lets sayc:\windows\system32\rundll32.exe andc:\windows\system\rundll32.exeinto the same archive. It would overwrite the first file in the archive (or skip packing it, depending on the params). And neiter of the extraction functions unpacks incl. relative path.Thanks for your suggestions so far.... Best RegardsEdit: Updated example Edited January 28, 2009 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
wraithdu Posted January 28, 2009 Share Posted January 28, 2009 (edited) I think to do what you want you'll need to artificially create your directory structure, ie - <base_dir> \windows\system32\rundll32.exe \windows\systemTEST\rundll32.exe then _7ZipAdd(0,@ScriptDir & '\test.zip',@ScriptDir & "\<base_dir>",0,5,1) assuming that function will recursively add a directory (I didn't look at the UDF, but you get the idea). I don't think there's any archiver that will do exactly what you're asking. They're all based off a single base directory, then relative paths of files / folders underneath. Edited January 28, 2009 by wraithdu Link to comment Share on other sites More sharing options...
KaFu Posted January 28, 2009 Share Posted January 28, 2009 to artificially create your directory structureYeah, that would be a workaround, but I fear with inferior speed. Want to use it for SMF, so that you can filter on any files, regardless of their location, and add them to an archive. And during testing I was confronted with this issue. But on the otherhand I don't want to move files (even though maybe unnoted) this way on my 'clients' pc.They're all based off a single base directory, then relative paths of files / folders underneath.At least 7-zip (and this issue is clearly a .dll issue) and zipfldr.dll seem to behave this way, guess I'll search and test other open-source packers.Thanks for you're input... and rasim for this great plugin ...Best Regards OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Ontrack16 Posted February 7, 2009 Share Posted February 7, 2009 When I try to use the udf, I get an error about an undeclared variableZ:\AutoIt3\Include\7Zip.au3 (744) : ==> Variable used without being declared.:If $hArchiveProc Then DllCallbackFree($hArchiveProc)If ^ ERRORI downloaded and installed latest autoit and 7zip versions. Link to comment Share on other sites More sharing options...
Ontrack16 Posted February 8, 2009 Share Posted February 8, 2009 I went looking inside the 7zip.au3. I saw no problem with the variable. It is properly declared as a global (at beginning in the file). Beats me why the error appears then What I did see is that in the beginning, it tries to open 7-zip32.dl in the script folder. Global $hDLL_7ZIP = DllOpen(@ScriptDir & "\7-zip32.dll")l I tried to find this file in my 7zip installation (4.65) but couldn't find it. So I googled and downloaded a version (3.11.0.1) So I placed the requested file in my script dir. And yes, now it works Link to comment Share on other sites More sharing options...
RomanK Posted February 8, 2009 Share Posted February 8, 2009 Does anyone know if there is also a 7-zip64.dll ? I noticed that the 7-zip32.dll only works on 32-bit operating systems. [font="Courier New"]http://RomanK.hondadesigns.com[/font] Link to comment Share on other sites More sharing options...
RomanK Posted February 18, 2009 Share Posted February 18, 2009 I am having a serious problem I can't fix myself..... the udf author is needed here! The script crashes without any obvious reason. Here the message the box in SciTe shows and below the part of code where it happens: >Running:(3.2.12.1):C:\Program Files\AutoIt3\autoit3.exe "J:\Coding\Caravelle v3.5\Builds\Caravelle3_Setup.au3" !>15:21:42 AutoIT3.exe ended.rc:-1073741819 >Exit code: -1073741819 Time: 70.444 If Not FileExists($path & "\Icons\Caravelle³.ico") Then $text &= "Extracting Icon Library..." &@CRLF GUICtrlSetData($info, $text) $sizeArc = _7ZipGetFileCount($f_IconLib_file);;;;; This is the line where the script crashes!!! The next line is not executed, the line before is. $retResult = _7ZipSetOwnerWindowEx($ui_fg, "_ARCHIVERPROC") If $retResult = 0 Then MsgBox(16, "", "Error occured") ;Exit EndIf $retResult = _7ZIPExtractEx($ui_fg, $f_IconLib_file, $path & "\Icons", 1) EndIf Please help me! [font="Courier New"]http://RomanK.hondadesigns.com[/font] Link to comment Share on other sites More sharing options...
eXoRt Posted February 22, 2009 Share Posted February 22, 2009 Hi, I've been trying for the past 2 hours to figure out how to extract only a certain filetype(*.tif) from an archive. Could someone provide a working example ? Thanks, eXoRt Link to comment Share on other sites More sharing options...
stamandster Posted February 23, 2009 Share Posted February 23, 2009 Hi,I've been trying for the past 2 hours to figure out how to extract only a certain filetype(*.tif) from an archive. Could someone provide a working example ?Thanks,eXoRtDid you try with the findfile function and _7zipadd for each file found? Link to comment Share on other sites More sharing options...
KaFu Posted February 23, 2009 Share Posted February 23, 2009 (edited) I've been trying for the past 2 hours to figure out how to extract only a certain filetype(*.tif) from an archive. Could someone provide a working example ? #include <7Zip.au3> $ArcFile = FileOpenDialog("Select archive", "", "Archive Files (*.7z;*.zip;*.gzip;*.bzip2;*.tar)") If @error Then Exit $hArc = _7ZipOpenArchive(0, $ArcFile) If $hArc = 0 Then Exit MsgBox(16, "_7ZipOpenArchive", "Error occured") _7ZIPExtract(0,$ArcFile,0,0,0,1,'','','*.tif') _7ZipCloseArchive($hArc) Edited February 23, 2009 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
eXoRt Posted March 4, 2009 Share Posted March 4, 2009 Thanks! But now I need something else... I've tried to figure this out by myself again. I'm trying to archive specific files types: *.xml, *.ssi, *.spi, *.hdt, *.sst and *.png I was only able to specify 2 files type using $FileName = $Output & "\*.png" $sInclude="*.xml" ;Add Files to Archive $retResult = _7ZipAdd(0, $ArcFile, $FileName, 0, 5, 1, $sInclude) Any thoughts ? Link to comment Share on other sites More sharing options...
jennico Posted March 14, 2009 Share Posted March 14, 2009 hmm. for me, every single example crashes autoit with drwatson. am i the only one with problems ? j. Spoiler I actively support Wikileaks | Freedom for Julian Assange ! | Defend freedom of speech ! | Fight censorship ! | I will not silence.Don't forget this IP: 213.251.145.96 Link to comment Share on other sites More sharing options...
Zachlr Posted April 20, 2009 Share Posted April 20, 2009 I keep getting: Line 744 (File "C:\Users\Zach\Documents\au\7Zip\7Zip.au3"): If $hArchiveProc Then DllCallbackFree($hArchiveProc) If ^ ERROR Error: Variable used without being declared. ------- Windows Vista Home Premium, sp 0. Am I missing a file or something? Thanks Link to comment Share on other sites More sharing options...
vengat Posted April 23, 2009 Share Posted April 23, 2009 it seems to be a nice job ! vengat , cool of all Link to comment Share on other sites More sharing options...
5eraph Posted May 5, 2009 Share Posted May 5, 2009 Hello, all. I'm new here, so please take it easy on me. I've read through this thread from the start and despite a couple mentions on the first page starting with rasim, it isn't clear whether these user-defined functions will work with the latest version of 7za.dll (official 7-Zip Library). Rasim links to a rather ancient discussion of problems with a much older version of the DLL. GEOSoft seems to have had some experience with 7za.dll, but doesn't specify which versions or how long ago he's tried. A much more recent mention of the use of the DLL that I found with a google search seems to confirm some difficulties in its "Known Issues" section, yet further down states the following:Important Update: Starting from 7-Zip 4.46 alpha Igor did necessary changes in the code. So, from this version forward, you can use format DLLs directly, without applying any patch.Personally, I'm just interested in a more recent version than the one linked in rasim's first post which is over two and a half years old. 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