How to Create a C # Installer

Source: Internet
Author: User
Recently, I need to create a C # installation. I found some information on the Internet and found that it was not complete. I finally integrated some information and detected it myself, finally, Package C # As the installation program (package it into the simplest installation program. If you need higher functions, develop it yourself ). The specific steps are as follows:

This packaging process is completed in vs2008, but it is also applicable to vs2005. The program is written in C.

1. New installation and deployment.

Open the project you wrote, right-click the solution, and choose add> new project. 

 

Select another project type> installation and deployment> Installation Project. Change the name to the name you want, and then confirm.


 

2. After confirming, open the file system, click the application folder, right-click the blank area on the right, and choose add> project output.



 

3. Select the primary output and click OK. In this case, the application folder in the file system



 

4. Right-click the added primary output and create a shortcut. It can be renamed or not renamed. The name is picsee.



 

5. Cut the created shortcut, click the user's program menu, right-click it, add, folder, and rename the folder. The folder name is the name displayed in all programs at the beginning. Click the created folder and paste the shortcut in the blank area on the right. After the program is installed, the shortcut will appear in all programs.



 

6. Create a shortcut, cut it, click the user desktop, and paste it. After the program is installed, the shortcut appears on the desktop.



 

7. right-click "application folder" on the left. In the displayed Properties dialog box, remove "[manufacturer]" from "defaultlocation, otherwise, the default installation directory of the installation program will be "C: \ programm file \ your USERNAME \ installation solution name ".

8. Right-click your installation project name and properties.


On the open properties page, select "system essential". On the system essential page that appears, select the option as shown in. After the option is selected, it will be included in the generated installation package. netframework component, and then confirm.


9. Change the default icon of the program in the desktop and start program. Right-click the blank area on the right of the application folder and choose "add"> "file" to add an ico file.



 

Choose program menu> picsee, right-click the shortcut on the right, and select the Properties window. Add the newly added ICO icon to the icon attribute of the attribute.

Similarly, open the user desktop, right-click the shortcut on the right, and select the Properties window. Add the newly added ICO icon to the icon attribute of the attribute.

 

10. added the uninstall function.

In the blank area on the right of the application folder, right-click-> Add-> file and select the msiexec.exe file under the c: \ windows \ system32 folder. Rename it uninstall.exe. You can change the name.

Create a shortcut and cut it to your program menu> picsee.

 

11. Click the name of the installation project (picsee) with the left mouse button to view its properties. Note that it is not a right-click or attribute. View its productcode attributes. Copy the value of this attribute.


12. Then open the unmount shortcut Property dialog box that you created, enter "/X {productcode}" in the aguements property, in this example:/X {D8DB4DCF-B28A-49CB-9840-E36D68FD7EE1 }.



 

13. Right-click the name of the installation project (picsee) and click Generate to generate the installer with the uninstall function.

 Now, a simple installation program is ready. Thanks to all the netizens for their help and the information you provided.

How to Create a C # Installer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.