1. click File> new project.
Select the setup project in other project types-> setup and deployment. Enter the installation package name setupmyapp In the Name field, and select Add to solution for solution. The location remains unchanged. Click OK.
2. Go to file system Editor (select setupmyapp in Solution Explorer. This option is available in the toolbar above)
Right-click Application folder, select Add-> project output, select your project, select primary output, and select OK. The DLL or EXE file generated at the end of the project is added.
You can also add other files required for installation. If you want to add a folder (if there are many subfolders), you can drag the folder from your computer to application folder.
3. Add shortcuts
Right-click primary output from Xpress in application folder and select create export cut to primary... In this way, the shortcut of the main program is added, renamed as MyApp 1.0, and then cut to users desktop.
Add a folder MyApp 1.0 to the user's programs menu, and create a shortcut to cut it to it.
In this way, there is a main program on the Start menu and desktop.
PS: After installation, I found that the main program icon is not what I want. If I want to change the icon, there is an icon in the properties of MyApp 1.0 shortcuts, click Browse. You can select one from the icon added before application folder or from your computer.
4. added the uninstall program.
Right-click Application folder and choose add-> file... find msiexec.exe in system C:/Windows/system32to add
Create a shortcut, change the name to uninstall MyApp, and cut it to users programs menu-> MyApp 1.0
Select setupmyapp in Solution Explorer and copy the prodectcode: {415878ef-605f-4bb0-a41f-a57f92a5d439} in the property}
Select uninstall MyApp, enter/X space in the arguments field, and then paste it.
5. Add associated programs
Click Properties in Solution Explorer. In the displayed dialog box, select prerequisites to check. NET Framework 2.0, Windows Installer 3.1, and other associated programs.
In specify the install location for prerequisites, Select Download prerequisites from the same location as my application
6. Set the installation language and Path
In setupmyapp attributes, localization can select a language, manufacturer can fill in the company name, productname can fill in the MyApp, etc.
Finally, compile.