C # how to package and release an application for the winform Program (Graphic tutorial)

Source: Internet
Author: User

·C #HowWinformProgramPackage and publish an application(Illustration)

1: Create an installation and deployment project
Open Vs, Click Create Project , Select : Other project types -> Installation and deployment -> Installation Wizard ( The same is true for the installation project. ), Click OK. .( For details, see )
The image of this topic is as follows:

2: Installation Wizard
Close and 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 , Select Add -> File , Add the executable files and corresponding class libraries and components of your application. .

Right-click your Executable File , Create shortcuts , Then cut or copy the shortcuts to the left " User's ' Program ' Menu " And " User Desktop " Medium .
After the installation is complete " Start -> All programs " And " Desktop " Generate a program on the shortcut .

Right-click " Application folder " Open Properties dialog box :
Set " Defaultlocation " In "[Manufacturer]" Remove ,
Otherwise, the default installation directory of the installation program will be "C: \ programm file \ Your username \ Installation solution name ";
Then open solution Manager , Right-click your solution name , Select attributes :
On the open property page , Select " Required ",

On the system prerequisites page , Select the following items , This is important !!!!! 1 !!!!!
After selection , The generated installation package contains . Netframework Components .( This option is not selected by default. )

Okay. , This completes 99% Now , Then click " Generate -> Generate a solution ", Ha , Generated successfully !
4: Production completed
Open Debug Folder , The generated Installation File is displayed. .
Continued ] About " Uninstall " Function Addition
The above article only introduces a simple method for generating and installing ,
However Vs. net2005 There is no function to directly generate the uninstall program. ,
So we have to use Msi To achieve ,
I will not talk about the principle. , A bunch of online searches , I only talk about operations ,
【 1 ]: When adding your application project, add one more Msiexec.exe Go in ,
This file is stored in C: \ windows \ system32 Folder ,

After adding , To make him more like an uninstalling Program , Change his name "Uninstall.exe ",
Of course, this has little to do , It can be changed. .
Then create a shortcut for him. , Put it on the desktop or " Start - Program " Medium ,
I chose to place it in the Start Menu. , Next, what we want to do is to find the deployment project Productcode Now ,
Left-click Project Name , Remember to click , Click the attribute label. , Note: : Not the right-click attribute ,
This is very different. , Then you can see Productcode Now ,

Then open the shortcut Property dialog box that you created ,
In Aguements Attribute Input "/X {productcode }",


Okay. , Then click " Generate a solution " You can generate an installer with the uninstall function. .

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.