Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to uncompress zip file into a folder without external dependencies like Interop.Shell32.dll or 3rd-Party Assemblies?

How to uncompress zip file into a folder without external dependencies like Interop.Shell32.dll or 3rd-Party Assemblies?

Scheduled Pinned Locked Moved C#
csharpcomhelpwpfwcf
11 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Kerem Guemruekcue

    Hi, i am looking for a way to extract the entire content of a zip file into a folder without using any external dependencies like Interop.Shell32.dll or 3rd-Party Libs like DotNetZip etc. The entire thing should run from within a single assembly. I personally would like to use the Windows build-in ZIP-Shell extension available from windows XP to Win10 by accessing it with preferably late binding via .NET/C#, but i am kinda stuck on how to do it and what the COM-Interfaces/Types for that should look like. :confused: Any help would be really higly appreciated. :thumbsup: best K.

    ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü ----------------------- "This reply is provided as is, without warranty express or implied."

    L Offline
    L Offline
    Lost User
    wrote on last edited by
    #2

    Zipping using System.IO.Compression[^]

    Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

    K 1 Reply Last reply
    0
    • L Lost User

      Zipping using System.IO.Compression[^]

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

      K Offline
      K Offline
      Kerem Guemruekcue
      wrote on last edited by
      #3

      Hi Eddy, thanks for the answer. I forgot one thing to mention here, that the application is using the 2.0 .NET Framework and cant compiled against anything else for compatibility use with other libraries/references included. The System.IO.Compression needs at least 4.5 Framework. best K.

      ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü ----------------------- "This reply is provided as is, without warranty express or implied."

      L 1 Reply Last reply
      0
      • K Kerem Guemruekcue

        Hi Eddy, thanks for the answer. I forgot one thing to mention here, that the application is using the 2.0 .NET Framework and cant compiled against anything else for compatibility use with other libraries/references included. The System.IO.Compression needs at least 4.5 Framework. best K.

        ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü ----------------------- "This reply is provided as is, without warranty express or implied."

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #4

        Kerem Guemruekcue wrote:

        I forgot one thing to mention here, that the application is using the 2.0 .NET Framework and cant compiled against anything else for compatibility use with other libraries/references included. The System.IO.Compression needs at least 4.5 Framework.

        It doesn't; it is part of 2.0. See MSDN[^].

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

        K 1 Reply Last reply
        0
        • L Lost User

          Kerem Guemruekcue wrote:

          I forgot one thing to mention here, that the application is using the 2.0 .NET Framework and cant compiled against anything else for compatibility use with other libraries/references included. The System.IO.Compression needs at least 4.5 Framework.

          It doesn't; it is part of 2.0. See MSDN[^].

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

          K Offline
          K Offline
          Kerem Guemruekcue
          wrote on last edited by
          #5

          This is true in terms of availability of the namespace, but the unzipping zip file classes are available starting 4.5 FW. See for yourself: ZipFile Class (System.IO.Compression)[^]

          ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü ----------------------- "This reply is provided as is, without warranty express or implied."

          L 1 Reply Last reply
          0
          • K Kerem Guemruekcue

            This is true in terms of availability of the namespace, but the unzipping zip file classes are available starting 4.5 FW. See for yourself: ZipFile Class (System.IO.Compression)[^]

            ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü ----------------------- "This reply is provided as is, without warranty express or implied."

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #6

            Kerem Guemruekcue wrote:

            This is true in terms of availability of the namespace, but the unzipping zip file classes are available starting 4.5 FW. See for yourself

            You are referring to a helper-class that simplifies the tasks. The GZipStream is available in 2.0, and you could zip/unzip in 2.0 without using third-party libraries. Example on MSDN[^].

            Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

            K 1 Reply Last reply
            0
            • L Lost User

              Kerem Guemruekcue wrote:

              This is true in terms of availability of the namespace, but the unzipping zip file classes are available starting 4.5 FW. See for yourself

              You are referring to a helper-class that simplifies the tasks. The GZipStream is available in 2.0, and you could zip/unzip in 2.0 without using third-party libraries. Example on MSDN[^].

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

              K Offline
              K Offline
              Kerem Guemruekcue
              wrote on last edited by
              #7

              I am not sure how this will help me to unpack a zip file into a folder. The example there only shows how to compress/decompress a single file with GZip compression. I am familiar with that mechanism and it would be overkill to reinvent a library from Deflate/GZip classes in .NET to create a unpacker for folders packet into a zip container file. The example works just fine on a single file, but not on a Zip archive.

              ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü ----------------------- "This reply is provided as is, without warranty express or implied."

              L 1 Reply Last reply
              0
              • K Kerem Guemruekcue

                I am not sure how this will help me to unpack a zip file into a folder. The example there only shows how to compress/decompress a single file with GZip compression. I am familiar with that mechanism and it would be overkill to reinvent a library from Deflate/GZip classes in .NET to create a unpacker for folders packet into a zip container file. The example works just fine on a single file, but not on a Zip archive.

                ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü ----------------------- "This reply is provided as is, without warranty express or implied."

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #8

                Kerem Guemruekcue wrote:

                I am not sure how this will help me to unpack a zip file into a folder. The example there only shows how to compress/decompress a single file with GZip compression. I am familiar with that mechanism and it would be overkill to reinvent a library from Deflate/GZip classes in .NET to create a unpacker for folders packet into a zip container file.

                Then use one of the existing libraries. Did you not state you did not want a dependency on things like SharpZipLib and DotNetZip?

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                K 1 Reply Last reply
                0
                • L Lost User

                  Kerem Guemruekcue wrote:

                  I am not sure how this will help me to unpack a zip file into a folder. The example there only shows how to compress/decompress a single file with GZip compression. I am familiar with that mechanism and it would be overkill to reinvent a library from Deflate/GZip classes in .NET to create a unpacker for folders packet into a zip container file.

                  Then use one of the existing libraries. Did you not state you did not want a dependency on things like SharpZipLib and DotNetZip?

                  Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^] "If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.

                  K Offline
                  K Offline
                  Kerem Guemruekcue
                  wrote on last edited by
                  #9

                  Quote:

                  Then use one of the existing libraries. Did you not state you did not want a dependency on things like SharpZipLib and DotNetZip?

                  Yes, i did and thats why i was prefering the late binding option to the shell zip functionality build into windows. As said, the entire thing should be running from a single exe file with no extra libs attached. the zip com extension is available from XP up to 10. using the GZip/Deflate classes in that namespace supporting .NET 2.0 would require to implement a full unzipper for zip containers in zip format like implemented in the helper classes available starting 4.5 FW. that would be a total overkill.

                  ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü ----------------------- "This reply is provided as is, without warranty express or implied."

                  1 Reply Last reply
                  0
                  • K Kerem Guemruekcue

                    Hi, i am looking for a way to extract the entire content of a zip file into a folder without using any external dependencies like Interop.Shell32.dll or 3rd-Party Libs like DotNetZip etc. The entire thing should run from within a single assembly. I personally would like to use the Windows build-in ZIP-Shell extension available from windows XP to Win10 by accessing it with preferably late binding via .NET/C#, but i am kinda stuck on how to do it and what the COM-Interfaces/Types for that should look like. :confused: Any help would be really higly appreciated. :thumbsup: best K.

                    ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü ----------------------- "This reply is provided as is, without warranty express or implied."

                    Richard DeemingR Offline
                    Richard DeemingR Offline
                    Richard Deeming
                    wrote on last edited by
                    #10

                    GitHub - jaime-olivares/zipstorer: A Pure C# Class to Store Files in Zip[^] No need for an external library; just one .cs file[^] to include in your project. Uses the MIT license, so you just need to include the copyright notice. If you really want to use the shell API, there's an article for that: Decompress Zip files with Windows Shell API and C#[^]


                    "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                    "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

                    K 1 Reply Last reply
                    0
                    • Richard DeemingR Richard Deeming

                      GitHub - jaime-olivares/zipstorer: A Pure C# Class to Store Files in Zip[^] No need for an external library; just one .cs file[^] to include in your project. Uses the MIT license, so you just need to include the copyright notice. If you really want to use the shell API, there's an article for that: Decompress Zip files with Windows Shell API and C#[^]


                      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

                      K Offline
                      K Offline
                      Kerem Guemruekcue
                      wrote on last edited by
                      #11

                      Hi Richard, thanks for the answer. Yes, i have seen that article before, but this uses early binding with a com wrapper. Thats the easy way, but i am looking for late binding at runtime with no additionall assembly file, like this project uses. best K.

                      ----------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü ----------------------- "This reply is provided as is, without warranty express or implied."

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups