This is actually a deployment issue. See the following steps:
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 ApplicationProgramFolder "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's 'project' 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 "user's 'project' menu" and "User desktop" directories and locate your files.
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, ([vs2008] project-> setup1 properties), select Properties: On the open properties page, select "system required ", on the System essentials page, 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:
Add an msiexec.exe file in the c: \ windows \ system32 folder. After adding the file, change its name to "uninstall.exe" to make it more like an uninstall program ", of course, this does not matter. You can change it if you do not change it.
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.