1
votes

Currently, we have a ClickOnce deployment that forces users to download the client from our publish location if it is newer than their client when they launch the application. We want this behavior as it enforces what client app the users are using. However, there have been times where we needed to rollback the software. When this happens, the only solution we know of is to uninstall the application and have them re-install from the publish location.

Is there a way to force ClickOnce to pull down the version from the publish location if it is different (not just newer) than what they are running?

2
Seriously, the frequent need to roll back production releases does not speak well of your Software QA. Also, obviously, a downgrade is an update of a kind. - Marcus Müller
@MarcusMüller Actually, the rollback isn't a rollback due to defects/errors, so it doesn't speak at all of my Software QA. - UnhandledExcepSean
Is there something preventing you publishing the downgrade as a new update? - codeConcussion
@codeConcussion do you mean to change the version number so it looks like an upgrade? - UnhandledExcepSean
@Ghost - right. old code. new version number. - codeConcussion

2 Answers

1
votes

What you want to do isn't possible with ClickOnce.

Your primary option is to publish your downgraded code with an incremented version number. You stated you don't want to do this because it's confusing to users. I tend to keep my ClickOnce version something that only ClickOnce uses. I maintain my own application version separately and that's what I display to users in the app. Yes, the ClickOnce version still displays in Add/Remove Programs but I think that's very minor.

Another option would be to change your ClickOnce deployment to not force a minimum required version. That then enables an option on the uninstall dialog to rollback to the previous version. I don't like this at all, but it is the one rollback scenario ClickOnce supports.

The only other option I see is to try to do something through code. Determine in your app that a downgrade is needed. Somehow shell out to a script or exe outside your app that will uninstall it (maybe with this) and open the link to your .application file to re-install the latest version. This is total speculation. I'm not sure it's even possible.

0
votes

Assuming you don't have the minimum version filled in, try copying the .application file for the previous version over the one in the top level directory where you deployments are. The .application file in that directory tells the app which one to install. Assuming it points to the right deployment folder (matching its version), and you have that folder on your deployment server, it should downgrade the version the user has installed.

Another way to do this is to copy all of the files from the previous version. Change the folder name to a newer version. Then use mageui to update and sign the two manifests, and copy everything to the server. This will automatically be installed because the version is newer.