How the C#winform program is published and automatically upgraded (illustrated)

Source: Internet
Author: User

A lot of friends asked about the C#winform program How to configure the upgrade, how to package, how to publish, here I explain the packaging and release
About packaging You can read my article how to package a C # WinForm program into a setup project (diagram)
In fact, packaging is packaged, release is published there is no relationship between the two, but some comrades will not be clear. Mixed up together.
Under the surface everyone will come with me to do a release and upgrade the program.
First, we'll prepare a few jobs.
1. Create a new directory to store post-release programs such as D:\iis\textWinform-Publish the Directory
2. Create a new Web site in IIS and point to the directory D:\iis\autoWinfrom, of course, this is your random, I just have a test the following abbreviation Upgrade directory because I am a computer, if you are real use, this is the configuration on your server
3. There is also an upgrade URL http://192.168.1.105:8055 This is just the address of my new website about how to configure IIS under the site operation, you can refer to my article IIS6.0 manual installation and configuration asp.net2.0|3.5|4.0 the whole process
All right, here we go.
1. Create a new project, it can be simple, because we just want to test the release function

I'll take an example of a program that calculates the length of a character.
The interface is as follows

The code is as follows

[C #] Plain Text View Copy Code?
01020304 privatevoid button1_Click(objectsender, EventArgs e)       {           richTextBox1.Text = textBox1.Text.Length.ToString();       }


It's very simple.
All right, here we go.
2. Release


We right-click the item to find the publication Word and click it
3. Select the Publish directory effect to send


This is our new release directory above.
4. Select Upgrade Server address


Choose the address of the IIS server that we configured above is OK.
5. Select the mode of operation


Here is the choice of whether the program allows the program to run in offline mode, of course, if you do need to choose No.
This is based on your situation.
6. Start Publishing

A report is generated before publishing, such as the next

Then click OK, it will be published in a few moments, and open the following interface directly!

That's right, even the upgrade and download interface helped us build. Isn't it great?
Do not hurry to install, because it is not yet, we have to configure the line,
Let's go to the publish directory and see what we're generating.


is these programs,

This is recorded in each release of the release, of course, we have to regularly do the appropriate cleanup, otherwise it will be more and more oh.
Let's just copy these programs to the upgrade directory .
Copy completed as follows

Well, our configuration work is done here.
Here is the problem of distributing users, if you want that computer to install your program, you can directly copy the Setup program to him on the line

Yes, that's it, and just need this one, or you can send the http://192.168.1.105:8055/publish.htm address directly to the user.
Then double-click on the user's computer to install

After a while the installation is complete,
The program will then open automatically as follows

Look, isn't that the program we just wrote? is not very excited ah.
It's a big thing to be here, so let's see where he's been installed.

Yes, right in the beginning of our program.
7. Upgrade

Here the client's work is completed, the user only need to click the program on the line, there is an upgrade will automatically prompt
Let's take a look at what happens if there is an update.
Let's add a Help button by adding an update to the example we just made.
The effect is as follows

The code looks like this

[C #] Plain Text View Copy Code?
01020304 private void button2_click ( object sender, EventArgs e)        {             richtextbox1.text = " As long as you enter the characters and click on the calculation will automatically calculate the length Oh   do not try " ;       


Hey, this can not be simpler, oh, you know what the meaning of the line, just to see the effect.
After the modification is completed, we will put this program on the above step by step, the final copy of the program to the directory to upgrade directory .
Then click the program that you just installed on the client

will automatically appear as the prompt, then we just click OK on the line.

Started upgrading.

How about, isn't it very simple ah, here we have completed the release and upgrade effect
8. Configuration

Everyone will be thinking, this is too simple, if you want to modify the installation of the directory, icons, such as how to operate it?
This is actually very simple. Right-click Project selection Properties

Find a Publication

All of these configurations are here,
Here, the version number, you will automatically increase each time you publish, that is, because its client program will automatically upgrade OH.
And you can also put the net running environment directly into the package, if the first time the client installed without the. NET environment, you can download directly from the upgraded website Oh. Isn't it convenient?
Even if it is over, if you do not understand, or what good advice can be keep abreast oh.
Finally, thank you for your support.

How the C#winform program is published and automatically upgraded (illustrated)

Related Article

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.