Jump to content

Recommended Posts

Posted (edited)

I mean are you sure you copied it correctly? Sometimes copying from the forum doesn't work quite right.

I see you're using XP Pro SP3. Have you read the posts starting at #95 regarding XP issues? Does it work if you remove the following line from the example:

_Zip_AddItem($file, $dir, "dir1\dir2")

Edited by wraithdu
Posted (edited)

It still crashes when I remove

_Zip_AddItem($file, $dir, "dir1\dir2")

I wanted to see if the IsObj() call was the source of the problem, so I put in a test line immediately above the Do..Until loop,

$myObj=$oNS.parseName($sNameOnly)

and it crashed on that as well with an "Error in Expression" message. So I'm pretty sure it's something about the parseName() call. I used ConsoleWrite() to check $sNameOnly just before failure, and it reported it as:

MyDir

I'm using all the code from your first post, as far as I know; I expanded it to a popup and used Ctrl+A to copy/paste everything.

I'm puzzled, because I understand that XP gives problems with regard to subdirectories, but I'm not using any subdirectories in this example. What's really strange is that in _Zip_GetNameSpace(), ParseName() is also called, but no error occurs.

Edited by sigil
Posted (edited)

Can you check @error after this line:

Local $oNS = _Zip_GetNameSpace($sZipFile, $sDestDir)

And then insert another line:

ConsoleWrite("TEST: " & IsObj($oNS) & @CRLF)

Lastly, find the function _Zip_COMErrorFunc in the UDF and put something meaningful in there to see if there are indeed any COM errors happening.

Edited by wraithdu
Posted (edited)

Ok, that was great advice.

Looks like something is indeed going wrong in _Zip_GetNameSpace() at:

Local $oNS = $oApp.NameSpace($sZipFile)

My error handler (I just cribbed the one from Autoit COM Help) reported, "Error 80020009: The system cannot find the file specified."

But the value being passed to $sZipFile is a valid path to the file, "C:\Documents and Settings\{my user name}\Desktop\test.zip". Why can't NameSpace() find the file?

Edit: after this line:

Local $oNS = $oApp.NameSpace($sZipFile)

@error returned 4.

Edited by sigil
Posted

Is the zip file created on your desktop a valid zip file? Can you open it in 7-zip or something?

If so, try this. If it doesn't work, maybe you need to reregister the zipfldr library? Cause if this fails, it's a problem with your OS, and not the UDF:

$sZipFile = "path\to\zip"
$oApp = ObjCreate("Shell.Application")
ConsoleWrite("Shell: " & IsObj($oApp) & @CRLF)
If IsObj($oApp) Then
    $oNS = $oApp.NameSpace($sZipFile)
    ConsoleWrite("Namespace: " & IsObj($oNS) & @CRLF)
EndIf
Posted

Is the zip file created on your desktop a valid zip file? Can you open it in 7-zip or something?

If so, try this. If it doesn't work, maybe you need to reregister the zipfldr library? Cause if this fails, it's a problem with your OS, and not the UDF:

$sZipFile = "path\to\zip"
$oApp = ObjCreate("Shell.Application")
ConsoleWrite("Shell: " & IsObj($oApp) & @CRLF)
If IsObj($oApp) Then
    $oNS = $oApp.NameSpace($sZipFile)
    ConsoleWrite("Namespace: " & IsObj($oNS) & @CRLF)
EndIf

It's a valid zip file; I opened it with PKZip, put files in it and then extracted them.

As for the test code, I think it failed but I'm not sure. IsObj($oNS) returned 0 but I didn't get that "could not find the specified file" error.

So...I'll need to re-register zipfldr.dll, I guess. I'll try that and get back to you. Thanks for your help so far.

Posted

Not that I can think of. Do zip files work inside explorer as the library is supposed to enable? Maybe you've got another shell extension that is causing problems? Or maybe XP is telling you it wants to die already....

  • 1 month later...
Posted

Small update, see first post.

**I recommend anyone looking for a serious zip UDF to find some of the 7-zip or zip.dll UDFs on this forum. The zipfldr library is inherently limited and difficult to work with. There are some platform specific problems, and bug fixing is tiresome.

Posted (edited)

Small update, see first post.

**I recommend anyone looking for a serious zip UDF to find some of the 7-zip or zip.dll UDFs on this forum. The zipfldr library is inherently limited and difficult to work with. There are some platform specific problems, and bug fixing is tiresome.

Thanks for that, but the beauty of this UDF, is that it doesn't require third party dll's.

I'm sure that many like myself are very grateful for what you and the others have provided here.

On a personal note, those who are in the know, will always use Rar over 7zip any day, due to it's far superior CRC checking, which I have on good authority is the reason a lot of ill-informed users turn to 7zip ... because of the errors for which they mistakenly blame rar. Apart from the cost & licensing of Winrar, it'll be a sad day when 7zip takes precedence over Rar as the main download source provided.

As regards the platform ... while many of us are still using XP at the moment, we'll just have to take a punt with what functions work or do not.

Please keep up the good work!

EDIT

Perhaps you should provide the UDF as an .au3 download, that way you will at least see how many people are interested in it?

Edited by TheSaint

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Posted

@wraithdu

Thanks for a nice udf. Good work.

I have also faced some platform specific issues, like deleting a file on XP.

I think it should be possible to create a zip udf from scratch. Actually I have some code which could be used as a starting point. What I currently have is code to generate 3 multidimentional arrays with all details as specified in the zip documentation, for Local File Headers, Central Directory Headers and Central Directory End. It is part of something else I made and possibly a little messy and weird coded.. For the specific project that uses it, Ward's zlib and crc32 machine code udf's are used for the compression and checksum.

Joakim

Posted

Sounds a bit like reinventing the wheel, but if you feel adventurous go for it! I'm not interested though :)

It is certainly a reinvention of the wheel! I'm currently not very inspired to expand much on it either. But I have it incase any others feel like. Hmm, well I'll post it anyway, in a new thread, so it's available.
Posted

Sounds like a good idea. Who knows, maybe I'll be bored one day too. Honestly I'm kinda interested in how it all works and the spec, but I never had enough interest to really go for it.

Posted

Hey all, First I love this UDF for zipping files.

While _Zip_AddItem in a large folder (25 - 2gig files) I receive an error message (looks to be from Windows not AutoIT or the UDF) saying "The Compressed (zipped) Folder is invalid or corrupted". This happens when it is only 20% complete. The zip file is is almost 8 gig when I get this message. The script does work in smaller folders without any problem. Also I think the zip is NOT corrupt because I can open it and extract files. I guess I'm running into a limitation of some sort. Any help or insight would be appreciated.

Thanks!

Posted

I guess I should have posted this is being developed and complied on Win XP 32 bit. The complied version is then put on Windows Server 2008 R2 64 bit. Will it use the 32 bit zipfldr from XP or does it find the zipfldr from Server R2 64 bit? Also When I get the @SystemDir from Server 2008 R2 it points to C:WindowsSysWOW64.

Thanks again!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...