Tech Off Thread

12 posts

How do you create an XP zipped file/folder in vb code

Back to Forum: Tech Off
  • User profile image
    Taskerr

    Any ideas?

  • User profile image
    Blkbam
  • User profile image
    Blkbam

    Also they aren't folders.  XP reads the zip file and allows browsing like a folder.  Opening a file from the zip is decompressed in your temp folder and then handled appropriately.

  • User profile image
    Taskerr

    Ok! But I'm sure the documentation refers to it as a folder. The icon is a folder with a zip on it.

  • User profile image
    Taskerr

    Thanks for that! However I should have made my self clearer.
     
    I have already done something similar using Info-Zip's zip32.dll at 

      http://www.info-zip.org/pub/infozip/

    With alittle help from the Contribution to the Info-Zip project by Mike Le Voi

      http://modemss.brisnet.org.au/~mlevoi

    It works very well, but you have to save the dll to the system32 dir something I'm not comfortable with.

    I was hoping that there might be an XP class that I could use in a similar way to zip32.dll.

    I'm sure there must be one, only I cannot find references to it. Maybe the guys at MSDN can help?

  • User profile image
    Sven Groot

    Windows XP does not have an API to its ZIP implementation. It's just an extension to Explorer, not an integral part of the OS. Unfortunately, you will have to use a third party solution to create ZIP files.

    Have you tried just putting the DLL in the application directory, often that works too.

  • User profile image
    Taskerr

    Tried that. No Luck!

    I guess the dll is hard wired to the system32 dir.

    Is there a sensible reason why a zip class is not available as part of the OS other than MS never got round to doing it?

    The need for this comes from unattended automatic emailing with very large attachements resulting from data extraction on a daily basis.

    Server storage is caned by this sort of thing.
     
    If the OS people cannot do this how about the Outlook team building this into MAPI?

  • User profile image
    FluffyDevil​Bunny

    Most likely because of the licensing model of LZW and Zip.

    -FDB

  • User profile image
    FluffyDevil​Bunny

    Taskerr wrote:
    Thanks for that! However I should have made my self clearer.
     
    I have already done something similar using Info-Zip's zip32.dll at 

      http://www.info-zip.org/pub/infozip/

    With alittle help from the Contribution to the Info-Zip project by Mike Le Voi

      http://modemss.brisnet.org.au/~mlevoi

    It works very well, but you have to save the dll to the system32 dir something I'm not comfortable with.

    I was hoping that there might be an XP class that I could use in a similar way to zip32.dll.

    I'm sure there must be one, only I cannot find references to it. Maybe the guys at MSDN can help?



    Use the ICSharpCode implamentation of zip. It will reside in the same directory as your assembly. You are right to not want to copy the zip component to the system directory. This would be a violation of the "Designed for Windows" logo which are the best practices that all developers should follow. Your components should never be installed into the windows or system directory.

    -FDB

  • User profile image
    Sampy

    I've heard rumors (not internally, externally) that is has to do with the company we licensed the zip component from. We could embedd it in the OS but we couldn't expose it as an API.

    THIS IS JUST A RUMOR. I have no proof of this.

  • User profile image
    sbc

    I suppose if the API was exposed, third party compression tools would be less appealing (compressed folders may have lost WinZip some customers).

  • User profile image
    shreyasonli​ne

    Taskerr wrote:
    Tried that. No Luck!

    I guess the dll is hard wired to the system32 dir.

    Is there a sensible reason why a zip class is not available as part of the OS other than MS never got round to doing it?

    The need for this comes from unattended automatic emailing with very large attachements resulting from data extraction on a daily basis.

    Server storage is caned by this sort of thing.
     
    If the OS people cannot do this how about the Outlook team building this into MAPI?


    Try this way,

    - Put that dll in your App folder
    - register it with c:\winnt\system32\regsvr32.exe like below
       c:\>regsvr32 apppath/zipdll.dll
       
       to unregister,
       c:\>regsvr32 /u apppath/zipdll.dll

    this will work i think so.

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.