views:

138

answers:

4

I want to create a installer which would just dump few files and folders at a location specified by user. But the problem is these files are required to be picked up from a fixed source folder and then the installer is build. Also, these files may change any time and then again a new version of the installer is required to be created.

I want to do this in .Net using Setup and Deployment project. I'm not sure how to do this. Do I need to create another class library project with a Setup Poject?

Actually the installer will have two options:

  1. Simply extract the files at the specified location
  2. Embed the files (the HTML files) in the intranet sharepoint site.

Does anyone has any idea?

+2  A: 

Consider a Self-extracting ZIP file.

You can build one with DotNetZip. It requires .NET on the target machine. It unpacks files to a user-specified location, and then optionally runs a program that you specify. That program could be one of the files unpacked, or could be something else.

To create a self-extracting archive using DotNetZip, this is the code:

// create the SFX
using (ZipFile zip1 = new ZipFile())
{
    zip1.AddFile(filename1, "");       // extract to toplevel
    zip1.AddFile(filename2, "subdir"); // extract to subdir
    zip1.AddFile(filename3, "subdir");
    zip1.Comment = "This will be embedded into a self-extracting exe";
    zip1.AddEntry("Readme.txt", "This is Update XXX of product YYY");
    var sfxOptions = new SelfExtractorSaveOptions {
        Flavor = SelfExtractorFlavor.WinFormsApplication,
        Quiet = false,  // false == show a UI
        DefaultExtractDirectory = UnpackDirectory
    }
    zip1.SaveSelfExtractor(SfxFileToCreate, sfxOptions);
}

The UI of the generated SFX looks like this:

alt text

The SFX does not rely on MSI, so there is no uninstall option. This may or may not be a good thing.

Cheeso
+1  A: 

Here's a good article on Setup and Deployment: http://aspalliance.com/622_StepbyStep_Process_of_Creating_a_Setup_and_Deployment_Project.all

Icono123
A: 

I created a windows application with several forms doing all the required stuff. This windows application behaved like a Setup.

Manish
A: 

Built in setup and deployment projects are a total pain in my experience, so instead I use Advanced installer. Its cheap and easy to use. I think they have a free edition also.

Jon Preece