tags:

views:

12

answers:

1

Hi. I want to deploy app painlessly having autoupdate turned on. However I'm forced to use MSI installer for various purposes. We'll deploy winforms app 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 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 manifest file compare hash codes under hash tag (<dsig:DigestValue>V1FBG6P353V5CT4JofOCwe0opeA=</dsig:DigestValue>)
4.If hashes are different download corresponding file stripping .deploy extension to temp path

extension to temp path

Now, for WinForms I could write some AppStarter that will start main app and shut down main app on detected updates, overwrite all the exes and dlls that are downloaded and restart the app.

For windows service I want to wait untill main cycle is finished (cycle triggered by timer), then stop the timer and apply updates. How? I'm not sure.

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 xml structure will stay invariant with time (at least to presicion of existing tags)?

I've also downloaded .NET Application Updater from [http://windowsclient.net/articles/appupdater.aspx][1] It is just that I have to form xml files myself and am not sure if it will allow to work with windows services.

[1]: http://windowsclient.net/articles/appupdater.aspxextension to temp path