views:

597

answers:

4

I have created an application ,( c#,winforms) on VS 2008, i want to make installer of this application...

how is this done.

I want my installer to

  • copy all the files that my application is using to a user choosed path (copy the files on chocice, some for server-side app and some for client side)
  • also install .Net 3.5
  • check for SQL server or express ed

how to do it. F1! F1!

+1  A: 

Generally speaking, it's recommended to use MSI-based installations on Windows. Thus, if you're ready to invest a fair bit of time, WiX is the way to go.

If you want something which is much more simpler, go with InnoSetup.

Anton Gogolev
+3  A: 
  1. Add new Install project to your solution.
  2. Add targets from all projects you want to be installed.
  3. Configure pre-requirements and choose "Check for .NET 3.5 and SQL Express" option. Choose location from where missing components must be installed.
  4. Configure your installer settings - company name, version, copyrights etc.
  5. Build and go!
sashaeve
Will this allow MSI feature? sounds like it's needed - "copy the files on choice..." maybe you can get away with 2 different installers? but if install project doesn't provide features, go with wix.
Si
If you need some specific install logic you can write some code (and add your own forms) that will do the work you need.
sashaeve
"Add targets from all projects you want to be installed."how man.. i dont knw anything about it...
Junaid Saeed
Some good tutorial you can find here: http://www.dreamincode.net/forums/index.php?showtopic=58021
sashaeve
man this was awesome help.... Ladies n Gentle the best answer in the history of StackOverFlow
Junaid Saeed
+1  A: 

+1 on Sash answer. Just a tip though:

If you have a server side and a client side I would suggest making two setups. If by any chance you need to update just one side you either do it by hand (if possible), or uninstall both sides and install the updated version.

GranadaFEUP
+2  A: 

their are several methods, two of which are as follows

Provide a Create a custom Installer or provide a SetUp project

Here is how to Create a custom Installer

[RunInstaller(true)]
public class MyInstaller : Installer
{
    public HelloInstaller()
        : base()
    {
    }

    public override void Commit(IDictionary mySavedState)
    {
        base.Commit(mySavedState);
        System.IO.File.CreateText("Commit.txt");
    }

    public override void Install(IDictionary stateSaver)
    {
        base.Install(stateSaver);
        System.IO.File.CreateText("Install.txt");
    }

    public override void Uninstall(IDictionary savedState)
    {
        base.Uninstall(savedState);
        File.Delete("Commit.txt");
        File.Delete("Install.txt");
    }

    public override void Rollback(IDictionary savedState)
    {
        base.Rollback(savedState);
        File.Delete("Install.txt");
    }
}

To Add a Setup Project

  • NewProject --> OtherProjects--> SetUp And Deployment

  • Set Properties of the project, using Properties Window

This article will provide the details

Hope This helps

Asad Butt
how do you expect to run this code when .NET 3.5 is going to be installed in you insaller
Junaid Saeed