Automatically update the appupdater component.

Source: Internet
Author: User
The appupdater component can be updated. The main problem is that you need to configure the virtual directory on the server and set the access permission to "directory browsing ".

Smart Client development: Use the appupdater component
I was going to introduce the Updater application block today. Later I thought it was too difficult to integrate UAB into my own applications and asked if I had a simpler way to deploy the Smart Client. Before Whidbey clickonce came out, of course there are still some answers, that is, using the appupdater component. Issuevision and taskvision, introduced at teched 2004 in the United States, use this component to deploy Smart Clients.

The following files are used to use the appupdater component: You can download them in the http://windowsforms.net/downloads/GDN/dotnetupdater.zip.
File Name Function Description
Appstart.exe is similar to an intermediary agent program that starts a real application. The main application is not started directly to prevent the upgrade from being locked during the upgrade of the main application.
Appstart. config appstart.exe configuration file, which specifies the directory of the application to be started and the name of the application to be started
Appupdater. dll is the most important component and the main component for automatic upgrade.
System. Resources. dll resource file
Mscorlib. Resources. dll core resource file
Updateversion. XML server version upgrade configuration file

OK. Let's get started with how to use it.

(1). Import appupdater in custom control
(2) configure the automatic download Option

Autofileload: True
Changedetectionmode servermanifestcheck
Updateurl http: // yourserverdomainname/smartserver/updateversion. xml
Showdefaultui: True

Autofileload allows the file on the server to be dynamically loaded. You can think of it as a function similar to assembly. loadfrom in the un-touch deployment.
Changedetectonmode is used to set the detection mode: Checks based on the configuration file, that is, the file specified by the updateurl attribute. If it is set to directfilecheck, the time stamp of each file is compared to determine whether to download the file.
Updaterurl refers to the Update Configuration file on the server. The content of updateversion. XML is as follows:
<Versionconfig>
<Availableversion> 2.0.0.0 </availableversion>
<Applicationurl> http: // yourserverdomainname/smartserver/VER/</applicationurl>
</Versionconfig>

Updateversion. xml explanation:
<Availableversion> 2.0.0.0 </availableversion>
The current available version of the client. The appupdater component of the client compares the version number of the local application and the version number of the configuration. if the version is higher than the local version, download and update the application.

<Applicationurl> http: // yourserverdomainname/smartserver/VER/</applicationurl>
Tell the client which URL to download and update

We recommend that you set this attribute to dynamic, that is, read it from the configuration file. the config file can be downloaded. We also need to set it in the "configuration" of the Asp.net application in IIS. Access is not allowed by default.

Showdefaultui indicates that a simple interface prompts you whether to start the new version at the end of the download. You can also use your own form display to set it to false and write code in the onupdatecomplete event to display your form.

Of course, there are other attributes, such as whether to use the public key (either a or an assembly containing multiple public keys) to verify the file to be downloaded. Due to the time relationship, I will not talk much about it.

(3) Use appstart.exe to start the actual application.
(4) set the download folder in IIS to allow directory browsing, because appupdater needs to enumerate all the files in it and download them to the local machine. In case of windwos 2003, You need to allow WebDAV and set the. config file to allow download.
(5) Make an MSI Installation File and package the application. When the application is running, it can automatically determine whether the latest version is available and download it to the local computer for running.

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.