How can I remove all traces of a ClickOnce applica

2019-01-24 12:39发布

问题:

I have a ClickOnce application that about 120 customers are using. This week, I found out two customers declined an update in January and were stuck on an old version. I discovered this by deleting an ASP script the old versions used on our server. The customers that aren't updating get a 404 and call to ask why.

One customer clicked our install button again and got the latest version no problem. The other clicked our install button and gets an "Application validation did not succeed" error. The details of the error are SomeImage.gif "has a different computed hash than specified in manifest."

I don't want to deploy a new version because that usually results in phone calls asking, "did you add what I asked for yet?"

I figure I should be able to uninstall the application completely and resintall with the one problem user. Nope. The error persists. How can I remove whatever the Windows uninstall process leaves behind that would cause this error to persist?

Update:

I found the folder C:\Users\User\AppData\Local\Apps\2.0 on the customer's Windows Vista computer, and deleted it. We ran the installer again, and the error persisted after redownloading the application. I'm not 100% confident that this folder contained the whole program, though, but it is the only location on disk I could find that contained some resemblance of our application.

回答1:

Track down mage.exe in the Visual Studio tools folder (C:\Program Files\Microsoft SDKS\Windows\v7.0A\bin). Copy it to the user's computer. Try this:

mage.exe -cc

This clears the ClickOnce applications. I would also delete the \apps\2.0 folder AFTER you do this -- this is the cache created and used by ClickOnce applications.

Then reboot the computer.



回答2:

This may or may not help. My error messages weren't exactly as you describe, but I was eventually able to remove the final traces on my machine by going to:

HKEY_CLASSES_ROOT\Software\Microsoft\Windows\CurrentVersion\Deployment\SideBySide\2.0

I deleted all grandchild keys that bore names similar to my application. After that I was able to install and run the latest version.

This is on Windows 7 64 bit.



回答3:

Try doing a "Clean Solution" and then doing another Build. If you publish without incrementing the version number I don't think existing installs will get an update message.



回答4:

If you've already run the uninstall and it hasn't sorted it, try deleting the files in

C:\Documents and Settings\<userName>\Application Data\

You'll have to do some looking around to find your application, but it shouldn't be too hard.

In the past I've used the below code to avoid the users having to click the update button, this will install it without them even knowing.

Private Shared Function UpdatedApp(ByVal AppLog As Logger) As Boolean

    Try
        ' Check to see that this program has been delpoyed
        If Deployment.Application.ApplicationDeployment.IsNetworkDeployed Then
            Dim CurrApp As System.Deployment.Application.ApplicationDeployment = System.Deployment.Application.ApplicationDeployment.CurrentDeployment

            AppLog.WriteLine("Application Version : {0}", CurrApp.CurrentVersion)
            AppLog.WriteLine("Checking for updates")

            ' If theres a update then Install it
            If CurrApp.CheckForUpdate() Then
                AppLog.WriteLine("An updated version is available. This update will now be applied.")

                ' Update the app to the current version
                CurrApp.Update()

                ' Upgrade the settings (that is, the connection string).
                My.Settings.Upgrade()

                AppLog.WriteLine("Version {0} is now installed, the application will now restart", CurrApp.UpdatedVersion)

                Return True
            End If
        Else
            AppLog.WriteLine("Application version: *Dev Version*")
        End If
    Catch ex As Exception
        AppLog.WriteLine("The application is unable to check for updates. The program will execute on a possibly outdated version. Error {0}", ex.ToString)
    End Try

    ' Always return false unless the update has been applied (even if the update throws an error)
    Return False
End Function


回答5:

Have you attempted to rollback a version with the ClickOnce Application? You can do this when you got to the Programs and Features and then uninstall on your app.

This should then leave your App in a state where it would then request the latest update again.