Recently, I have made a research on the software installation package. Below I have recorded a simple method without writing code.
1. New Project ----> other project types ----> Visual Studio installer ----> setup Project
Name: Install
In this case, there will be three folders in the file system column of vs2010,
1. "application folder" indicates the files to be added to the application to be installed;
2. "user's programs menu" indicates that after the application is installed, the content displayed in the user's "Start Menu" is generally stored in this folder, and you need to create another folder for storage: application Program .exeand uninstall program .exe;
3. "user's desktop" indicates the. exe shortcut created on the user's table after the application is installed.
2. Right-click the application folder and choose add file to add the file to be packaged;
The file to be added is generally the file that the program is released in the hard disk after installation, that is, the file (including executable files and folder data) required for program execution ).
Add the icon of the shortcut to be created: ICO
3. Right-click the created Project Name (install) and choose Properties.
Select required/prerequisites, and then select.. net, and Windows installer3.1 (Optional). Here I select VISUAL C ++ 2010 runtime libraries (x86) based on the project requirements ).
Select "Download prerequisites from the same location as my application" to package the. NET Framework Package. the. NET Framework component is not downloaded from the Internet during installation, but the installation package is relatively large.
Vs2010 releases. net4.0. When creating an installer, you need to set the startup conditions: on the project name (setup1), right-click and choose View> startup conditions ":
Then vs2010 will create the following file:
In "Startup condition", click ". NET Framework" and select. NET Framework 4 client profile on the version;
4. Set the directory (PATH) of the Installation File: click the "Install" button (not right-click) of the created Project name, and set the parameters in the properties as follows:
Here, author is the author; manufacturer is the company name; productname is the application name;
Set installallusers to true. (In this way, the company name will be displayed in the "control panel" program; it will be "anyone" by default during installation; otherwise, it will be "Only Me" by default ")
Click the left button on the application. For example, the first is the system main directory (default c: \ programe), the second is the company name ([manufacturer]), and the third is the application name, in this way, two layers of file paths will be created during installation.
You need to delete [manufacturer] In defaultlocation. Only the application name is deleted.
5. Create an application icon and uninstall the application:
A. In the "Application folder.exe file", right-click and create a shortcut:
Rename, and right-click Properties: select icon. After confirming, drag the shortcut to "user's desktop ".
B. Add a folder in "user's programs menu" named "software name". Then, create the Startup File .exe in the same style and drag it to the file just created by "user's programs menu;
Then create an uninstallation program for the. NET application:
Add: c: \ windows \ system32 \ msiexec.exe in "application folder"
Right-click to create a shortcut and rename it as "Uninstall". Drag the shortcut to the file you just created;
Click the project name (install) and find: productcode in properties
Copy this productcode and paste it to the arguments attribute of the "Uninstall" shortcut. Add/X space before it.
6. After completing the preceding steps, you can generate a solution.
7. After the solution is generated, we need the installation package in the release folder.
Next we need to solve a common problem: if the user uses our software license to install another program or configuration file, that is, the .exe file, we want the installer to execute or install a specified program when execution is complete. Open custom actions and select the "Install" node in the Custom operation editor. Right-click "add M action" and double-click "application folder" in the "select item in project" dialog box ". Select the program to be executed, and click OK to close the dialog box. Click the file. In the "properties" window, select the customactiondata attribute and type a parameter. Compile and generate setup.exe.
[References][1] vs2010 release, package and installation procedures exceed full details
Create the vs2010 installation package