Cancel during update will not Rollback the application

When we install an update of our application and we cancel the update process. The updater will not rollback to the previous version. Instead the application is partially patched and will crash when it is started.Then when I run the updater again from the installed directory the update will continue and updates the application to the latest version.After that it does run again.

What can be a reason that the tool will not rollback during an installation?

What can be a reason that the tool will not rollback during an installation?

No, we can't reproduce this here. Canceling an update should stop the current progress and rollback all changes to exactly the state your app was in before the update started.

What version of wyUpdate are you using?What version of Windows are you on?Have you modified the wyUpdate source code?Is wyUpdate code signed?Do you get a crash when you click "Cancel Update"?

Hi,

>What version of wyUpdate are you using?2.6.18.4

>What version of Windows are you on?We tested this on a windows XP SP3 clean install + .net framework 3.5SP1

>Have you modified the wyUpdate source code?No we haven't

>Is wyUpdate code signed?Yes

>Do you get a crash when you click "Cancel Update"?No the tool didn't crash when we pressed cancel

Can you reproduce this behavior? If so, then you'll need to send us your old app version that has an error in it, thus causing wyUpdate to fail (and presumably fail to roll back).

Yes we can reproduce this behaviour. I can send you an installer of the program we are updating, however you can't connect to the update server because it is on an internal Philips server.

That's OK -- just send us the files (or if the files are large, a link to the files). Your installer of the "old version", then rebuild your updates to use %updatepath%/%file% for the download site (you can change it back to whatever you have now after you've built the updates so we can use them).

Email us at support@wyday.com and we'll take a look at it later today.

Does that make sense?

I rebuild the the updates with %updatepath%/%file% as the download site and send you a link with the items.

Also I have tried to find out what happens when the computer crashes during an update.

At the moment this also results in a corrupted application. This is kind of logical because of partially patched files. But when I start the updater again, then it states that it is already at the latest version. What is not the case.

Do you have any suggestions for this issue?

I rebuild the the updates with %updatepath%/%file% as the download site and send you a link with the items.

Thanks, we got it. We'll take a look at it.

Also I have tried to find out what happens when the computer crashes during an update.

In that case the user will have a partially updated application -- (we don't do "transactional" updates yet). In this case you'd want to update by including an MSI installer in wyUpdate and executing that. MSI currently does transactional updates.

Do you have any suggestions for this issue?

This shouldn't happen. How are you "crashing" the computer? The client.wyc is the very last file changed, and it's only changed after everything else has successfully updated.

We are testing wyUpdate in a virtual machine to always have the sama test parameters. To crash the pc we just send a power down command to the virtual machine and it will stop. It is the same behavior if you would pull the power cord.

We're looking into reproducing this too -- obviously it shouldn't happen.

Any updates so far on this item?

We're still looking into reproducing this.

Still no changes?

We're not having any luck reproducing your problem. We've been digging into the updates to see where a possible error *might* be, but it has been speculative. We haven't given up. We're still digging.

I guess there is still no update?

No, we haven't been able to reproduce this. Can you make a small example project that reproduce this?

You cannot possibly correct for this.

Any computer where you yank the power in the midst of its operation is going to exhibit various degees of 'undefined behavior' as the filesystem comes back to a state that - though consistent (assuming this is an NTFS partition) - is not necessarily coherent (as you're experiencing).

Seriously.... you yank the power and wonder why it doesn't roll back properly? Am I totally misunderstanding you, or did you really say that?

Well, there were 2 issues brought up in this thread by Hubert:

1. That cancelling an update won't rollback the update. We can't reproduce this. wyUpdate rollsback the update everytime.

2. Stopping an update by "catastrophic event" (plug pulled, meteor shower, or whatever) doesn't roll back updates. Yes, wyUpdate doesn't recover from this type of event. Meaning your app will be in a bad "half state" between your old version and your new version.

Now technically there is a way to get around this problem. Windows supports "transactional file / registry changes" thus we *could* solve this problem. We just haven't had the time to implement the necessary changes (a massive amount of changed code). And even then, not everything wyUpdate does can be transactional (COM signing, executing files, etc., will all be non-transactional). So at best we can only half solve this problem due to limitations in the Windows API.

But again, this isn't a *huge* problem. Why? Because if the user's computer suffers power loss mid update then they can always just reinstall your app. Even your old version of your app, then retry the update and hope the power remains on.

So to sum up. We can't reproduce 1 (works for us). And 2 is a problem that effects a huge number of programs (most, in fact) including wyUpdate.