How can I remove all traces of a ClickOnce application from a customer's computer?

有些话、适合烂在心里 提交于 2019-11-29 04:28:58
RobinDotNet

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.

InteXX

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.

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.

pingoo

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

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!