By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,197 Members | 1,207 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,197 IT Pros & Developers. It's quick & easy.

Unpacking an archive using C#

P: 14
I'm trying to build a customised installer-type program in C#. It's different enough to not be using any sort of preset 'Installer' template, so I'm trying to accomplish the same sort of tasks manually.

My issue at the moment is how to get a bunch of files from one place to another. I can do a straightforward recursive directory copy, but I was hoping there was some way I could just bundle my compiled executable with a pre-packaged .zip, .cab, even straight binary data in .dat form, or something along those lines, which the program can extract into the appropriate directory/file structure.

Cheers in advance.
Feb 9 '09 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 229
You can google for "C# embedding resources", there should be some samples for how to embed data together with your exe.

You might check the SharpZipLib open source library for various compression algorithms.

Note that you can inherit from the Installer class to customize it, it still might be a better way to do it than creating an installer from scratch.
Feb 9 '09 #2

P: 14
The SharpZipLib looks to be close to what I want. I'll play around with it and come back if I've got any problems.

Embedding the resources would be useful, but the source may change frequently, so I would prefer it if I could just bundle up a new zip file and attach it with the executable for distribution.

I suppose I should clarify the task. Rather than a straightfoward installation in the classic sense, what I'm trying to do is more like a sequence of tasks, some of which are optional and some are not, and the order in which they're carried out can change depending on which tasks are being used.

The final goal is a website installer/configuration application. There will be three primary tasks for the app (copy the attached website files, change variables within those files, configure IIS), but each of those can also be carried out manually, so it has to be flexible enough to respond to that.

My current prototype interface essentially has a button for each of these three tasks. Clicking one of those will bring up a form asking for the relevant data for that section, and then carry out the task. Various options will be greyed out depending on what information the app has about the setup and which steps have been carried out already.
Feb 9 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.