1. Create an installation and deployment project
Open VS, click "Create Project", select "other project type"> "installation and deployment"> "Installation Wizard" (the same is true for the installation project), and click "OK.
2 Installation Wizard
Open the Installation Wizard, click Next, or click Finish.
3. Start production.
After the installation wizard is complete, you can enter the project folder:
Double-click "application folder", right-click the blank area on the right, and choose "add"> "file" to add executable files and corresponding class libraries and components of your application. Right-click your file, create a shortcut, and copy or cut the shortcut to "user program menu" and "User desktop" on the left. After the installation is complete, a shortcut is generated on "start-> All Programs" and "desktop. You can also create a shortcut in the corresponding directory of "user program menu" and "User desktop" and locate your file.
Right-click "application folder" on the left to open the Properties dialog box: Remove "[Manufacturer]" from the "DefaultLocation" path in the property, otherwise, the default installation directory of the installation Program will be "C: Program Files your USERNAME \ installation solution name ";
Open solution manager, right-click your solution name, and select Properties: On the open properties page, select "system essential". On the system essential page that appears, select the following option in "specify the location of required system components": download the required system components from the same location as my application. After the installation is selected, the. NetFramework component is included in the generated installation package. Now, 99% is complete, and then click "generate-> Generate solution". Ha, generation successful!
4. Production completed
Now open the Debug folder under the solution folder and you will be able to see the generated Installation File.
5. Add the "Uninstall" Function
The preceding section only describes how to generate and install a program. However, the uninstall program function is not directly generated in VS2005. Therefore, we have to use msi to implement the function. The procedure is as follows:
When setting your application program objectives, upload an msiexec.exe file in the c: windowssystem32 folder. After adding the file, change the name to "Uninstall.exe" to make it more like an uninstall program. Of course, this does not matter, it can be changed.
Create a shortcut and place it in "start-program". Next, we need to find the ProductCode of the deployment project. Click the project name with the left mouse button. Remember to click it with the left mouse button, click the attribute tag. Note: This is not a right-click attribute. The difference is great. Then you can see the ProductCode.
Open the shortcut Property dialog box that you created, and enter "/x {ProductCode}" in the Aguements property, click "generate solution" to generate the installer with the uninstall function.