How can I roll-back a ClickOnce application?

Viewed 31223

Is there a way (hacky will do) to allow a user to go back to a previous version of a ClickOnce network deployed application?

I've looked in the docs and API and there seems to be no way. You can selectively choose if you would like to update, but once updated there is, seemingly, no way back.

9 Answers

ClickOnce will use whatever version you send them. If you send them an old version, they will rollback to that old version.

Back in May my buddy David wrote an article on how to do this on a per-user basis. We can literally have every user on a different version. The application even tells the database which version the user wants, so they could in theory change their version and then simply restart the application.

Fine Grained Versioning with ClickOnce

You can go in Add/Remove application and select your application and choose to get the last installation instead.

Just used this to roll back a clickonce application developed in Visual Studio 2017. In my case, in the root folder, there were just two files; one called [applicationName].manifest, the other setup.exe.

The [applicationName].manifest contained a number references to the current version number but each were linked to a publicKeyToken value so I was reluctant to manually edit it.

So, in the Application Files folder, under to the sub folder containing the version I wanted to roll back to, I found another [applicationName].manifest, which I copied to the root folder (having backed up the original).

And that was it. It worked for me and was a really simple solution. However I'm not using a minimum required version so can't say whether that would affect it.

If you look at your deployment location, you'll see every previous version, in a separate folder with the version number appended, as well as the deployment manifest, also with the version number appended.

You can rename any one of them to be the current deployment, and the next time you update that application, it'll pull in the version you rolled-back to.

Related