Update a service on windows

Comments

6 comments

  • Avatar
    michiel

    The update tool downloads the new update and runs it. The uninstaller nor any uninstallation actions will be executed. Instead the update installer should delete the service as a pre installation action using <deleteWindowsService>. For example:

    <project>
        ...
       <preInstallationActionList>
           ...
        <deleteWindowsService>
           <abortOnError>0</abortOnError>
           <displayName>Sample Service</displayName>                 
           <serviceName>SampleService</serviceName>
         </deleteWindowsService>
         ...
       </preInstallationActionList>
       ...
    </project>

     

    1
    Comment actions Permalink
  • Avatar
    John Brydon

    Got it, thanks

    0
    Comment actions Permalink
  • Avatar
    John Brydon

    What would happen if something went wrong during the update if say after the preInstallationActionList, I had removed the service like listed above, and then something went wrong like disk space ran out? Does it have some sort of rollback feature like putting the service that was deleted back and putting the old binaries etc back?

    0
    Comment actions Permalink
  • Avatar
    BitRock support

    You could use <stopWindowsService>  in the <preInstallationActionList> and then delete it in the <postInstallationActionList>. In that way it will only be deleted if the installation is successful. You could start the service again if the installation fails by using <startWindowsService> in the <installationAbortedActionList>

     

    0
    Comment actions Permalink
  • Avatar
    John Brydon

    Does the software handle any rollback functionality automatically - i.e. it made the backup folder when update started but if anything fails will it try to revert to the backup or do I have to handle the necessary actions after the updater returns failure?

    0
    Comment actions Permalink
  • Avatar
    michiel

    You can use <enableRollBack> which automatically backs up any files overwritten during the installation and restores them if an error occurs during the installation process. 

    You can find more information about the rollback feature in the following section of our manual:

    https://clients.bitrock.com/installbuilder/docs/installbuilder-userguide.html#_rollback

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.