install dependencies automatically when user install software (.Net)

隐身守侯 提交于 2019-12-08 06:32:41

问题


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


回答1:


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:

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



来源:https://stackoverflow.com/questions/9903382/install-dependencies-automatically-when-user-install-software-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!