How to uncompress zip file into a folder without external dependencies like Interop.Shell32.dll or 3rd-Party Assemblies?
-
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."
-
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.
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."
-
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."
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.
-
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.
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."
-
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."
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.
-
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.
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."
-
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."
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.
-
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.
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."
-
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."
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
-
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
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."