1

I am trying to write a small application, whose only purpose is to copy some folders and .cs source files into a user specified Directory, I can do it easy enough by simply having the application look for the files and folders in its own install directory then copy them to thier destination Directory, but I was wondering if its possible to Embed the Folders and Files into the Application, so that when you run the application it creates or copies the folders and files from the exe app directly to the install directory, rather than searching for them in the apps install directory then copying them over. Basically Im trying to only have a single exe file rather than having an exe file and a bunch of folders and files along side it.

Is this possible to do with just a Windows Form App without using an actual Installer Class?

horgh
  • 17,918
  • 22
  • 68
  • 123
roadmaster
  • 593
  • 2
  • 9
  • 22

3 Answers3

1

Yes. Embed the files into the application executable as embedded resources. Then when your application runs, access the embedded files and write them to disk in the desired directory structure.

Here is an example of how to embed and access embedded resources from your application assembly.

http://support.microsoft.com/kb/319292

lahsrah
  • 9,013
  • 5
  • 37
  • 67
  • took me a bit but finnaly got it working, thanks for the Link, I didnt know about the ability to Embed before thanks again. – roadmaster Sep 18 '12 at 04:53
0

Sure you can, use the BuildAction property as Content or Resource.

Community
  • 1
  • 1
Erre Efe
  • 15,387
  • 10
  • 45
  • 77
0

Depending on the number and structure of files/folders, you may also consider embedding one zip file and extracting it with sharpziplib or some such.

Eugene Ryabtsev
  • 2,232
  • 1
  • 23
  • 37