INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Using a zip file as an embedded resource and extracting the contents at runtime?

Using a zip file as an embedded resource and extracting the contents at runtime?

Using a zip file as an embedded resource and extracting the contents at runtime?

(OP)
I'm looking at doing the following:
  1. Embedding a zip file as a resource in my executable
  2. Extracting its contents to the same folder as the executable at runtime
  3. NOT writing out the zip file first
  4. Targeting .Net 2.0 (I plan on using this on older, air-gapped systems that probably only have 2.0)
  5. I'd prefer avoiding the use of any 3rd party libraries (for the same reason as #4)
I believe I can embed the zip as a resource just like embedding an image or text file by selecting the zip file instead. I've found examples of how to write a file from a resource using a FileStream object (this gives me access to the resource but violates the third goal). I've found examples for using a MemoryStream object (which I think would comply with #3) but no idea whether or how it would work with any of the zip related classes. I've looked at the ZipFile, ZipArchive, DeflateStream, and GZipStream classes but all of the examples I've found appear to use a physical file (I've either missed or misunderstood all the examples).

I have a sneaking suspicion that I'm really close to a solution, but have no idea how to put the individual pieces together.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close