Create a Self-Updating WinForms App with the Application Updater Block[4]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

">>
      <baseDir>C:\Program Files\YourApp</baseDir>
     
<xmlFile>C:\Program Files\YourApp\AppStart.exe.config</xmlFile
>
     
<tempDir>C:\Program Files\YourApp\temp</tempDir
>
   
</client
>
    <server
>
     
<xmlFile>http://[YOUR URL]/ServerManifest.xml</xmlFile
>
    
<xmlFileDest>C:\Program Files\YourApp\ServerManifest.xml</xmlFileDest
>
    
<maxWaitXmlFile>60000</maxWaitXmlFile
>
   
</server
>
  </application
>
 </UpdaterConfiguration
>
 
</appUpdater>

Step #8 Deploy Version 1.0.0.0

Version your app.  You do this by setting the version attribute of your app's AssemblyInfo.cs file.

[assembly: AssemblyVersion("1.0.0.0")]

Build the Application and copy version 1.0.0.0 to your program file's 1.0.0.0 directory. “C:\Program Files\YourApp\1.0.0.0“

At this point, you should be able to run AppStart.exe.  The update process should fail, since we haven't deployed the ServerManifest XML file which tells our app that there's a new version available.  You can inspect the log files that should be created in your C:\Program Files\YourApp\ directory.

Step #9 Buld Version 1.0.0.1 

This is the fun part.  First, create revision 1.0.0.1 by updating your application's AssemblyInfo.cs and App.config files to reflect the new version.  Build your application, and copy the files to the web server directory created in step #6. 

Step #10 Create Your Server Manifest File

This should be the last step.  Any changes you make to the .config files from this point on will require repeating this step.  To do this:

本文关键:Create a Self-Updating WinForms App with the Application Updater Block
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top