开发者

Semi ClickOnce autoupdate

I want to deploy an application painlessly having autoupdate turned on. However, I'm forced to use an MSI installer for various purposes. We'll deploy a Windows Forms application and a bundle of Windows services.

I really liked how you can click few buttons in the publish tab and have it all deployed to a web server with .application and .manifest files. So, I can now publish changes, but can't pick them up automatically. I'm trying to write an autodownloader myself.

  1. Compare .application files (local and remote), <assemblyIdentity name="ClickOnceAppTest.application" version="1.0.0.5" ... for a version value if local version is not less then remote one then STOP.
  2. Read <dependentAssembly dependencyType="install" codebase="Application Files\ClickOnceAppTest_1_0_0_5\ClickOnceAppTest.exe.manifest"... to get path to the manifest file.
  3. For each tag, like <dependency> <dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="ClickOnceAppTest.exe" size="26112"> <assemblyIdentity name="ClickOnceAppTest" version="1.0.0.1" ... in the manifest file, compare hash codes under the hash tag (<dsig:DigestValue>V1FBG6P353V5CT4JofOCwe0opeA=</dsig:DigestValue>)
  4. If hashes are different, download corresponding file stripping the .deploy extension to a temporary path

Now, for Windows Forms I could write some AppStarter that will start the main application and开发者_JAVA技巧 shut down main application on detected updates, overwrite all the EXE files and DLL files that are downloaded and restart the application.

For Windows service I want to wait until the main cycle is finished (cycle triggered by a timer), and then stop the timer and apply updates. How?

This very general algorithm must have pitfalls (my intuition tells me) of which I'm unaware and for this reason I'm posting this question. What could go wrong and when? Do you think the XML structure will stay invariant with time (at least to presicion of existing tags)?

I've also downloadeded the .NET Application Updater. It is just that I have to form XML files myself and am not sure if it will allow to work with Windows services.


I think, I had a similar problem. I deployed a Windows service with two windows screens. One screen to control Windows service start/stop and install/uninstall. One more for the deployment using ClickOnce.

I added a Windows service as well as a configuration screen into the deployment project as content files. When the client deploys a ClickOnce project, all these files will be deployed on the machine. Since ClickOnce can't deploy a Windows service, the user needs to invoke a configuration screen and install/start the Windows service by copying the Windows service onto a default folder.

Copying a Windows service to another folder is necessary because Clickonce changes folders for each release. The deployed application will later be scheduled to check for updates. When the latest release is available, it will prompt the Windows service to stop and updates itself and starts the Windows service again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜