Search code examples
c#.netinstallationwindows-installerwindows-media-player

install dependencies automatically when user install software (.Net)


I'm building a software using .Net 3.5 (c#, WPF), My software need to user install .Net 3.5 and Media Player 11. I want to build an installer that automatically install this two component while user install main software. How i can fix that? this components:

1- .Net 3.5

2- Media Player 11


Solution

  • Create a setup package using visual studios instructions (Updated Link). for vs2010:

    1. On the File menu, point to Add, then click New Project.
    2. In the resulting Add New Project dialog box, in the Project Types pane, open the Other Project Types node, open Setup and Deployment Projects, and select Visual Studio Installer.
    3. In the Templates pane, choose Setup Project for a standard setup, or Web Setup Project for a Web application.

    I usually do this inside the solution i want an installer for. You will create a project like: installer project

    Note the detected dependancies folder. In here, make sure you have the relevant .net framework and media player modules. Building this wil produce a .msi and a .exe, and will also output an installer for the framework plus other compnents and assemblies. When the user runs the exe, they will be prompted to install the necessary dependencies.

    Ofcousre there are other installer packages, but this one is visual studios integrated and i find it works great for many purposes.

    Edit:

    Adding dependencies: Right click the installer project -> properties - > prerequisites, select the .net framework desired.

    for all other dependencies right click the installer project -> add -> assemblies and either browse to the assembly you want or if it is .net, select it from the list