Adding a whole folder (with subfolders) as embedded resource?

.net, c#

Solution

I had to solve this problem recently. I embedded a ZIP file, and then decompressed it at runtime.

.NET 4.5 includes ZIP functionality. If not, use SharpZipLib or DotNetZip.

Problem

I have an application that upon execution It copies `two folders with subfolders` that are in the same location to another windows location `%AppData%` Now I have the following files : MyApp.exe , Folder1, Folder2 In each folder there are subfolders. How to embed these two folders as resources inside the application so after compiling the program, I get only one executable file. And when I click on it, it extract the two folders to the same location then do the rest of job. I know how to add a file as embedded resource then retrieve it using reflection, but how about a folder Is that even possible??

Original source