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

前端 未结 5 1679
孤独总比滥情好
孤独总比滥情好 2020-12-17 01:41

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 dis

相关标签:
5条回答
  • 2020-12-17 01:49

    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.

    0 讨论(0)
  • 2020-12-17 02:05

    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.

    0 讨论(0)
  • 2020-12-17 02:06

    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.

    0 讨论(0)
  • 2020-12-17 02:06

    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.

    0 讨论(0)
  • 2020-12-17 02:12

    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
    
    0 讨论(0)
提交回复
热议问题