I have a VSTO Excel Template project that is Installed/Updated by ClickOnce. If I run an automatic update it updates fine, but I would like to give the user the option of a manual update.
The problem is that executing ApplicationDeployment.CurrentDeployment.UpdateAsync (or .Update) does not result in any errors, but the deployment simply just doesn't update. The version number in Add/Remove programs stays the same, and even more unusually the ApplicationDeployment.IsNetworkDeployed flag switches to false.
Thus it seems that the only effect of running .Update is to set IsNetworkDeployed to false. The full code is a bit long, but basically it boils down to:
Private Sub ThisWorkbook_Startup() Handles Me.Startup
Dim info As UpdateCheckInfo
If ApplicationDeployment.IsNetworkDeployed Then
Dim AD As ApplicationDeployment = ApplicationDeployment.CurrentDeployment
info = AD.CheckForDetailedUpdate
If info.UpdateAvailable Then
AD.UpdateAsync()
End If
End If
End Sub